wt1.1b exercise description, bug fixing + custom exercise fix
This commit is contained in:
parent
4d9f2e5152
commit
e938f1be8c
@ -50,7 +50,7 @@
|
|||||||
"BMI": "BMI",
|
"BMI": "BMI",
|
||||||
"BMR": "BMR",
|
"BMR": "BMR",
|
||||||
"Sizes": "Sizes",
|
"Sizes": "Sizes",
|
||||||
"Save Exercise": "save Exercise",
|
"Save Exercise": "Save Exercise of:",
|
||||||
"Save": "Save",
|
"Save": "Save",
|
||||||
|
|
||||||
"Name": "Name",
|
"Name": "Name",
|
||||||
@ -103,5 +103,7 @@
|
|||||||
"Your Body Type": "Your Body Type",
|
"Your Body Type": "Your Body Type",
|
||||||
"Ectomorph": "Ectomorph",
|
"Ectomorph": "Ectomorph",
|
||||||
"Endomorph": "Endomorph",
|
"Endomorph": "Endomorph",
|
||||||
"Mesomorph": "Mesomorph"
|
"Mesomorph": "Mesomorph",
|
||||||
|
|
||||||
|
"Description": "Description"
|
||||||
}
|
}
|
@ -50,7 +50,7 @@
|
|||||||
"BMI": "Testtömegindex",
|
"BMI": "Testtömegindex",
|
||||||
"BMR": "Alapanyagcsere",
|
"BMR": "Alapanyagcsere",
|
||||||
"Sizes": "Méretek",
|
"Sizes": "Méretek",
|
||||||
"Save Exercise": "gyakorlat mentése",
|
"Save Exercise": "Gyakorlat mentése:",
|
||||||
"Save": "Mentés",
|
"Save": "Mentés",
|
||||||
"The number of the exercise": "Írd be a gyakorlat számát",
|
"The number of the exercise": "Írd be a gyakorlat számát",
|
||||||
"The number of the exercise done with": "Írd be, mennyivel csináltad a gyakorlatot",
|
"The number of the exercise done with": "Írd be, mennyivel csináltad a gyakorlatot",
|
||||||
@ -103,6 +103,8 @@
|
|||||||
"Your Body Type": "Milyen a testtípusod?",
|
"Your Body Type": "Milyen a testtípusod?",
|
||||||
"Ectomorph": "Ectomorf",
|
"Ectomorph": "Ectomorf",
|
||||||
"Endomorph":"Endomorf",
|
"Endomorph":"Endomorf",
|
||||||
"Mesomorph":"Mezomorf"
|
"Mesomorph":"Mezomorf",
|
||||||
|
|
||||||
|
"Description": "Leírás"
|
||||||
|
|
||||||
}
|
}
|
@ -39,5 +39,25 @@
|
|||||||
</array>
|
</array>
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
<false/>
|
<false/>
|
||||||
|
<key>CFBundleURLTypes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>fb584181112271127</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>FacebookAppID</key>
|
||||||
|
<string>584181112271127</string>
|
||||||
|
<key>FacebookDisplayName</key>
|
||||||
|
<string>Mobile Login</string>
|
||||||
|
<key>LSApplicationQueriesSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>fbapi</string>
|
||||||
|
<string>fb-messenger-share-api</string>
|
||||||
|
<string>fbauth2</string>
|
||||||
|
<string>fbshareextension</string>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
@ -19,14 +19,15 @@ class CustomExerciseFormBloc extends FormBloc<String, String> {
|
|||||||
|
|
||||||
//1RM calculated Fields
|
//1RM calculated Fields
|
||||||
final rmWendlerField = TextFieldBloc( initialValue: "0",);
|
final rmWendlerField = TextFieldBloc( initialValue: "0",);
|
||||||
final rmMcGothlinField = TextFieldBloc( initialValue: "0");
|
|
||||||
final rmLombardiField = TextFieldBloc( initialValue: "0");
|
|
||||||
final rmMayhewField = TextFieldBloc( initialValue: "0");
|
final rmMayhewField = TextFieldBloc( initialValue: "0");
|
||||||
final rmOconnerField = TextFieldBloc( initialValue: "0");
|
final rmOconnerField = TextFieldBloc( initialValue: "0");
|
||||||
final rmWathenField = TextFieldBloc( initialValue: "0");
|
final rmWathenField = TextFieldBloc( initialValue: "0");
|
||||||
final rmAverageField = TextFieldBloc( initialValue: "0");
|
final rmAverageField = TextFieldBloc( initialValue: "0");
|
||||||
final rm90Field = TextFieldBloc( initialValue: "0");
|
final rm90Field = TextFieldBloc( initialValue: "0");
|
||||||
final rm80Field = TextFieldBloc( initialValue: "0");
|
final rm80Field = TextFieldBloc( initialValue: "0");
|
||||||
|
final rm75Field = TextFieldBloc( initialValue: "0");
|
||||||
|
final rm75WendlerField = TextFieldBloc( initialValue: "0");
|
||||||
|
final rm75OconnorField = TextFieldBloc( initialValue: "0");
|
||||||
final rm70Field = TextFieldBloc( initialValue: "0");
|
final rm70Field = TextFieldBloc( initialValue: "0");
|
||||||
final rm60Field = TextFieldBloc( initialValue: "0");
|
final rm60Field = TextFieldBloc( initialValue: "0");
|
||||||
final rm50Field = TextFieldBloc( initialValue: "0");
|
final rm50Field = TextFieldBloc( initialValue: "0");
|
||||||
@ -36,8 +37,6 @@ class CustomExerciseFormBloc extends FormBloc<String, String> {
|
|||||||
quantityField,
|
quantityField,
|
||||||
unitQuantityField,
|
unitQuantityField,
|
||||||
rmWendlerField,
|
rmWendlerField,
|
||||||
rmMcGothlinField,
|
|
||||||
rmLombardiField,
|
|
||||||
rmMayhewField,
|
rmMayhewField,
|
||||||
rmOconnerField,
|
rmOconnerField,
|
||||||
rmWathenField,
|
rmWathenField,
|
||||||
@ -45,6 +44,9 @@ class CustomExerciseFormBloc extends FormBloc<String, String> {
|
|||||||
rm90Field,
|
rm90Field,
|
||||||
rm80Field,
|
rm80Field,
|
||||||
rm70Field,
|
rm70Field,
|
||||||
|
rm75Field,
|
||||||
|
rm75WendlerField,
|
||||||
|
rm75OconnorField,
|
||||||
rm60Field,
|
rm60Field,
|
||||||
rm50Field
|
rm50Field
|
||||||
]);
|
]);
|
||||||
@ -81,28 +83,27 @@ class CustomExerciseFormBloc extends FormBloc<String, String> {
|
|||||||
}
|
}
|
||||||
print("Calculating 1RM");
|
print("Calculating 1RM");
|
||||||
exerciseRepository.rmWendler = weight * repeat * 0.0333 + weight;
|
exerciseRepository.rmWendler = weight * repeat * 0.0333 + weight;
|
||||||
rmWendlerField.updateValue(exerciseRepository.rmWendler.toString());
|
rmWendlerField.updateValue(exerciseRepository.rmWendler.toStringAsFixed(1));
|
||||||
exerciseRepository.rmMcglothlin = 100 * weight / (101.3 - 2.67123 * repeat);
|
|
||||||
rmMcGothlinField.updateValue(exerciseRepository.rmMcglothlin.toString());
|
|
||||||
exerciseRepository.rmLombardi = pow(weight * repeat, 0.1);
|
|
||||||
rmLombardiField.updateValue(exerciseRepository.rmLombardi.toString());
|
|
||||||
exerciseRepository.rmOconner = weight * (1 + repeat / 40);
|
exerciseRepository.rmOconner = weight * (1 + repeat / 40);
|
||||||
rmOconnerField.updateValue(exerciseRepository.rmOconner.toString());
|
rmOconnerField.updateValue(exerciseRepository.rmOconner.toStringAsFixed(1));
|
||||||
exerciseRepository.rmMayhew =
|
exerciseRepository.rmMayhew =
|
||||||
100 * weight / (52.2 + 41.9 * pow(e, -0.055 * repeat));
|
100 * weight / (52.2 + 41.9 * pow(e, -0.055 * repeat));
|
||||||
rmMayhewField.updateValue(exerciseRepository.rmMayhew.toString());
|
rmMayhewField.updateValue(exerciseRepository.rmMayhew.toStringAsFixed(1));
|
||||||
exerciseRepository.rmWathen =
|
exerciseRepository.rmWathen =
|
||||||
100 * weight / (48.8 + 53.8 * pow(e, -0.075 * repeat));
|
100 * weight / (48.8 + 53.8 * pow(e, -0.075 * repeat));
|
||||||
rmWathenField.updateValue(exerciseRepository.rmWathen.toString());
|
rmWathenField.updateValue(exerciseRepository.rmWathen.toStringAsFixed(1));
|
||||||
double average = (exerciseRepository.rmWendler + exerciseRepository.rmWathen +
|
double average = (exerciseRepository.rmWendler + exerciseRepository.rmWathen +
|
||||||
exerciseRepository.rmMayhew + exerciseRepository.rmOconner +
|
exerciseRepository.rmMayhew + exerciseRepository.rmOconner +
|
||||||
exerciseRepository.rmMcglothlin)/5;
|
exerciseRepository.rmMcglothlin)/4;
|
||||||
rmAverageField.updateValue(average.toString());
|
rmAverageField.updateValue(average.toStringAsFixed(1));
|
||||||
rm90Field.updateValue((average*0.9).toString());
|
rm90Field.updateValue((average*0.9).toStringAsFixed(1));
|
||||||
rm80Field.updateValue((average*0.8).toString());
|
rm80Field.updateValue((average*0.8).toStringAsFixed(1));
|
||||||
rm70Field.updateValue((average*0.7).toString());
|
rm75Field.updateValue((average*0.75).toStringAsFixed(1));
|
||||||
rm60Field.updateValue((average*0.6).toString());
|
rm75OconnorField.updateValue((exerciseRepository.rmOconner*0.75).toStringAsFixed(1));
|
||||||
rm50Field.updateValue((average*0.5).toString());
|
rm75WendlerField.updateValue((exerciseRepository.rmWendler*0.75).toStringAsFixed(1));
|
||||||
|
rm70Field.updateValue((average*0.7).toStringAsFixed(1));
|
||||||
|
rm60Field.updateValue((average*0.6).toStringAsFixed(1));
|
||||||
|
rm50Field.updateValue((average*0.5).toStringAsFixed(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
//@override
|
//@override
|
||||||
@ -111,14 +112,15 @@ class CustomExerciseFormBloc extends FormBloc<String, String> {
|
|||||||
unitQuantityField.close();
|
unitQuantityField.close();
|
||||||
|
|
||||||
rmWendlerField.close();
|
rmWendlerField.close();
|
||||||
rmMcGothlinField.close();
|
|
||||||
rmLombardiField.close();
|
|
||||||
rmMayhewField.close();
|
rmMayhewField.close();
|
||||||
rmOconnerField.close();
|
rmOconnerField.close();
|
||||||
rmWathenField.close();
|
rmWathenField.close();
|
||||||
rmAverageField.close();
|
rmAverageField.close();
|
||||||
rm90Field.close();
|
rm90Field.close();
|
||||||
rm80Field.close();
|
rm80Field.close();
|
||||||
|
rm75WendlerField.close();
|
||||||
|
rm75OconnorField.close();
|
||||||
|
rm75Field.close();
|
||||||
rm70Field.close();
|
rm70Field.close();
|
||||||
rm60Field.close();
|
rm60Field.close();
|
||||||
rm50Field.close();
|
rm50Field.close();
|
||||||
|
@ -26,6 +26,10 @@ class MenuBloc extends Bloc<MenuEvent, MenuState> {
|
|||||||
yield MenuLoading();
|
yield MenuLoading();
|
||||||
await menuTreeRepository.createTree();
|
await menuTreeRepository.createTree();
|
||||||
yield MenuReady();
|
yield MenuReady();
|
||||||
|
} else if (event is MenuRecreateTree) {
|
||||||
|
// ie. at language changes
|
||||||
|
await menuTreeRepository.createTree();
|
||||||
|
yield MenuReady();
|
||||||
} else if (event is MenuTreeDown) {
|
} else if (event is MenuTreeDown) {
|
||||||
// get child menus or exercises
|
// get child menus or exercises
|
||||||
yield MenuLoading();
|
yield MenuLoading();
|
||||||
|
@ -39,3 +39,7 @@ class MenuClickExercise extends MenuEvent {
|
|||||||
List<Object> get props => [exerciseTypeId];
|
List<Object> get props => [exerciseTypeId];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class MenuRecreateTree extends MenuEvent {
|
||||||
|
const MenuRecreateTree();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -17,6 +17,14 @@ class SettingsBloc extends Bloc<SettingsEvent, SettingsState> {
|
|||||||
|
|
||||||
SettingsBloc({this.context}) : super(SettingsInitial());
|
SettingsBloc({this.context}) : super(SettingsInitial());
|
||||||
|
|
||||||
|
void setLocale(Locale locale) {
|
||||||
|
_locale = locale;
|
||||||
|
}
|
||||||
|
|
||||||
|
Locale getLocale() {
|
||||||
|
return _locale;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Stream<SettingsState> mapEventToState(
|
Stream<SettingsState> mapEventToState(
|
||||||
SettingsEvent event,
|
SettingsEvent event,
|
||||||
|
@ -18,7 +18,7 @@ class AppLanguage extends ChangeNotifier {
|
|||||||
|
|
||||||
Locale get appLocal => _appLocale ?? Locale("en");
|
Locale get appLocal => _appLocale ?? Locale("en");
|
||||||
|
|
||||||
fetchLocale() async {
|
Future<void> fetchLocale() async {
|
||||||
var prefs = await SharedPreferences.getInstance();
|
var prefs = await SharedPreferences.getInstance();
|
||||||
if (prefs.getString('language_code') == null) {
|
if (prefs.getString('language_code') == null) {
|
||||||
_appLocale = Locale('en');
|
_appLocale = Locale('en');
|
||||||
|
@ -10,6 +10,7 @@ import 'package:aitrainer_app/view/customer_fitness_page.dart';
|
|||||||
import 'package:aitrainer_app/view/customer_goal_page.dart';
|
import 'package:aitrainer_app/view/customer_goal_page.dart';
|
||||||
import 'package:aitrainer_app/view/customer_modify_page.dart';
|
import 'package:aitrainer_app/view/customer_modify_page.dart';
|
||||||
import 'package:aitrainer_app/view/customer_welcome_page.dart';
|
import 'package:aitrainer_app/view/customer_welcome_page.dart';
|
||||||
|
import 'package:aitrainer_app/view/exercise_type_description.dart';
|
||||||
import 'package:aitrainer_app/view/gdpr.dart';
|
import 'package:aitrainer_app/view/gdpr.dart';
|
||||||
import 'package:aitrainer_app/view/login.dart';
|
import 'package:aitrainer_app/view/login.dart';
|
||||||
import 'package:aitrainer_app/view/exercise_new_page.dart';
|
import 'package:aitrainer_app/view/exercise_new_page.dart';
|
||||||
@ -168,6 +169,7 @@ class AitrainerApp extends StatelessWidget {
|
|||||||
'menu_page': (context) => MenuPage(),
|
'menu_page': (context) => MenuPage(),
|
||||||
'account': (context) => AccountPage(),
|
'account': (context) => AccountPage(),
|
||||||
'settings': (context) => SettingsPage(),
|
'settings': (context) => SettingsPage(),
|
||||||
|
'exerciseTypeDescription': (context) => ExerciseTypeDescription(),
|
||||||
},
|
},
|
||||||
initialRoute: 'home',
|
initialRoute: 'home',
|
||||||
title: 'Aitrainer',
|
title: 'Aitrainer',
|
||||||
|
@ -10,6 +10,7 @@ class ExerciseType {
|
|||||||
String unitQuantity;
|
String unitQuantity;
|
||||||
String unitQuantityUnit;
|
String unitQuantityUnit;
|
||||||
bool active;
|
bool active;
|
||||||
|
bool base;
|
||||||
String imageUrl;
|
String imageUrl;
|
||||||
String nameTranslation;
|
String nameTranslation;
|
||||||
String descriptionTranslation;
|
String descriptionTranslation;
|
||||||
@ -25,6 +26,7 @@ class ExerciseType {
|
|||||||
this.unitQuantity = json['unitQuantity'];
|
this.unitQuantity = json['unitQuantity'];
|
||||||
this.unitQuantityUnit = json['unitQuantityUnit'];
|
this.unitQuantityUnit = json['unitQuantityUnit'];
|
||||||
this.active = json['active'];
|
this.active = json['active'];
|
||||||
|
this.base = json['base'];
|
||||||
this.imageUrl = json['images'][0]['url'];
|
this.imageUrl = json['images'][0]['url'];
|
||||||
this.nameTranslation = json['translations'][0]['name'];
|
this.nameTranslation = json['translations'][0]['name'];
|
||||||
this.descriptionTranslation = json['translations'][0]['description'];
|
this.descriptionTranslation = json['translations'][0]['description'];
|
||||||
|
@ -12,7 +12,8 @@ class WorkoutTree {
|
|||||||
bool child;
|
bool child;
|
||||||
int exerciseTypeId;
|
int exerciseTypeId;
|
||||||
ExerciseType exerciseType;
|
ExerciseType exerciseType;
|
||||||
|
bool base;
|
||||||
|
|
||||||
WorkoutTree(this.id, this.parent, this.name, this.imageName, this.color, this.fontSize, this.child, this.exerciseTypeId, this.exerciseType);
|
WorkoutTree(this.id, this.parent, this.name, this.imageName, this.color, this.fontSize, this.child, this.exerciseTypeId, this.exerciseType, this.base);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,8 @@ class MenuTreeRepository {
|
|||||||
32,
|
32,
|
||||||
false,
|
false,
|
||||||
0,
|
0,
|
||||||
null
|
null,
|
||||||
|
false
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -54,7 +55,8 @@ class MenuTreeRepository {
|
|||||||
16,
|
16,
|
||||||
true,
|
true,
|
||||||
exerciseType.exerciseTypeId,
|
exerciseType.exerciseTypeId,
|
||||||
exerciseType
|
exerciseType,
|
||||||
|
exerciseType.base
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -191,10 +191,10 @@ class _CustomExerciseNewPageState extends State<CustomExercisePage> {
|
|||||||
SliverGrid gridCalculation(CustomExerciseFormBloc bloc) {
|
SliverGrid gridCalculation(CustomExerciseFormBloc bloc) {
|
||||||
return SliverGrid(
|
return SliverGrid(
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
crossAxisCount: 2,
|
crossAxisCount: 3,
|
||||||
mainAxisSpacing: 10.0,
|
mainAxisSpacing: 10.0,
|
||||||
crossAxisSpacing: 10.0,
|
crossAxisSpacing: 10.0,
|
||||||
childAspectRatio: 4.0,
|
childAspectRatio: 2.0,
|
||||||
),
|
),
|
||||||
delegate: SliverChildListDelegate(
|
delegate: SliverChildListDelegate(
|
||||||
[
|
[
|
||||||
@ -209,29 +209,6 @@ class _CustomExerciseNewPageState extends State<CustomExercisePage> {
|
|||||||
filled: false,
|
filled: false,
|
||||||
labelText: "1RM by Wendler: ",
|
labelText: "1RM by Wendler: ",
|
||||||
)),
|
)),
|
||||||
TextFieldBlocBuilder(
|
|
||||||
readOnly: true,
|
|
||||||
padding: EdgeInsets.only(left:30),
|
|
||||||
textFieldBloc: bloc.rmMcGothlinField,
|
|
||||||
style: TextStyle(color: Colors.deepOrange, fontSize: 12),
|
|
||||||
decoration: InputDecoration(
|
|
||||||
border: InputBorder.none,
|
|
||||||
fillColor: Colors.white,
|
|
||||||
filled: false,
|
|
||||||
labelText: "1RM by McGlothin: ",
|
|
||||||
)),
|
|
||||||
TextFieldBlocBuilder(
|
|
||||||
readOnly: true,
|
|
||||||
padding: EdgeInsets.only(left:30),
|
|
||||||
maxLines: 1,
|
|
||||||
textFieldBloc: bloc.rmLombardiField,
|
|
||||||
style: TextStyle(color: Colors.deepOrange, fontSize: 12),
|
|
||||||
decoration: InputDecoration(
|
|
||||||
border: InputBorder.none,
|
|
||||||
fillColor: Colors.white,
|
|
||||||
filled: false,
|
|
||||||
labelText: "1RM by Lambordini: ",
|
|
||||||
)),
|
|
||||||
TextFieldBlocBuilder(
|
TextFieldBlocBuilder(
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
padding: EdgeInsets.only(left:30),
|
padding: EdgeInsets.only(left:30),
|
||||||
@ -292,6 +269,43 @@ class _CustomExerciseNewPageState extends State<CustomExercisePage> {
|
|||||||
filled: false,
|
filled: false,
|
||||||
labelText: "1RM 90%: ",
|
labelText: "1RM 90%: ",
|
||||||
)),
|
)),
|
||||||
|
|
||||||
|
TextFieldBlocBuilder(
|
||||||
|
readOnly: true,
|
||||||
|
padding: EdgeInsets.only(left:30),
|
||||||
|
maxLines: 1,
|
||||||
|
textFieldBloc: bloc.rm75Field,
|
||||||
|
style: TextStyle(color: Colors.deepOrange, fontSize: 12, fontWeight: FontWeight.bold),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
border: InputBorder.none,
|
||||||
|
fillColor: Colors.white,
|
||||||
|
filled: false,
|
||||||
|
labelText: "1RM 75%: ",
|
||||||
|
)),
|
||||||
|
TextFieldBlocBuilder(
|
||||||
|
readOnly: true,
|
||||||
|
padding: EdgeInsets.only(left:30),
|
||||||
|
maxLines: 1,
|
||||||
|
textFieldBloc: bloc.rm75OconnorField,
|
||||||
|
style: TextStyle(color: Colors.deepOrange, fontSize: 12, fontWeight: FontWeight.bold),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
border: InputBorder.none,
|
||||||
|
fillColor: Colors.white,
|
||||||
|
filled: false,
|
||||||
|
labelText: "1RM 75%: by O'Connor",
|
||||||
|
)),
|
||||||
|
TextFieldBlocBuilder(
|
||||||
|
readOnly: true,
|
||||||
|
padding: EdgeInsets.only(left:30),
|
||||||
|
maxLines: 1,
|
||||||
|
textFieldBloc: bloc.rm75WendlerField,
|
||||||
|
style: TextStyle(color: Colors.deepOrange, fontSize: 12, fontWeight: FontWeight.bold),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
border: InputBorder.none,
|
||||||
|
fillColor: Colors.white,
|
||||||
|
filled: false,
|
||||||
|
labelText: "1RM 75% by Wendler: ",
|
||||||
|
)),
|
||||||
TextFieldBlocBuilder(
|
TextFieldBlocBuilder(
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
padding: EdgeInsets.only(left:30),
|
padding: EdgeInsets.only(left:30),
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:aitrainer_app/bloc/exercise_form_bloc.dart';
|
import 'package:aitrainer_app/bloc/exercise_form_bloc.dart';
|
||||||
|
import 'package:aitrainer_app/localization/app_language.dart';
|
||||||
import 'package:aitrainer_app/localization/app_localization.dart';
|
import 'package:aitrainer_app/localization/app_localization.dart';
|
||||||
import 'package:aitrainer_app/model/auth.dart';
|
import 'package:aitrainer_app/model/auth.dart';
|
||||||
import 'package:aitrainer_app/model/exercise_type.dart';
|
import 'package:aitrainer_app/model/exercise_type.dart';
|
||||||
@ -26,7 +27,9 @@ class _ExerciseNewPageState extends State<ExerciseNewPage> {
|
|||||||
final exerciseBloc = BlocProvider.of<ExerciseFormBloc>(context);
|
final exerciseBloc = BlocProvider.of<ExerciseFormBloc>(context);
|
||||||
|
|
||||||
exerciseBloc.exerciseRepository.setExerciseType(exerciseType);
|
exerciseBloc.exerciseRepository.setExerciseType(exerciseType);
|
||||||
String exerciseName = exerciseBloc.exerciseRepository.exerciseType.name;
|
String exerciseName = AppLanguage().appLocal == Locale("en") ?
|
||||||
|
exerciseBloc.exerciseRepository.exerciseType.name :
|
||||||
|
exerciseBloc.exerciseRepository.exerciseType.nameTranslation;
|
||||||
|
|
||||||
return Form(
|
return Form(
|
||||||
autovalidate: true,
|
autovalidate: true,
|
||||||
@ -68,13 +71,34 @@ class _ExerciseNewPageState extends State<ExerciseNewPage> {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Divider(color: Colors.transparent,),
|
Divider(color: Colors.transparent,),
|
||||||
Divider(color: Colors.transparent,),
|
Divider(color: Colors.transparent,),
|
||||||
Divider(color: Colors.transparent,),
|
Text(AppLocalizations.of(context).translate('Save Exercise'),
|
||||||
|
style: TextStyle(fontSize: 14, color: Colors.blueAccent)),
|
||||||
|
Text(exerciseName,
|
||||||
|
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.deepOrange),
|
||||||
|
overflow: TextOverflow.fade,
|
||||||
|
maxLines: 1,
|
||||||
|
softWrap: true,
|
||||||
|
),
|
||||||
|
|
||||||
|
|
||||||
Text(AppLocalizations.of(context).translate(exerciseName) + " " +
|
|
||||||
AppLocalizations.of(context).translate('Save Exercise'),
|
|
||||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.deepOrange)),
|
|
||||||
Divider(color: Colors.transparent,),
|
|
||||||
Divider(color: Colors.transparent,),
|
Divider(color: Colors.transparent,),
|
||||||
|
FlatButton(
|
||||||
|
child: Row(
|
||||||
|
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Icon(Icons.description),
|
||||||
|
Text(AppLocalizations.of(context).translate("Description"),
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.blueAccent, fontWeight: FontWeight.normal, fontSize: 14 )),
|
||||||
|
Icon(Icons.arrow_forward_ios),
|
||||||
|
]),
|
||||||
|
textColor: Colors.blueAccent,
|
||||||
|
color: Colors.transparent,
|
||||||
|
onPressed: () => {
|
||||||
|
Navigator.of(context).pushNamed('exerciseTypeDescription', arguments: exerciseBloc.exerciseRepository),
|
||||||
|
},
|
||||||
|
),
|
||||||
Divider(color: Colors.transparent,),
|
Divider(color: Colors.transparent,),
|
||||||
columnQuantityUnit(exerciseBloc),
|
columnQuantityUnit(exerciseBloc),
|
||||||
Divider(color: Colors.transparent,),
|
Divider(color: Colors.transparent,),
|
||||||
@ -138,36 +162,6 @@ class _ExerciseNewPageState extends State<ExerciseNewPage> {
|
|||||||
bloc.exerciseRepository.exerciseType.unitQuantityUnit),
|
bloc.exerciseRepository.exerciseType.unitQuantityUnit),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
/*TextFormField(
|
|
||||||
decoration: InputDecoration(
|
|
||||||
fillColor: Colors.white,
|
|
||||||
filled: false,
|
|
||||||
hintStyle: TextStyle(fontSize: 16, color: Colors.black54, fontWeight: FontWeight.w100),
|
|
||||||
hintText: AppLocalizations.of(context).translate("The number of the exercise done with"),
|
|
||||||
labelStyle: TextStyle(fontSize: 16, color: Colors.lightBlue),
|
|
||||||
labelText: AppLocalizations.of(context).translate(
|
|
||||||
bloc.exerciseRepository.exerciseType.unitQuantityUnit),
|
|
||||||
),
|
|
||||||
autovalidate: true,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
initialValue: "",
|
|
||||||
style: TextStyle(fontSize: 30,
|
|
||||||
color: Colors.lightBlue,
|
|
||||||
fontWeight: FontWeight.bold),
|
|
||||||
validator: (input) {
|
|
||||||
return validateNumberInput(input);
|
|
||||||
},
|
|
||||||
inputFormatters: [
|
|
||||||
FilteringTextInputFormatter(RegExp(r"[\d.]"))
|
|
||||||
//WhitelistingTextInputFormatter(RegExp(r"[\d.]"))
|
|
||||||
],
|
|
||||||
onChanged: (input) => {
|
|
||||||
print ("UnitQuantity value $input"),
|
|
||||||
bloc.exerciseRepository.setUnitQuantity(
|
|
||||||
double.parse(input))
|
|
||||||
},
|
|
||||||
|
|
||||||
), */
|
|
||||||
new InkWell(
|
new InkWell(
|
||||||
child: new Text(AppLocalizations.of(context).translate(
|
child: new Text(AppLocalizations.of(context).translate(
|
||||||
bloc.exerciseRepository.exerciseType.unitQuantityUnit),
|
bloc.exerciseRepository.exerciseType.unitQuantityUnit),
|
||||||
@ -207,36 +201,6 @@ class _ExerciseNewPageState extends State<ExerciseNewPage> {
|
|||||||
bloc.exerciseRepository.exerciseType.unit),
|
bloc.exerciseRepository.exerciseType.unit),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
/* TextFormField(
|
|
||||||
decoration: InputDecoration(
|
|
||||||
fillColor: Colors.white,
|
|
||||||
filled: false,
|
|
||||||
hintText: AppLocalizations.of(context).translate("The number of the exercise"),
|
|
||||||
hintStyle: TextStyle(fontSize: 16, color: Colors.black54, fontWeight: FontWeight.w100),
|
|
||||||
labelStyle: TextStyle(fontSize: 16, color: Colors.deepOrange),
|
|
||||||
labelText: AppLocalizations.of(context).translate(
|
|
||||||
bloc.exerciseRepository.exerciseType.unit),
|
|
||||||
),
|
|
||||||
autovalidate: true,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
initialValue: "",
|
|
||||||
style: TextStyle(fontSize: 50,
|
|
||||||
color: Colors.deepOrange,
|
|
||||||
fontWeight: FontWeight.bold),
|
|
||||||
validator: (input) {
|
|
||||||
return validateNumberInput(input);
|
|
||||||
},
|
|
||||||
inputFormatters: [
|
|
||||||
WhitelistingTextInputFormatter(RegExp(r"[\d.]"))
|
|
||||||
],
|
|
||||||
onChanged: (input) =>
|
|
||||||
{
|
|
||||||
print ("Quantity value $input"),
|
|
||||||
bloc.exerciseRepository.setQuantity(double.parse(input)),
|
|
||||||
bloc.exerciseRepository.setUnit(bloc.exerciseRepository.exerciseType.unit)
|
|
||||||
|
|
||||||
}
|
|
||||||
),*/
|
|
||||||
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
67
lib/view/exercise_type_description.dart
Normal file
67
lib/view/exercise_type_description.dart
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
import 'package:aitrainer_app/localization/app_language.dart';
|
||||||
|
import 'package:aitrainer_app/repository/exercise_repository.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ExerciseTypeDescription extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final ExerciseRepository exerciseRepository =
|
||||||
|
ModalRoute.of(context).settings.arguments;
|
||||||
|
String exerciseDescription = AppLanguage().appLocal == Locale("en")
|
||||||
|
? exerciseRepository.exerciseType.description
|
||||||
|
: exerciseRepository.exerciseType.descriptionTranslation;
|
||||||
|
|
||||||
|
|
||||||
|
String exerciseName = AppLanguage().appLocal == Locale("en") ?
|
||||||
|
exerciseRepository.exerciseType.name :
|
||||||
|
exerciseRepository.exerciseType.nameTranslation;
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
title: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: <Widget>[
|
||||||
|
Image.asset(
|
||||||
|
'asset/image/WT_long_logo.png',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
height: 65.0,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
leading: IconButton(
|
||||||
|
icon: Icon(Icons.arrow_back, color: Colors.white),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: Container(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
height: MediaQuery.of(context).size.height,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage('asset/image/WT_light_background.png'),
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.only(left: 20, top: 20, right: 15),
|
||||||
|
child: ListView(
|
||||||
|
|
||||||
|
children: [
|
||||||
|
Text(exerciseName,
|
||||||
|
style: TextStyle(color: Colors.blueGrey,
|
||||||
|
fontSize: 20, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
Divider(color: Colors.transparent,),
|
||||||
|
InkWell(
|
||||||
|
child: Text(exerciseDescription,
|
||||||
|
style: TextStyle(color: Colors.blueGrey,
|
||||||
|
fontSize: 18, fontWeight: FontWeight.normal),),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,7 @@ import 'package:aitrainer_app/widgets/splash.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
//import 'package:flutter_facebook_login/flutter_facebook_login.dart';
|
import 'package:flutter_facebook_login/flutter_facebook_login.dart';
|
||||||
import 'package:flutter_form_bloc/flutter_form_bloc.dart';
|
import 'package:flutter_form_bloc/flutter_form_bloc.dart';
|
||||||
|
|
||||||
import '../library_keys.dart';
|
import '../library_keys.dart';
|
||||||
@ -87,7 +87,7 @@ class _LoginWidget extends State<LoginWidget> {
|
|||||||
width: cWidth * .85,
|
width: cWidth * .85,
|
||||||
),
|
),
|
||||||
onPressed: () => {
|
onPressed: () => {
|
||||||
//_fbLogin(),
|
_fbLogin(),
|
||||||
print("Login with FB"),
|
print("Login with FB"),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -172,7 +172,7 @@ class _LoginWidget extends State<LoginWidget> {
|
|||||||
content: Text(error, style: TextStyle(color: Colors.white))));
|
content: Text(error, style: TextStyle(color: Colors.white))));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Future<Null> _fbLogin() async {
|
Future<Null> _fbLogin() async {
|
||||||
final FacebookLogin facebookSignIn = new FacebookLogin();
|
final FacebookLogin facebookSignIn = new FacebookLogin();
|
||||||
final FacebookLoginResult result = await facebookSignIn.logIn(['email']);
|
final FacebookLoginResult result = await facebookSignIn.logIn(['email']);
|
||||||
|
|
||||||
@ -197,5 +197,5 @@ class _LoginWidget extends State<LoginWidget> {
|
|||||||
'Here\'s the error Facebook gave us: ${result.errorMessage}');
|
'Here\'s the error Facebook gave us: ${result.errorMessage}');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} */
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
|
import 'package:aitrainer_app/bloc/menu/menu_bloc.dart';
|
||||||
import 'package:aitrainer_app/bloc/settings/settings_bloc.dart';
|
import 'package:aitrainer_app/bloc/settings/settings_bloc.dart';
|
||||||
import 'package:aitrainer_app/localization/app_language.dart';
|
import 'package:aitrainer_app/localization/app_language.dart';
|
||||||
import 'package:aitrainer_app/localization/app_localization.dart';
|
import 'package:aitrainer_app/localization/app_localization.dart';
|
||||||
|
import 'package:aitrainer_app/model/auth.dart';
|
||||||
import 'package:aitrainer_app/widgets/bottom_nav.dart';
|
import 'package:aitrainer_app/widgets/bottom_nav.dart';
|
||||||
import 'package:aitrainer_app/widgets/splash.dart';
|
import 'package:aitrainer_app/widgets/splash.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@ -15,7 +17,10 @@ class SettingsPage extends StatelessWidget{
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// ignore: close_sinks
|
// ignore: close_sinks
|
||||||
SettingsBloc settingsBloc = BlocProvider.of<SettingsBloc>(context);
|
SettingsBloc settingsBloc = BlocProvider.of<SettingsBloc>(context);
|
||||||
|
settingsBloc.setLocale(AppLanguage().appLocal);
|
||||||
settingsBloc.context = context;
|
settingsBloc.context = context;
|
||||||
|
|
||||||
|
MenuBloc menuBloc = BlocProvider.of<MenuBloc>(context);
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Row(
|
title: Row(
|
||||||
@ -45,13 +50,31 @@ class SettingsPage extends StatelessWidget{
|
|||||||
listener: (context, state) {
|
listener: (context, state) {
|
||||||
if ( state is SettingsError ) {
|
if ( state is SettingsError ) {
|
||||||
|
|
||||||
|
} else if ( state is SettingsReady ) {
|
||||||
|
menuBloc.add(MenuRecreateTree());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// ignore: missing_return
|
// ignore: missing_return
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
if ( state is SettingsLoading ) {
|
if ( state is SettingsLoading ) {
|
||||||
return LoadingDialog();
|
return LoadingDialog();
|
||||||
} else if ( state is SettingsReady || state is SettingsInitial) {
|
} else if ( state is SettingsInitial) {
|
||||||
|
return settingsUI(context, settingsBloc, menuBloc);
|
||||||
|
} else if ( state is SettingsReady ) {
|
||||||
|
return settingsUI(context, settingsBloc, menuBloc);
|
||||||
|
} else {
|
||||||
|
return Container();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
bottomNavigationBar: BottomNavigator(bottomNavIndex: 3)
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
ListView settingsUI(BuildContext context, SettingsBloc settingsBloc, MenuBloc menuBloc) {
|
||||||
return ListView(
|
return ListView(
|
||||||
padding: EdgeInsets.only(top: 150),
|
padding: EdgeInsets.only(top: 150),
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -62,7 +85,7 @@ class SettingsPage extends StatelessWidget{
|
|||||||
"Change App Language")),
|
"Change App Language")),
|
||||||
title: DropdownButton(
|
title: DropdownButton(
|
||||||
|
|
||||||
value: state.props[0] == Locale('en')
|
value: settingsBloc.getLocale() == Locale('en')
|
||||||
? AppLocalizations.of(context).translate(
|
? AppLocalizations.of(context).translate(
|
||||||
"English")
|
"English")
|
||||||
: AppLocalizations.of(context).translate(
|
: AppLocalizations.of(context).translate(
|
||||||
@ -78,23 +101,15 @@ class SettingsPage extends StatelessWidget{
|
|||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
onChanged: (String lang) =>
|
onChanged: (String lang) =>
|
||||||
|
{
|
||||||
settingsBloc.add(
|
settingsBloc.add(
|
||||||
SettingsChangeLanguage(language: lang)
|
SettingsChangeLanguage(language: lang)
|
||||||
),
|
),
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
return Container();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
bottomNavigationBar: BottomNavigator(bottomNavIndex: 3)
|
|
||||||
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,93 +6,102 @@ import 'package:aitrainer_app/model/auth.dart';
|
|||||||
import 'package:aitrainer_app/model/workout_tree.dart';
|
import 'package:aitrainer_app/model/workout_tree.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/painting.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
// ignore: must_be_immutable
|
||||||
class MenuPageWidget extends StatelessWidget {
|
class MenuPageWidget extends StatelessWidget {
|
||||||
int parent;
|
int parent;
|
||||||
|
|
||||||
MenuPageWidget({this.parent});
|
MenuPageWidget({this.parent});
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
MenuBloc menuBloc = BlocProvider.of<MenuBloc>(context);
|
MenuBloc menuBloc = BlocProvider.of<MenuBloc>(context);
|
||||||
|
|
||||||
return CustomScrollView(
|
return CustomScrollView(
|
||||||
scrollDirection: Axis.vertical,
|
scrollDirection: Axis.vertical,
|
||||||
slivers: <Widget>[
|
slivers: <Widget>[buildMenuColumn(parent, context, menuBloc)]);
|
||||||
buildMenuColumn(parent, context, menuBloc)
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SliverList buildMenuColumn(int parent, BuildContext context, MenuBloc menuBloc) {
|
SliverList buildMenuColumn(
|
||||||
|
int parent, BuildContext context, MenuBloc menuBloc) {
|
||||||
final List<Widget> _columnChildren = List();
|
final List<Widget> _columnChildren = List();
|
||||||
|
|
||||||
menuBloc.menuTreeRepository.getBranch(menuBloc.parent).forEach((treeName, value) {
|
menuBloc.menuTreeRepository
|
||||||
|
.getBranch(menuBloc.parent)
|
||||||
|
.forEach((treeName, value) {
|
||||||
WorkoutTree workoutTree = value as WorkoutTree;
|
WorkoutTree workoutTree = value as WorkoutTree;
|
||||||
_columnChildren.add(
|
_columnChildren.add(Container(
|
||||||
Container(
|
|
||||||
padding: EdgeInsets.only(top: 16.0),
|
padding: EdgeInsets.only(top: 16.0),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
alignment: Alignment.bottomLeft,
|
alignment: Alignment.bottomLeft,
|
||||||
overflow: Overflow.visible,
|
clipBehavior: Clip.hardEdge,
|
||||||
|
fit: StackFit.loose,
|
||||||
children: [
|
children: [
|
||||||
FlatButton(
|
FlatButton(
|
||||||
child: _getButtonImage(workoutTree),
|
child: _getButtonImage(workoutTree),
|
||||||
padding: EdgeInsets.all(0.0),
|
padding: EdgeInsets.only(left: 0.0, bottom: 0),
|
||||||
onPressed:() =>
|
shape: getShape(workoutTree),
|
||||||
{
|
onPressed: () => menuClick(workoutTree, menuBloc, context),
|
||||||
print("Hi!, Menu clicked " + workoutTree.id.toString()),
|
),
|
||||||
if ( workoutTree.child == false ) {
|
InkWell(
|
||||||
menuBloc.add(MenuTreeDown(parent: workoutTree.id)),
|
onTap:() => menuClick(workoutTree, menuBloc, context),
|
||||||
|
child: Text(
|
||||||
|
" " + workoutTree.name,
|
||||||
|
maxLines: 2,
|
||||||
|
style: TextStyle(
|
||||||
|
color: workoutTree.color,
|
||||||
|
fontSize: workoutTree.fontSize,
|
||||||
|
fontFamily: 'Arial',
|
||||||
|
fontWeight: FontWeight.w900),
|
||||||
|
),
|
||||||
|
highlightColor: workoutTree.color,
|
||||||
|
),
|
||||||
|
|
||||||
|
]))));
|
||||||
|
});
|
||||||
|
|
||||||
|
SliverList sliverList =
|
||||||
|
SliverList(delegate: SliverChildListDelegate(_columnChildren));
|
||||||
|
|
||||||
|
return sliverList;
|
||||||
|
}
|
||||||
|
|
||||||
|
void menuClick(
|
||||||
|
WorkoutTree workoutTree, MenuBloc menuBloc, BuildContext context) {
|
||||||
|
print("Hi!, Menu clicked " + workoutTree.id.toString());
|
||||||
|
if (workoutTree.child == false) {
|
||||||
|
menuBloc.add(MenuTreeDown(parent: workoutTree.id));
|
||||||
} else {
|
} else {
|
||||||
menuBloc.add(MenuClickExercise(exerciseTypeId: workoutTree.id)),
|
menuBloc.add(MenuClickExercise(exerciseTypeId: workoutTree.id));
|
||||||
if (Auth().userLoggedIn == null) {
|
if (Auth().userLoggedIn == null) {
|
||||||
Scaffold.of(context).showSnackBar(
|
Scaffold.of(context).showSnackBar(SnackBar(
|
||||||
SnackBar(
|
|
||||||
backgroundColor: Colors.orange,
|
backgroundColor: Colors.orange,
|
||||||
content: Text(
|
content: Text(
|
||||||
AppLocalizations.of(context).translate('Please log in'),
|
AppLocalizations.of(context).translate('Please log in'),
|
||||||
style: TextStyle(color: Colors.white))
|
style: TextStyle(color: Colors.white))));
|
||||||
))
|
|
||||||
} else {
|
} else {
|
||||||
if (workoutTree.exerciseType.name == "Custom") {
|
if (workoutTree.exerciseType.name == "Custom") {
|
||||||
Navigator.of(context).pushNamed(
|
Navigator.of(context).pushNamed('exerciseCustomPage',
|
||||||
'exerciseCustomPage',
|
arguments: workoutTree.exerciseType);
|
||||||
arguments: workoutTree.exerciseType),
|
|
||||||
} else {
|
} else {
|
||||||
Navigator.of(context).pushNamed(
|
Navigator.of(context).pushNamed('exerciseNewPage',
|
||||||
'exerciseNewPage',
|
arguments: workoutTree.exerciseType);
|
||||||
arguments: workoutTree.exerciseType),
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
dynamic getShape(WorkoutTree workoutTree) {
|
||||||
),
|
bool base = workoutTree.base;
|
||||||
InkWell(
|
dynamic returnCode = (base == true)
|
||||||
child: Text(workoutTree.name, style: TextStyle(color: workoutTree.color, fontSize: workoutTree.fontSize, fontFamily: 'Arial', fontWeight: FontWeight.w900 ),),
|
? RoundedRectangleBorder(
|
||||||
highlightColor: workoutTree.color,
|
side: BorderSide(width: 4, color: Colors.orangeAccent),
|
||||||
)]
|
|
||||||
)
|
)
|
||||||
)
|
: null;
|
||||||
)
|
return returnCode;
|
||||||
);
|
|
||||||
});
|
|
||||||
//_columnChildren.add(Spacer(flex: 3));
|
|
||||||
SliverList sliverList =
|
|
||||||
SliverList(
|
|
||||||
delegate: SliverChildListDelegate(
|
|
||||||
_columnChildren
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
return sliverList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic _getButtonImage(WorkoutTree workoutTree) {
|
dynamic _getButtonImage(WorkoutTree workoutTree) {
|
||||||
@ -113,7 +122,8 @@ class MenuPageWidget extends StatelessWidget {
|
|||||||
workoutTree.imageName,
|
workoutTree.imageName,
|
||||||
height: 180,
|
height: 180,
|
||||||
errorBuilder: (context, error, stackTrace) {
|
errorBuilder: (context, error, stackTrace) {
|
||||||
String url = Auth.mediaUrl + 'images/' + workoutTree.imageName.substring(11);
|
String url =
|
||||||
|
Auth.mediaUrl + 'images/' + workoutTree.imageName.substring(11);
|
||||||
Widget image = FadeInImage.assetNetwork(
|
Widget image = FadeInImage.assetNetwork(
|
||||||
placeholder: 'asset/image/dots.gif',
|
placeholder: 'asset/image/dots.gif',
|
||||||
image: url,
|
image: url,
|
||||||
|
@ -172,6 +172,13 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_facebook_login:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_facebook_login
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.0"
|
||||||
flutter_form_bloc:
|
flutter_form_bloc:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -31,7 +31,7 @@ dependencies:
|
|||||||
sentry: ^3.0.1
|
sentry: ^3.0.1
|
||||||
# firebase_messaging: ^6.0.16
|
# firebase_messaging: ^6.0.16
|
||||||
flutter_local_notifications: 1.1.1
|
flutter_local_notifications: 1.1.1
|
||||||
#flutter_facebook_login: ^3.0.0
|
flutter_facebook_login: ^3.0.0
|
||||||
flutter_bloc: ^6.0.1
|
flutter_bloc: ^6.0.1
|
||||||
equatable: ^1.2.3
|
equatable: ^1.2.3
|
||||||
flutter_form_bloc: ^0.19.0
|
flutter_form_bloc: ^0.19.0
|
||||||
|
Loading…
Reference in New Issue
Block a user