wt1.1.2d ProgressInfo+
This commit is contained in:
+23
-2
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user