wt1.1.2d ProgressInfo+

This commit is contained in:
Bossanyi Tibor
2020-10-09 07:54:54 +02:00
parent 0cdc3a9d24
commit 35f0d0042f
66 changed files with 1615 additions and 576 deletions
+23 -2
View File
@@ -7,6 +7,13 @@ import 'package:aitrainer_app/repository/user_repository.dart';
import 'package:flutter/cupertino.dart';
import 'package:intl/intl.dart';
class DateRate {
static String daily = "daily";
static String weekly = "weekly";
static String monthly = "monthly";
static String yearly = "yearly";
}
mixin Common {
final EMAIL_ERROR = "Please type a right email address here.";
@@ -24,7 +31,7 @@ mixin Common {
}
ExerciseType getExerciseType( int exerciseTypeId ) {
ExerciseType returnElement = null;
ExerciseType returnElement;
List<ExerciseType> listExerciseType = Cache().getExerciseTypes();
if ( listExerciseType != null ) {
for ( var element in listExerciseType ) {
@@ -32,7 +39,7 @@ mixin Common {
returnElement = element;
break;
}
};
}
}
return returnElement;
}
@@ -79,4 +86,18 @@ mixin Common {
return ((dayOfYear - date.weekday + 10) / 7).floor();
}
String getDatePart(DateTime date, String dateRate) {
String datePart = DateFormat('MM.dd', AppLanguage().appLocal.toString()).format(date);
if ( dateRate == DateRate.weekly ) {
datePart = weekNumber(date).toString();
} else if ( dateRate == DateRate.monthly ) {
datePart = DateFormat('MMM', AppLanguage().appLocal.toString()).format(date);
} else if ( dateRate == DateRate.yearly ) {
datePart = DateFormat('y', AppLanguage().appLocal.toString()).format(date);
} else if ( dateRate == DateRate.daily ) {
datePart = DateFormat('MM.dd', AppLanguage().appLocal.toString()).format(date);
}
return datePart;
}
}
+15
View File
@@ -0,0 +1,15 @@
import 'package:aitrainer_app/model/exercise.dart';
abstract class GroupData {
void iteration();
bool checkNewType(Exercise exercise);
void addTempData(Exercise element);
void temp2Output(Exercise exercise);
void resetTemp();
}