From 4a193e085f4d850c767be4294e35d7bc0a887930 Mon Sep 17 00:00:00 2001 From: Bossanyi Tibor Date: Sat, 19 Sep 2020 08:09:43 +0200 Subject: [PATCH] wt1.1.1 translation fixes --- i18n/en.json | 17 +- i18n/hu.json | 17 +- .../exercise_by_plan_bloc.dart | 4 +- lib/bloc/exercise_control_form_bloc.dart | 3 + .../exercise_plan/exercise_plan_bloc.dart | 4 +- lib/bloc/menu/menu_bloc.dart | 4 +- lib/bloc/session/session_bloc.dart | 7 + lib/bloc/session/session_event.dart | 6 +- lib/bloc/settings/settings_bloc.dart | 21 +- lib/main.dart | 4 +- lib/repository/exercise_repository.dart | 6 +- ...tory.dart => workout_tree_repository.dart} | 10 +- lib/util/common.dart | 6 +- lib/util/session.dart | 9 +- lib/util/trans.dart | 13 + lib/view/account.dart | 11 +- lib/view/customer_modify_page.dart | 424 ++++++++---------- lib/view/exercise_add_by_plan_page.dart | 16 +- lib/view/exercise_control_page.dart | 417 ++++++++--------- lib/view/exercise_log_page.dart | 10 +- lib/view/exercise_plan_custom_page.dart | 2 - lib/view/exercise_plan_detail_add_page.dart | 21 +- lib/view/menu_page.dart | 9 +- lib/view/mydevelopment_page.dart | 14 +- lib/view/myexcercise_plan_page.dart | 18 +- lib/widgets/app_bar.dart | 11 +- lib/widgets/app_bar_common.dart | 6 +- lib/widgets/home.dart | 20 +- lib/widgets/menu_page_widget.dart | 4 +- pubspec.lock | 64 +-- pubspec.yaml | 6 +- 31 files changed, 585 insertions(+), 599 deletions(-) rename lib/repository/{menu_tree_repository.dart => workout_tree_repository.dart} (94%) create mode 100644 lib/util/trans.dart diff --git a/i18n/en.json b/i18n/en.json index c1300a9..dd7634a 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -66,6 +66,7 @@ "Do you save this exercise with these parameters?":"Do you save this exercise with these parameters?", "The number of the exercise": "The number of the exercise", "The number of the exercise done with": "The number of the exercise done with", + "Please repeat with ": "Please repeat with ", "repeat": "repeat", @@ -134,5 +135,19 @@ "5. Shoulders": "5. Shoulders", "6. Core": "6. Core", "7. Thigh": "7. Thigh", - "8. Calf": "8. Calf" + "8. Calf": "8. Calf", + + "Execute My Selected Training Plan": "Execute My Selected Training Plan", + "Edit My Custom Plan": "Edit My Custom Plan", + "Suggested Training Plan": "Suggested Training Plan", + "My Special Plan": "My Special Plan", + "My Arnold's Plan":"My Arnold's Plan", + "My Trainee's Plan": "My Trainee's Plan", + "Execute My Trainee's Training Plan": "Execute My Trainee's Training Plan", + + "My Exercise Logs": "My Exercise Logs", + "My Whole Body Development": "My Whole Body Development", + "Development Of Muscles": "Development Of Muscles", + "Predictions": "Predictions", + "My Trainee's Exercise Logs": "My Trainee's Exercise Logs" } \ No newline at end of file diff --git a/i18n/hu.json b/i18n/hu.json index 5489c48..fd1998c 100644 --- a/i18n/hu.json +++ b/i18n/hu.json @@ -55,6 +55,7 @@ "Delete": "Törlés", "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", + "Please repeat with ": "Kérlek ismételd", "Name": "Név", @@ -134,5 +135,19 @@ "5. Shoulders": "5. Váll", "6. Core": "6. Has", "7. Thigh": "7. Comb", - "8. Calf": "8. Vádli" + "8. Calf": "8. Vádli", + + "Execute My Selected Training Plan": "Edzésterv végrehajtása", + "Edit My Custom Plan": "Egyéni edzésterv", + "Suggested Training Plan": "Javasolt edzésterv", + "My Special Plan": "Speciális edzésterv", + "My Arnold's Plan": "Arnold edzésterve rám szabva", + "My Trainee's Plan" : "Kliensem edzésterve", + "Execute My Trainee's Training Plan": "Kliensem edzéstervének végrehajtása", + + "My Exercise Logs": "Edzésnaplóm", + "My Whole Body Development": "Testem fejlődése", + "Development Of Muscles": "Izomcsoportok fejlődése", + "Predictions": "Előrejelzések", + "My Trainee's Exercise Logs": "Kliensem edzésnaplőja" } \ No newline at end of file diff --git a/lib/bloc/exercise_by_plan/exercise_by_plan_bloc.dart b/lib/bloc/exercise_by_plan/exercise_by_plan_bloc.dart index c852831..339929e 100644 --- a/lib/bloc/exercise_by_plan/exercise_by_plan_bloc.dart +++ b/lib/bloc/exercise_by_plan/exercise_by_plan_bloc.dart @@ -3,7 +3,7 @@ import 'package:aitrainer_app/model/exercise_type.dart'; import 'package:aitrainer_app/model/workout_tree.dart'; import 'package:aitrainer_app/repository/exercise_plan_repository.dart'; import 'package:aitrainer_app/repository/exercise_repository.dart'; -import 'package:aitrainer_app/repository/menu_tree_repository.dart'; +import 'package:aitrainer_app/repository/workout_tree_repository.dart'; import 'package:bloc/bloc.dart'; import 'package:equatable/equatable.dart'; import 'package:meta/meta.dart'; @@ -14,7 +14,7 @@ part 'exercise_by_plan_state.dart'; class ExerciseByPlanBloc extends Bloc { final ExerciseRepository exerciseRepository; - final MenuTreeRepository menuTreeRepository; + final WorkoutTreeRepository menuTreeRepository; final ExercisePlanRepository exercisePlanRepository = ExercisePlanRepository(); int customerId; @override diff --git a/lib/bloc/exercise_control_form_bloc.dart b/lib/bloc/exercise_control_form_bloc.dart index 7ce6808..9b03e9c 100644 --- a/lib/bloc/exercise_control_form_bloc.dart +++ b/lib/bloc/exercise_control_form_bloc.dart @@ -7,6 +7,7 @@ class ExerciseControlFormBloc extends FormBloc { int step = 1; final double percentToCalculate; final bool readonly; + String times; final initialRMField = TextFieldBloc( ); @@ -63,6 +64,8 @@ class ExerciseControlFormBloc extends FormBloc { exerciseRepository.setUnitQuantity(unitQuantity3Field.valueToDouble); }); + times = percentToCalculate == 0.5 ? "30-35" : "12"; + } @override diff --git a/lib/bloc/exercise_plan/exercise_plan_bloc.dart b/lib/bloc/exercise_plan/exercise_plan_bloc.dart index 5c88210..a60f57d 100644 --- a/lib/bloc/exercise_plan/exercise_plan_bloc.dart +++ b/lib/bloc/exercise_plan/exercise_plan_bloc.dart @@ -4,7 +4,7 @@ import 'package:aitrainer_app/model/exercise_type.dart'; import 'package:aitrainer_app/model/workout_tree.dart'; import 'package:aitrainer_app/repository/exercise_plan_repository.dart'; import 'package:aitrainer_app/repository/exercise_repository.dart'; -import 'package:aitrainer_app/repository/menu_tree_repository.dart'; +import 'package:aitrainer_app/repository/workout_tree_repository.dart'; import 'package:bloc/bloc.dart'; import 'package:equatable/equatable.dart'; import 'package:meta/meta.dart'; @@ -14,7 +14,7 @@ part 'exercise_plan_event.dart'; part 'exercise_plan_state.dart'; class ExercisePlanBloc extends Bloc { - final MenuTreeRepository menuTreeRepository; + final WorkoutTreeRepository menuTreeRepository; final ExerciseRepository exerciseRepository; final ExercisePlanRepository exercisePlanRepository = ExercisePlanRepository(); int customerId; diff --git a/lib/bloc/menu/menu_bloc.dart b/lib/bloc/menu/menu_bloc.dart index 9ce2b42..fe2144a 100644 --- a/lib/bloc/menu/menu_bloc.dart +++ b/lib/bloc/menu/menu_bloc.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'package:aitrainer_app/model/workout_tree.dart'; -import 'package:aitrainer_app/repository/menu_tree_repository.dart'; +import 'package:aitrainer_app/repository/workout_tree_repository.dart'; import 'package:bloc/bloc.dart'; import 'package:equatable/equatable.dart'; import 'package:meta/meta.dart'; @@ -10,7 +10,7 @@ part 'menu_event.dart'; part 'menu_state.dart'; class MenuBloc extends Bloc { - final MenuTreeRepository menuTreeRepository; + final WorkoutTreeRepository menuTreeRepository; int parent; MenuBloc({this.menuTreeRepository}) : super(MenuInitial()) { diff --git a/lib/bloc/session/session_bloc.dart b/lib/bloc/session/session_bloc.dart index e7136d3..eec31d2 100644 --- a/lib/bloc/session/session_bloc.dart +++ b/lib/bloc/session/session_bloc.dart @@ -1,5 +1,7 @@ import 'dart:async'; +import 'package:aitrainer_app/bloc/settings/settings_bloc.dart'; +import 'package:aitrainer_app/localization/app_language.dart'; import 'package:aitrainer_app/util/session.dart'; import 'package:bloc/bloc.dart'; import 'package:equatable/equatable.dart'; @@ -19,7 +21,12 @@ class SessionBloc extends Bloc { try { if (event is SessionStart) { yield SessionLoading(); + // ignore: close_sinks + SettingsBloc settingsBloc = event.settingsBloc; await session.fetchSessionAndNavigate(); + String lang = AppLanguage().appLocal.languageCode; + print("Change lang to $lang"); + settingsBloc.add(SettingsChangeLanguage(language: lang)); yield SessionReady(); } } on Exception catch(ex) { diff --git a/lib/bloc/session/session_event.dart b/lib/bloc/session/session_event.dart index 04f34a2..1af5021 100644 --- a/lib/bloc/session/session_event.dart +++ b/lib/bloc/session/session_event.dart @@ -9,8 +9,10 @@ abstract class SessionEvent extends Equatable { } class SessionStart extends SessionEvent { - const SessionStart(); + final SettingsBloc settingsBloc; + const SessionStart({this.settingsBloc}); @override - List get props => []; + List get props => [settingsBloc]; } + diff --git a/lib/bloc/settings/settings_bloc.dart b/lib/bloc/settings/settings_bloc.dart index fb6db71..207a858 100644 --- a/lib/bloc/settings/settings_bloc.dart +++ b/lib/bloc/settings/settings_bloc.dart @@ -42,28 +42,35 @@ class SettingsBloc extends Bloc { } Future _changeLang( String lang ) async{ - + print("_change to $lang"); switch ( lang ) { case "English": + case "en": case "Angol": _locale = Locale('en'); break; case "Hungarian": case "Magyar": + case "hu": _locale = Locale('hu'); break; } this.language = lang; - final AppLanguage appLanguage = AppLanguage(); - appLanguage.changeLanguage(_locale); + AppLanguage().changeLanguage(_locale); await loadLang(); } Future loadLang() async{ - print (" -- Loading lang $_locale"); - if ( context != null ) { - AppLocalizations.of(context).setLocale(_locale); - await AppLocalizations.of(context).load(); + if ( _locale != null ) { + print(" -- Loading lang $_locale"); + if (context != null) { + AppLocalizations.of(context).setLocale(_locale); + await AppLocalizations.of(context).load(); + } else { + print("no context, does not load"); + } + } else { + print("no locale, does not load"); } } } diff --git a/lib/main.dart b/lib/main.dart index f82cbc5..63a7173 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'package:aitrainer_app/repository/customer_repository.dart'; import 'package:aitrainer_app/repository/exercise_repository.dart'; -import 'package:aitrainer_app/repository/menu_tree_repository.dart'; +import 'package:aitrainer_app/repository/workout_tree_repository.dart'; import 'package:aitrainer_app/util/session.dart'; import 'package:aitrainer_app/view/account.dart'; import 'package:aitrainer_app/view/custom_exercise_page.dart'; @@ -105,7 +105,7 @@ Future main() async { // - https://api.dartlang.org/stable/1.24.2/dart-async/Zone-class.html // - https://www.dartlang.org/articles/libraries/zones runZonedGuarded>(() async { - final MenuTreeRepository menuTreeRepository = MenuTreeRepository(); + final WorkoutTreeRepository menuTreeRepository = WorkoutTreeRepository(); runApp( MultiBlocProvider( providers: [ diff --git a/lib/repository/exercise_repository.dart b/lib/repository/exercise_repository.dart index 244d614..5cb4b7e 100644 --- a/lib/repository/exercise_repository.dart +++ b/lib/repository/exercise_repository.dart @@ -161,9 +161,9 @@ class ExerciseRepository { } }); - print ("checkedExerciseTypeid: " + checkedExerciseTypeId.toString()); - print ("baseTreeItem: " + baseTreeItem.toString()); - print ("count1RMExercises: " + count1RMExercises.toString()); + //print ("checkedExerciseTypeid: " + checkedExerciseTypeId.toString()); + //print ("baseTreeItem: " + baseTreeItem.toString()); + //print ("count1RMExercises: " + count1RMExercises.toString()); final double percent = count1RMExercises / baseTreeItem.length; Cache().setPercentExercises(percent); } diff --git a/lib/repository/menu_tree_repository.dart b/lib/repository/workout_tree_repository.dart similarity index 94% rename from lib/repository/menu_tree_repository.dart rename to lib/repository/workout_tree_repository.dart index 1e0d584..4aa5c41 100644 --- a/lib/repository/menu_tree_repository.dart +++ b/lib/repository/workout_tree_repository.dart @@ -28,7 +28,7 @@ class Antagonist { static int calfNr = 8; } -class MenuTreeRepository { +class WorkoutTreeRepository { final LinkedHashMap tree = LinkedHashMap(); SplayTreeMap sortedTree = SplayTreeMap>(); bool isEnglish; @@ -45,9 +45,9 @@ class MenuTreeRepository { }; Future createTree() async { - final AppLanguage appLanguage = AppLanguage(); - isEnglish = appLanguage.appLocal == Locale('en'); - print("** Start creating tree on lang: " + appLanguage.appLocal.toString()); + + isEnglish = AppLanguage().appLocal == Locale('en'); + print("** Start creating tree on lang: " + AppLanguage().appLocal.languageCode); List exerciseTree = Cache().getExerciseTree(); if ( exerciseTree == null || exerciseTree.length == 0) { @@ -115,7 +115,7 @@ class MenuTreeRepository { WorkoutTree treeItem = value as WorkoutTree; if ( treeItem.id == treeId ) { isTreeItem1RM = treeItem.is1RM; - print (treeItem.name + " 1RM " + treeItem.is1RM.toString() ); + //print (treeItem.name + " 1RM " + treeItem.is1RM.toString() ); } }); diff --git a/lib/util/common.dart b/lib/util/common.dart index b8adb23..6d3b664 100644 --- a/lib/util/common.dart +++ b/lib/util/common.dart @@ -38,12 +38,11 @@ mixin Common { } String getDateLocale( DateTime datetime, bool timeDisplay ) { - AppLanguage appLanguage = AppLanguage(); var date = datetime; - String dateName = DateFormat(DateFormat.YEAR_MONTH_DAY, appLanguage.appLocal.toString()).format(date.toUtc()); + String dateName = DateFormat(DateFormat.YEAR_MONTH_DAY, AppLanguage().appLocal.toString()).format(date.toUtc()); if ( timeDisplay ) { - dateName += " " +DateFormat(DateFormat.HOUR_MINUTE, appLanguage.appLocal.toString()).format(date.toUtc()); + dateName += " " +DateFormat(DateFormat.HOUR_MINUTE, AppLanguage().appLocal.toString()).format(date.toUtc()); } return dateName; @@ -74,5 +73,4 @@ mixin Common { return _passwordRegExp.hasMatch(password); } - } \ No newline at end of file diff --git a/lib/util/session.dart b/lib/util/session.dart index 683610e..b7f7895 100644 --- a/lib/util/session.dart +++ b/lib/util/session.dart @@ -17,7 +17,6 @@ class Session { Future _prefs = SharedPreferences.getInstance(); SharedPreferences _sharedPreferences; - final AppLanguage appLanguage = AppLanguage(); fetchSessionAndNavigate( ) async { print (" -- Session: await prefs.."); @@ -27,11 +26,11 @@ class Session { if ( Cache().firstLoad ) { print (" -- Session: fetch locale.."); - await appLanguage.getLocale(_sharedPreferences); - await AppLocalizations.delegate.load(appLanguage.appLocal); + await AppLanguage().getLocale(_sharedPreferences); + await AppLocalizations.delegate.load(AppLanguage().appLocal); print (" -- Session: fetch token.."); await _fetchToken(_sharedPreferences); - initDeviceLocale(); + //initDeviceLocale(); // PushNotificationsManager().init(); } @@ -69,7 +68,7 @@ class Session { Cache.password ); int customerId = 0; - print("--- Lang: " + appLanguage.appLocal.toString()); + print("--- Lang: " + AppLanguage().appLocal.toString()); if(responseJson['error'] != null) { print("************** Here big error - no authentication"); } else if (responseJson['token'] != null) { diff --git a/lib/util/trans.dart b/lib/util/trans.dart new file mode 100644 index 0000000..6b4e5c0 --- /dev/null +++ b/lib/util/trans.dart @@ -0,0 +1,13 @@ +import 'package:aitrainer_app/localization/app_localization.dart'; +import 'package:flutter/cupertino.dart'; + +mixin Trans { + BuildContext context; + void setContext(BuildContext context) { + this.context = context; + } + + String t(String text) { + return AppLocalizations.of(context).translate(text); + } +} \ No newline at end of file diff --git a/lib/view/account.dart b/lib/view/account.dart index e70df1e..4c2c4ca 100644 --- a/lib/view/account.dart +++ b/lib/view/account.dart @@ -1,23 +1,24 @@ import 'package:aitrainer_app/bloc/account/account_bloc.dart'; import 'package:aitrainer_app/localization/app_language.dart'; -import 'package:aitrainer_app/localization/app_localization.dart'; import 'package:aitrainer_app/model/customer.dart'; +import 'package:aitrainer_app/util/trans.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:aitrainer_app/widgets/bottom_nav.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; // ignore: must_be_immutable -class AccountPage extends StatelessWidget { +class AccountPage extends StatelessWidget with Trans { // ignore: close_sinks AccountBloc accountBloc; @override Widget build(BuildContext context) { + setContext(context); accountBloc = BlocProvider.of(context); return Scaffold( appBar: AppBar( - title: Text(AppLocalizations.of(context).translate('Account')), + title: Text(t('Account')), backgroundColor: Colors.transparent, ), body: Container( @@ -76,7 +77,7 @@ class AccountPage extends StatelessWidget { ListTile( leading: Icon(Icons.perm_identity), subtitle: - Text(AppLocalizations.of(context).translate("Profile")), + Text(t("Profile")), title: FlatButton( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -118,7 +119,7 @@ class AccountPage extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text(AppLocalizations.of(context).translate(text), + Text(t(text), style: TextStyle( color: buttonColor )), diff --git a/lib/view/customer_modify_page.dart b/lib/view/customer_modify_page.dart index dfb6c63..202c477 100644 --- a/lib/view/customer_modify_page.dart +++ b/lib/view/customer_modify_page.dart @@ -1,6 +1,7 @@ import 'package:aitrainer_app/bloc/account/account_bloc.dart'; import 'package:aitrainer_app/bloc/customer_change_form_bloc.dart'; import 'package:aitrainer_app/localization/app_localization.dart'; +import 'package:aitrainer_app/util/trans.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; @@ -9,15 +10,13 @@ import 'package:flutter_form_bloc/flutter_form_bloc.dart'; import '../library_keys.dart'; - - // ignore: must_be_immutable -class CustomerModifyPage extends StatelessWidget{ +class CustomerModifyPage extends StatelessWidget with Trans { final _formKey = GlobalKey(); - @override Widget build(BuildContext context) { + setContext(context); // ignore: close_sinks final accountBloc = BlocProvider.of(context); // we cannot initialize the translations in the initState @@ -31,68 +30,61 @@ class CustomerModifyPage extends StatelessWidget{ }); */ return BlocProvider( - create: (context) => - CustomerChangeFormBloc(customerRepository: accountBloc.customerRepository), - child: Builder(builder: (context) { - // ignore: close_sinks - final customerBloc = BlocProvider.of(context); + create: (context) => CustomerChangeFormBloc(customerRepository: accountBloc.customerRepository), + child: Builder(builder: (context) { + // ignore: close_sinks + final customerBloc = BlocProvider.of(context); - return Scaffold( - resizeToAvoidBottomInset: true, - appBar: AppBar( - title: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text("Profil"), - Image.asset( - 'asset/image/WT_long_logo.png', - fit: BoxFit.cover, - height: 65.0, + return Scaffold( + resizeToAvoidBottomInset: true, + appBar: AppBar( + title: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text("Profil"), + Image.asset( + 'asset/image/WT_long_logo.png', + fit: BoxFit.cover, + height: 65.0, + ), + ], ), - ], - ), - //title: Text(AppLocalizations.of(context).translate('Settings')), - backgroundColor: Colors.transparent, - ), - body: Container( - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage('asset/image/WT_light_background.png'), - fit: BoxFit.cover, - alignment: Alignment.center, + //title: Text(AppLocalizations.of(context).translate('Settings')), + backgroundColor: Colors.transparent, ), - ), - child: Form( - key: _formKey, - child: SingleChildScrollView( - scrollDirection: Axis.vertical, - padding: EdgeInsets.only( - top: 40, left: 25, right: 45, bottom: 100), + body: Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage('asset/image/WT_light_background.png'), + fit: BoxFit.cover, + alignment: Alignment.center, + ), + ), + child: Form( + key: _formKey, + child: SingleChildScrollView( + scrollDirection: Axis.vertical, + padding: EdgeInsets.only(top: 40, left: 25, right: 45, bottom: 100), + child: Container( + alignment: Alignment.center, + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: TextFieldBlocBuilder( + key: LibraryKeys.loginEmailField, + style: TextStyle(fontSize: 12), + textFieldBloc: customerBloc.emailField, + decoration: InputDecoration( + fillColor: Colors.white24, + filled: true, + labelText: t('Email'), + ), + ), - child: Container( - alignment: Alignment.center, - - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - - Expanded( - child: - TextFieldBlocBuilder( - key: LibraryKeys.loginEmailField, - style: TextStyle(fontSize: 12), - textFieldBloc: customerBloc.emailField, - decoration: InputDecoration( - fillColor: Colors.white24, - filled: true, - labelText: AppLocalizations.of(context) - .translate('Email'), - ), - ), - - /* TextFormField( + /* TextFormField( style: TextStyle(fontSize: 12), decoration: InputDecoration( fillColor: Colors.white24, @@ -100,33 +92,29 @@ class CustomerModifyPage extends StatelessWidget{ labelText: AppLocalizations.of(context) .translate('Email'), ), */ - // initialValue: customerChangingViewModel.customer - // .customer.email, - // onFieldSubmitted: (input) => - // customerChangingViewModel.customer.setEmail( - // input) - ) - ], - ), - - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - - Expanded( - child: - TextFieldBlocBuilder( - style: TextStyle(fontSize: 12), - textFieldBloc: customerBloc.passwordField, - suffixButton: SuffixButton.obscureText, - decoration: InputDecoration( - fillColor: Colors.white24, - filled: true, - labelText: AppLocalizations.of(context) - .translate('Password (Leave empty if no change)'), - ), + // initialValue: customerChangingViewModel.customer + // .customer.email, + // onFieldSubmitted: (input) => + // customerChangingViewModel.customer.setEmail( + // input) + ) + ], ), - /*TextFormField( + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: TextFieldBlocBuilder( + style: TextStyle(fontSize: 12), + textFieldBloc: customerBloc.passwordField, + suffixButton: SuffixButton.obscureText, + decoration: InputDecoration( + fillColor: Colors.white24, + filled: true, + labelText: t('Password (Leave empty if no change)'), + ), + ), + /*TextFormField( style: TextStyle(fontSize: 12), obscureText: true, decoration: InputDecoration( @@ -139,164 +127,110 @@ class CustomerModifyPage extends StatelessWidget{ //initialValue: customerChangingViewModel.customer.customer.password, // onFieldSubmitted: (input) => customerChangingViewModel.customer.setPassword(input) )*/ - ) - ], - ), - - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - - Expanded( - child: TextFieldBlocBuilder( - style: TextStyle(fontSize: 12), - textFieldBloc: customerBloc.nameField, - decoration: InputDecoration( - fillColor: Colors.white24, - filled: true, - labelText: AppLocalizations.of(context) - .translate('Name'), - ), - ), - ) - ], - ), - - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - - Expanded( - child: TextFieldBlocBuilder( - style: TextStyle(fontSize: 12), - textFieldBloc: customerBloc.firstNameField, - decoration: InputDecoration( - fillColor: Colors.white24, - filled: true, - labelText: AppLocalizations.of(context) - .translate('First Name'), - ), - ), - ) - ], - ), - - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - - Expanded( - child: TextFieldBlocBuilder( - style: TextStyle(fontSize: 12), - textFieldBloc: customerBloc.birthYearField, - inputFormatters: [ - WhitelistingTextInputFormatter (RegExp(r"[\d]")) - ], - decoration: InputDecoration( - fillColor: Colors.white24, - filled: true, - labelText: AppLocalizations.of(context) - .translate('Birth Year'), - ), - ), - ) - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - - Expanded( - child: TextFieldBlocBuilder( - style: TextStyle(fontSize: 12), - textFieldBloc: customerBloc.weightField, - inputFormatters: [ - WhitelistingTextInputFormatter (RegExp(r"[\d]")) - ], - decoration: InputDecoration( - fillColor: Colors.white24, - filled: true, - labelText: AppLocalizations.of(context) - .translate('Weight'), - ), - ), - ) - ], - ), - Divider(), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - - Expanded( - child: DropdownFieldBlocBuilder( - selectFieldBloc: customerBloc.genderField, - itemBuilder: (context, item) => item, - decoration: InputDecoration( - labelText: AppLocalizations.of(context).translate( - 'Select a gender'), ) - ), - ) - /* child: DropdownButtonHideUnderline( - child: DropdownButton( - hint: Text( - AppLocalizations.of(context).translate( - 'Select a gender')), - style: TextStyle( - fontSize: 12, color: Colors.black), - focusColor: Colors.white24, - // value: selectedGender, - items: genders.map((GenderItem gender) { - return DropdownMenuItem( - value: gender, - child: Text(gender.name) - ); - }).toList(), - onChanged: (GenderItem gender) => { - // setState(() { - // selectedGender = gender; - // customerChangingViewModel.customer.setSex(gender.dbValue); - - print ("Gender " + gender.name); - //}) - //model.customer.sex = - }, - ) - ) */ - ], + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: TextFieldBlocBuilder( + style: TextStyle(fontSize: 12), + textFieldBloc: customerBloc.nameField, + decoration: InputDecoration( + fillColor: Colors.white24, + filled: true, + labelText: t('Name'), + ), + ), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: TextFieldBlocBuilder( + style: TextStyle(fontSize: 12), + textFieldBloc: customerBloc.firstNameField, + decoration: InputDecoration( + fillColor: Colors.white24, + filled: true, + labelText: t('First Name'), + ), + ), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: TextFieldBlocBuilder( + style: TextStyle(fontSize: 12), + textFieldBloc: customerBloc.birthYearField, + inputFormatters: [WhitelistingTextInputFormatter(RegExp(r"[\d]"))], + decoration: InputDecoration( + fillColor: Colors.white24, + filled: true, + labelText: t('Birth Year'), + ), + ), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: TextFieldBlocBuilder( + style: TextStyle(fontSize: 12), + textFieldBloc: customerBloc.weightField, + inputFormatters: [WhitelistingTextInputFormatter(RegExp(r"[\d]"))], + decoration: InputDecoration( + fillColor: Colors.white24, + filled: true, + labelText: t('Weight'), + ), + ), + ) + ], + ), + Divider(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: DropdownFieldBlocBuilder( + selectFieldBloc: customerBloc.genderField, + itemBuilder: (context, item) => item, + decoration: InputDecoration( + labelText: t('Select a gender'), + )), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Expanded( + child: RaisedButton( + color: Colors.orange, + textColor: Colors.white, + child: InkWell(child: Text(t("Next"))), + onPressed: () => { + customerBloc.add(SubmitFormBloc()), + Navigator.of(context) + .pushNamed("customerGoalPage", arguments: customerBloc.customerRepository) + }, + )) + ], + ), + ], + ), ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - - Expanded( - child: RaisedButton( - - color: Colors.orange, - textColor: Colors.white, - child: InkWell( - child: Text( - AppLocalizations.of(context).translate( - "Next"))), - onPressed: () => - { - customerBloc.add(SubmitFormBloc()), - Navigator.of(context).pushNamed("customerGoalPage", arguments: customerBloc.customerRepository) - }, - ) - ) - ], - ), - ], - ), - ), - ), - ) - ) - ); - }) - ); + ), + ))); + })); } - } diff --git a/lib/view/exercise_add_by_plan_page.dart b/lib/view/exercise_add_by_plan_page.dart index 91ebc3d..90ca6b9 100644 --- a/lib/view/exercise_add_by_plan_page.dart +++ b/lib/view/exercise_add_by_plan_page.dart @@ -3,10 +3,9 @@ import 'dart:collection'; import 'package:aitrainer_app/bloc/exercise_add_by_plan_bloc.dart'; import 'package:aitrainer_app/bloc/exercise_by_plan/exercise_by_plan_bloc.dart'; import 'package:aitrainer_app/localization/app_language.dart'; -import 'package:aitrainer_app/localization/app_localization.dart'; import 'package:aitrainer_app/model/workout_tree.dart'; -import 'package:aitrainer_app/repository/exercise_plan_repository.dart'; import 'package:aitrainer_app/repository/exercise_repository.dart'; +import 'package:aitrainer_app/util/trans.dart'; import 'package:aitrainer_app/widgets/splash.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -18,7 +17,7 @@ class ExerciseAddByPlanPage extends StatefulWidget{ _ExerciseAddByPlanPage createState() => _ExerciseAddByPlanPage(); } -class _ExerciseAddByPlanPage extends State { +class _ExerciseAddByPlanPage extends State with Trans { @override Widget build(BuildContext context) { @@ -28,6 +27,7 @@ class _ExerciseAddByPlanPage extends State { final int customerId = arguments['customerId']; final WorkoutTree workoutTree = arguments['workoutTree']; final ExerciseRepository exerciseRepository = ExerciseRepository(); + setContext(context); return BlocProvider( create: (context) => @@ -155,10 +155,9 @@ class _ExerciseAddByPlanPage extends State { filled: false, hintStyle: TextStyle( fontSize: 12, color: Colors.black54, fontWeight: FontWeight.w100), - hintText: AppLocalizations.of(context) - .translate("The number of the exercise"), + hintText: t("The number of the exercise"), labelStyle: TextStyle(fontSize: 12, color: Colors.deepOrange, fontWeight: FontWeight.normal), - labelText: "Please repeat with " + exerciseBloc.unitQuantity1Field.value + " " + + labelText: t("Please repeat with ") + exerciseBloc.unitQuantity1Field.value + " " + exerciseBloc.exerciseRepository.exerciseType.unitQuantityUnit + " " + exerciseBloc.exercisePlanRepository.actualPlanDetail.repeats.toString() + " times!", ), @@ -201,7 +200,7 @@ class _ExerciseAddByPlanPage extends State { } }, child: Text( - AppLocalizations.of(context).translate("Check"), + t("Check"), style: TextStyle(fontSize: 12),) ), Divider(color: Colors.transparent,), @@ -213,8 +212,7 @@ class _ExerciseAddByPlanPage extends State { } String validateNumberInput(input) { - String error = AppLocalizations.of(context).translate( - "Please type the right quantity 0-10000"); + String error = t("Please type the right quantity 0-10000"); dynamic rc = (input != null && input.length > 0); if (!rc) { return null; diff --git a/lib/view/exercise_control_page.dart b/lib/view/exercise_control_page.dart index 5e1201a..59b1da2 100644 --- a/lib/view/exercise_control_page.dart +++ b/lib/view/exercise_control_page.dart @@ -11,12 +11,11 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_form_bloc/flutter_form_bloc.dart'; -class ExerciseControlPage extends StatefulWidget{ +class ExerciseControlPage extends StatefulWidget { _ExerciseControlPage createState() => _ExerciseControlPage(); } class _ExerciseControlPage extends State { - @override Widget build(BuildContext context) { LinkedHashMap arguments = ModalRoute.of(context).settings.arguments; @@ -25,27 +24,25 @@ class _ExerciseControlPage extends State { final bool readonly = arguments['readonly']; return BlocProvider( - create: (context) => - ExerciseControlFormBloc(exerciseRepository: exerciseRepository, percentToCalculate: percent, readonly: readonly), - child: BlocBuilder( - builder: (context, state) { + create: (context) => ExerciseControlFormBloc( + exerciseRepository: exerciseRepository, percentToCalculate: percent, readonly: readonly), + child: BlocBuilder(builder: (context, state) { // ignore: close_sinks final exerciseBloc = BlocProvider.of(context); - if ( state is FormBlocLoading ) { + if (state is FormBlocLoading) { return LoadingDialog(); - } else if ( state is FormBlocSuccess) { + } else if (state is FormBlocSuccess) { return getControlForm(exerciseBloc); } else { return getControlForm(exerciseBloc); } - } - )); + })); } - Form getControlForm( ExerciseControlFormBloc exerciseBloc) { - String exerciseName = AppLanguage().appLocal == Locale("en") ? - exerciseBloc.exerciseRepository.exerciseType.name : - exerciseBloc.exerciseRepository.exerciseType.nameTranslation; + Form getControlForm(ExerciseControlFormBloc exerciseBloc) { + String exerciseName = AppLanguage().appLocal == Locale("en") + ? exerciseBloc.exerciseRepository.exerciseType.name + : exerciseBloc.exerciseRepository.exerciseType.nameTranslation; return Form( autovalidate: true, @@ -70,227 +67,200 @@ class _ExerciseControlPage extends State { ), ), 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, + 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, + ), ), - ), - child: Container( - padding: const EdgeInsets.only (top: 25, left: 25, right: 25), - child: SingleChildScrollView( - scrollDirection: Axis.vertical, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Text(exerciseName, - style: TextStyle(fontWeight: FontWeight.bold, - fontSize: 18, - color: Colors.deepOrange), - overflow: TextOverflow.fade, - maxLines: 1, - softWrap: true, - ), - FlatButton( - child: Row( - - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ + child: Container( + padding: const EdgeInsets.only(top: 25, left: 25, right: 25), + child: SingleChildScrollView( + scrollDirection: Axis.vertical, + child: Column(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ + Text( + exerciseName, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18, color: Colors.deepOrange), + overflow: TextOverflow.fade, + maxLines: 1, + softWrap: true, + ), + FlatButton( + child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Icon(Icons.question_answer), - Text(AppLocalizations.of(context).translate( - "Why do you need Exercise Control?"), - style: TextStyle( - color: Colors.blueAccent, - fontWeight: FontWeight.normal, - fontSize: 14)), + Text(AppLocalizations.of(context).translate("Why do you need Exercise Control?"), + 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), - }, - ), - - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text(AppLocalizations.of(context).translate("Your 1RM:"),), - Text(" " + exerciseBloc.initialRMField.value + " " +exerciseBloc.exerciseRepository.exerciseType - .unitQuantityUnit, - style: TextStyle(fontWeight: FontWeight.bold),), - ], - ), - Divider(), - Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(AppLocalizations.of(context).translate("1st Control Exercise:"), - style: TextStyle(),), - TextFieldBlocBuilder( - readOnly: exerciseBloc.step != 1, - textFieldBloc: exerciseBloc.quantity1Field, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 14, - color: Colors.deepOrange, - fontWeight: FontWeight.bold), - inputFormatters: [ - WhitelistingTextInputFormatter (RegExp(r"[\d.]")) - ], - - decoration: InputDecoration( - fillColor: Colors.white, - filled: false, - hintStyle: TextStyle( - fontSize: 12, color: Colors.black54, fontWeight: FontWeight.w100), - hintText: AppLocalizations.of(context) - .translate("The number of the exercise"), - labelStyle: TextStyle(fontSize: 12, color: Colors.deepOrange, fontWeight: FontWeight.normal), - labelText: "Please repeat with " + exerciseBloc.unitQuantity1Field.value + " " + exerciseBloc.exerciseRepository.exerciseType.unitQuantityUnit + " 12 times!", + textColor: Colors.blueAccent, + color: Colors.transparent, + onPressed: () => { + //Navigator.of(context).pushNamed('exerciseTypeDescription', arguments: exerciseBloc.exerciseRepository), + }, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + AppLocalizations.of(context).translate("Your 1RM:"), ), - ), - RaisedButton( - padding: EdgeInsets.all(0), - textColor: Colors.white, - color: exerciseBloc.step == 1 ? Colors.blue : Colors.black26, - focusColor: Colors.blueAccent, - onPressed: () => - { - exerciseBloc.submit() - }, - child: Text( - AppLocalizations.of(context).translate("Check"), - style: TextStyle(fontSize: 12),) - ), - ], - ), - Divider(), - - Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(AppLocalizations.of(context).translate("2nd Control Exercise:"), - style: TextStyle(),), - TextFieldBlocBuilder( - readOnly: exerciseBloc.step != 2, - textFieldBloc: exerciseBloc.quantity2Field, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 14, - color: Colors.deepOrange, - fontWeight: FontWeight.bold), - inputFormatters: [ - WhitelistingTextInputFormatter (RegExp(r"[\d.]")) - ], - onChanged: (input) => { - print("Quantity 2 value $input"), - //exerciseBloc.exerciseRepository.setQuantity(double.parse(input)), - //exerciseBloc.exerciseRepository - // .setUnit(exerciseBloc.exerciseRepository.exerciseType.unit) - }, - decoration: InputDecoration( - fillColor: Colors.white, - filled: false, - hintStyle: TextStyle( - fontSize: 12, color: Colors.black54, fontWeight: FontWeight.w100), - hintText: AppLocalizations.of(context) - .translate("The number of the exercise"), - labelStyle: TextStyle(fontSize: 12, color: Colors.deepOrange, fontWeight: FontWeight.normal), - labelText: "Please repeat with " + exerciseBloc.unitQuantity2Field.value + " " + exerciseBloc.exerciseRepository.exerciseType.unitQuantityUnit + " 12 times!", + Text( + " " + + exerciseBloc.initialRMField.value + + " " + + exerciseBloc.exerciseRepository.exerciseType.unitQuantityUnit, + style: TextStyle(fontWeight: FontWeight.bold), ), - ), - RaisedButton( - padding: EdgeInsets.all(0), - textColor: Colors.white, - color: exerciseBloc.step == 2 ? Colors.blue : Colors.black26, - focusColor: Colors.blueAccent, - onPressed: () => - { - exerciseBloc.submit() - }, - child: Text( - AppLocalizations.of(context).translate("Check"), - style: TextStyle(fontSize: 12),) - ), - ], - ), - Divider(), - - Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(AppLocalizations.of(context).translate("3rd Control Exercise:"), - style: TextStyle(),), - TextFieldBlocBuilder( - readOnly: exerciseBloc.step != 3, - textFieldBloc: exerciseBloc.quantity3Field, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 14, - color: Colors.deepOrange, - fontWeight: FontWeight.bold), - inputFormatters: [ - WhitelistingTextInputFormatter (RegExp(r"[\d.]")) - ], - onChanged: (input) => { - print("Quantity 3 value $input"), - //exerciseBloc.exerciseRepository.setQuantity(double.parse(input)), - //exerciseBloc.exerciseRepository - // .setUnit(exerciseBloc.exerciseRepository.exerciseType.unit) - }, - decoration: InputDecoration( - fillColor: Colors.white, - filled: false, - hintStyle: TextStyle( - fontSize: 12, color: Colors.black54, fontWeight: FontWeight.w100), - hintText: AppLocalizations.of(context) - .translate("The number of the exercise"), - labelStyle: TextStyle(fontSize: 12, color: Colors.deepOrange, fontWeight: FontWeight.normal), - labelText: "Please repeat with " + exerciseBloc.unitQuantity3Field.value + " " + exerciseBloc.exerciseRepository.exerciseType.unitQuantityUnit + " 12 times!", + ], + ), + Divider(), + Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + AppLocalizations.of(context).translate("1st Control Exercise:"), + style: TextStyle(), ), - ), - RaisedButton( - padding: EdgeInsets.all(0), - textColor: Colors.white, - color: exerciseBloc.step == 3 ? Colors.blue : Colors.black26, - focusColor: Colors.blueAccent, - onPressed: () => - { - exerciseBloc.submit() - }, - child: Text( - AppLocalizations.of(context).translate("Check"), - style: TextStyle(fontSize: 12),) - ), - ], - ), - - ]), - ) - ) - ), + TextFieldBlocBuilder( + readOnly: exerciseBloc.step != 1, + textFieldBloc: exerciseBloc.quantity1Field, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 14, color: Colors.deepOrange, fontWeight: FontWeight.bold), + inputFormatters: [WhitelistingTextInputFormatter(RegExp(r"[\d.]"))], + decoration: InputDecoration( + fillColor: Colors.white, + filled: false, + hintStyle: TextStyle(fontSize: 12, color: Colors.black54, fontWeight: FontWeight.w100), + hintText: AppLocalizations.of(context).translate("The number of the exercise"), + labelStyle: + TextStyle(fontSize: 12, color: Colors.deepOrange, fontWeight: FontWeight.normal), + labelText: "Please repeat with " + + exerciseBloc.unitQuantity1Field.value + + " " + + exerciseBloc.exerciseRepository.exerciseType.unitQuantityUnit + + " " + + exerciseBloc.times + + " times!", + ), + ), + RaisedButton( + padding: EdgeInsets.all(0), + textColor: Colors.white, + color: exerciseBloc.step == 1 ? Colors.blue : Colors.black26, + focusColor: Colors.blueAccent, + onPressed: () => {exerciseBloc.submit()}, + child: Text( + AppLocalizations.of(context).translate("Check"), + style: TextStyle(fontSize: 12), + )), + ], + ), + Divider(), + Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + AppLocalizations.of(context).translate("2nd Control Exercise:"), + style: TextStyle(), + ), + TextFieldBlocBuilder( + readOnly: exerciseBloc.step != 2, + textFieldBloc: exerciseBloc.quantity2Field, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 14, color: Colors.deepOrange, fontWeight: FontWeight.bold), + inputFormatters: [WhitelistingTextInputFormatter(RegExp(r"[\d.]"))], + onChanged: (input) => { + print("Quantity 2 value $input"), + //exerciseBloc.exerciseRepository.setQuantity(double.parse(input)), + //exerciseBloc.exerciseRepository + // .setUnit(exerciseBloc.exerciseRepository.exerciseType.unit) + }, + decoration: InputDecoration( + fillColor: Colors.white, + filled: false, + hintStyle: TextStyle(fontSize: 12, color: Colors.black54, fontWeight: FontWeight.w100), + hintText: AppLocalizations.of(context).translate("The number of the exercise"), + labelStyle: + TextStyle(fontSize: 12, color: Colors.deepOrange, fontWeight: FontWeight.normal), + labelText: "Please repeat with " + + exerciseBloc.unitQuantity2Field.value + + " " + + exerciseBloc.exerciseRepository.exerciseType.unitQuantityUnit + + " 12 times!", + ), + ), + RaisedButton( + padding: EdgeInsets.all(0), + textColor: Colors.white, + color: exerciseBloc.step == 2 ? Colors.blue : Colors.black26, + focusColor: Colors.blueAccent, + onPressed: () => {exerciseBloc.submit()}, + child: Text( + AppLocalizations.of(context).translate("Check"), + style: TextStyle(fontSize: 12), + )), + ], + ), + Divider(), + Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + AppLocalizations.of(context).translate("3rd Control Exercise:"), + style: TextStyle(), + ), + TextFieldBlocBuilder( + readOnly: exerciseBloc.step != 3, + textFieldBloc: exerciseBloc.quantity3Field, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 14, color: Colors.deepOrange, fontWeight: FontWeight.bold), + inputFormatters: [WhitelistingTextInputFormatter(RegExp(r"[\d.]"))], + onChanged: (input) => { + print("Quantity 3 value $input"), + //exerciseBloc.exerciseRepository.setQuantity(double.parse(input)), + //exerciseBloc.exerciseRepository + // .setUnit(exerciseBloc.exerciseRepository.exerciseType.unit) + }, + decoration: InputDecoration( + fillColor: Colors.white, + filled: false, + hintStyle: TextStyle(fontSize: 12, color: Colors.black54, fontWeight: FontWeight.w100), + hintText: AppLocalizations.of(context).translate("The number of the exercise"), + labelStyle: + TextStyle(fontSize: 12, color: Colors.deepOrange, fontWeight: FontWeight.normal), + labelText: "Please repeat with " + + exerciseBloc.unitQuantity3Field.value + + " " + + exerciseBloc.exerciseRepository.exerciseType.unitQuantityUnit + + " 12 times!", + ), + ), + RaisedButton( + padding: EdgeInsets.all(0), + textColor: Colors.white, + color: exerciseBloc.step == 3 ? Colors.blue : Colors.black26, + focusColor: Colors.blueAccent, + onPressed: () => {exerciseBloc.submit()}, + child: Text( + AppLocalizations.of(context).translate("Check"), + style: TextStyle(fontSize: 12), + )), + ], + ), + ]), + ))), ), ); } - String validateNumberInput(input) { - String error = AppLocalizations.of(context).translate( - "Please type the right quantity 0-10000"); + String error = AppLocalizations.of(context).translate("Please type the right quantity 0-10000"); dynamic rc = (input != null && input.length > 0); if (!rc) { return null; @@ -307,7 +277,6 @@ class _ExerciseControlPage extends State { return error; } - if (!(double.parse(input) < 10000 && double.parse(input) > 0)) { return error; } diff --git a/lib/view/exercise_log_page.dart b/lib/view/exercise_log_page.dart index 3d1c3d6..b2c9c81 100644 --- a/lib/view/exercise_log_page.dart +++ b/lib/view/exercise_log_page.dart @@ -1,12 +1,12 @@ import 'dart:collection'; import 'package:aitrainer_app/localization/app_language.dart'; -import 'package:aitrainer_app/localization/app_localization.dart'; import 'package:aitrainer_app/model/cache.dart'; import 'package:aitrainer_app/model/exercise.dart'; import 'package:aitrainer_app/model/exercise_type.dart'; import 'package:aitrainer_app/repository/customer_repository.dart'; import 'package:aitrainer_app/repository/exercise_repository.dart'; +import 'package:aitrainer_app/util/trans.dart'; import 'package:aitrainer_app/widgets/app_bar_common.dart'; import 'package:flutter/material.dart'; import 'package:flutter_treeview/tree_view.dart'; @@ -16,13 +16,14 @@ class ExerciseLogPage extends StatefulWidget { _ExerciseLogPage createState() => _ExerciseLogPage(); } -class _ExerciseLogPage extends State { +class _ExerciseLogPage extends State with Trans { @override Widget build(BuildContext context) { LinkedHashMap arguments = ModalRoute.of(context).settings.arguments; final ExerciseRepository exerciseRepository = arguments['exerciseRepository']; final CustomerRepository customerRepository = arguments['customerRepository']; final int customerId = arguments['customerId']; + setContext(context); return Scaffold( appBar: AppBarCommonNav(), @@ -126,8 +127,7 @@ class _ExerciseLogPage extends State { String unitQuantity = exerciseType.unitQuantity == "1" ? exercise.unitQuantity.toStringAsFixed(0) + " " + - AppLocalizations.of(context) - .translate(exerciseType.unitQuantityUnit) + + t(exerciseType.unitQuantityUnit) + " " : ""; @@ -136,7 +136,7 @@ class _ExerciseLogPage extends State { unitQuantity + exercise.quantity.toStringAsFixed(0) + " " + - AppLocalizations.of(context).translate(exercise.unit); + t(exercise.unit); listExercisesPerDay.add(Node( label: labelExercise, key: exercise.exerciseId.toString(), diff --git a/lib/view/exercise_plan_custom_page.dart b/lib/view/exercise_plan_custom_page.dart index 9beb3ef..751bbb5 100644 --- a/lib/view/exercise_plan_custom_page.dart +++ b/lib/view/exercise_plan_custom_page.dart @@ -56,8 +56,6 @@ class _ExercisePlanCustomPage extends State { ), child: BlocConsumer(listener: (context, state) { if (state is ExercisePlanError) { - //showInSnackBar(state.message); - //return exerciseWidget(bloc); Scaffold.of(context).showSnackBar(SnackBar( content: Text( state.message, diff --git a/lib/view/exercise_plan_detail_add_page.dart b/lib/view/exercise_plan_detail_add_page.dart index 1216b81..d17668c 100644 --- a/lib/view/exercise_plan_detail_add_page.dart +++ b/lib/view/exercise_plan_detail_add_page.dart @@ -1,9 +1,9 @@ - import 'package:aitrainer_app/bloc/exercise_plan/exercise_plan_bloc.dart'; import 'package:aitrainer_app/bloc/exercise_plan_custom_form.dart'; import 'package:aitrainer_app/localization/app_language.dart'; import 'package:aitrainer_app/localization/app_localization.dart'; import 'package:aitrainer_app/repository/exercise_plan_repository.dart'; +import 'package:aitrainer_app/util/trans.dart'; import 'package:aitrainer_app/widgets/app_bar_common.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -16,15 +16,17 @@ class ExercisePlanDetailAddPage extends StatefulWidget { _ExercisePlanDetailAddPage createState() => _ExercisePlanDetailAddPage(); } -class _ExercisePlanDetailAddPage extends State { +class _ExercisePlanDetailAddPage extends State with Trans { @override Widget build(BuildContext context) { // ignore: close_sinks final ExercisePlanBloc planBloc = ModalRoute.of(context).settings.arguments; final ExercisePlanRepository exercisePlanRepository = planBloc.exercisePlanRepository; + setContext(context); return BlocProvider( - create: (context) => ExercisePlanCustomerFormBloc(exercisePlanRepository: exercisePlanRepository, planBloc: planBloc), + create: (context) => + ExercisePlanCustomerFormBloc(exercisePlanRepository: exercisePlanRepository, planBloc: planBloc), child: Builder(builder: (context) { // ignore: close_sinks final bloc = BlocProvider.of(context); @@ -88,7 +90,8 @@ class _ExercisePlanDetailAddPage extends State { fillColor: Colors.white, filled: false, hintStyle: TextStyle(fontSize: 16, color: Colors.black54, fontWeight: FontWeight.w100), - hintText: AppLocalizations.of(context).translate("The number of the repeats of one serie"), + hintText: + AppLocalizations.of(context).translate("The number of the repeats of one serie"), labelStyle: TextStyle(fontSize: 16, color: Colors.lightBlue), labelText: AppLocalizations.of(context).translate("Repeats"), ), @@ -116,10 +119,12 @@ class _ExercisePlanDetailAddPage extends State { focusColor: Colors.white, onPressed: () => { print("Remove " + bloc.exercisePlanRepository.actualPlanDetail.exerciseType.name), - planBloc.add(ExercisePlanRemoveExercise(exercisePlanDetail: bloc.exercisePlanRepository.actualPlanDetail)), + planBloc.add(ExercisePlanRemoveExercise( + exercisePlanDetail: bloc.exercisePlanRepository.actualPlanDetail)), Navigator.of(context).pop(), }, - child: Text("Delete"), //Text(AppLocalizations.of(context).translate("Delete"), style: TextStyle(fontSize: 16),) + child: Text(t( + "Delete")), //Text(AppLocalizations.of(context).translate("Delete"), style: TextStyle(fontSize: 16),) ), RaisedButton( textColor: Colors.white, @@ -129,9 +134,7 @@ class _ExercisePlanDetailAddPage extends State { bloc.submit(), Navigator.of(context).pop(), }, - child: Text( - AppLocalizations.of(context).translate("Save"), - style: TextStyle(fontSize: 16), + child: Text(t("Save"), style: TextStyle(fontSize: 16), )), ], ), diff --git a/lib/view/menu_page.dart b/lib/view/menu_page.dart index 3d066e4..626a7d7 100644 --- a/lib/view/menu_page.dart +++ b/lib/view/menu_page.dart @@ -24,12 +24,6 @@ class _MenuPage extends State { // ignore: close_sinks MenuBloc menuBloc; - - - void checkTest() { - - } - @override Widget build(BuildContext context) { menuBloc = BlocProvider.of(context); @@ -48,7 +42,7 @@ class _MenuPage extends State { if (state is MenuError) { Scaffold.of(context).showSnackBar(SnackBar( backgroundColor: Colors.orange, - content: Text("error", style: TextStyle(color: Colors.white)))); + content: Text(state.message, style: TextStyle(color: Colors.white)))); } else if ( state is MenuLoading ) { return MenuPageWidget(); } @@ -88,6 +82,7 @@ class _LoadingMenuDialog extends State { BlocProvider.of(context).add(MenuCreate()); }); } + @override Widget build(BuildContext context) { return WillPopScope( diff --git a/lib/view/mydevelopment_page.dart b/lib/view/mydevelopment_page.dart index cdea462..08f20ef 100644 --- a/lib/view/mydevelopment_page.dart +++ b/lib/view/mydevelopment_page.dart @@ -3,6 +3,7 @@ import 'dart:collection'; import 'package:aitrainer_app/model/cache.dart'; import 'package:aitrainer_app/repository/customer_repository.dart'; import 'package:aitrainer_app/repository/exercise_repository.dart'; +import 'package:aitrainer_app/util/trans.dart'; import 'package:aitrainer_app/widgets/app_bar_common.dart'; import 'package:aitrainer_app/widgets/bottom_nav.dart'; import 'package:flutter/cupertino.dart'; @@ -13,12 +14,13 @@ class MyDevelopmentPage extends StatefulWidget { _MyDevelopmentPage createState() => _MyDevelopmentPage(); } -class _MyDevelopmentPage extends State { +class _MyDevelopmentPage extends State with Trans { @override Widget build(BuildContext context) { final ExerciseRepository exerciseRepository = ExerciseRepository(); final CustomerRepository customerRepository = CustomerRepository(); final LinkedHashMap args = LinkedHashMap(); + setContext(context); return Scaffold( appBar: AppBarCommonNav(), @@ -51,7 +53,7 @@ class _MyDevelopmentPage extends State { Navigator.of(context).pushNamed('exerciseLogPage', arguments: args) }, - child: Text("My Exercise Logs", + child: Text(t("My Exercise Logs"), style: TextStyle(fontSize: 18),) ), Stack( @@ -71,7 +73,7 @@ class _MyDevelopmentPage extends State { onPressed: () => { }, - child: Text("My Whole Body Development", + child: Text(t("My Whole Body Development"), style: TextStyle(fontSize: 18),) ), @@ -94,7 +96,7 @@ class _MyDevelopmentPage extends State { onPressed: () => { }, - child: Text("Development Of Muscles", + child: Text(t("Development Of Muscles"), style: TextStyle(fontSize: 18),) ), @@ -117,7 +119,7 @@ class _MyDevelopmentPage extends State { onPressed: () => { }, - child: Text("Predictions", + child: Text(t("Predictions"), style: TextStyle(fontSize: 18),) ), ] @@ -154,7 +156,7 @@ class _MyDevelopmentPage extends State { Navigator.of(context).pushNamed('exerciseLogPage', arguments: args) }, - child: Text("My Trainee's Exercise Logs", + child: Text(t("My Trainee's Exercise Logs"), style: TextStyle(fontSize: 18),) ); } else { diff --git a/lib/view/myexcercise_plan_page.dart b/lib/view/myexcercise_plan_page.dart index 68351d4..f96c94a 100644 --- a/lib/view/myexcercise_plan_page.dart +++ b/lib/view/myexcercise_plan_page.dart @@ -1,6 +1,7 @@ import 'dart:collection'; import 'package:aitrainer_app/model/cache.dart'; import 'package:aitrainer_app/repository/exercise_repository.dart'; +import 'package:aitrainer_app/util/trans.dart'; import 'package:aitrainer_app/widgets/app_bar_common.dart'; import 'package:aitrainer_app/widgets/bottom_nav.dart'; import 'package:flutter/cupertino.dart'; @@ -11,11 +12,12 @@ class MyExercisePlanPage extends StatefulWidget { _MyExercisePlanPage createState() => _MyExercisePlanPage(); } -class _MyExercisePlanPage extends State { +class _MyExercisePlanPage extends State with Trans { @override Widget build(BuildContext context) { final ExerciseRepository exerciseRepository = ExerciseRepository(); final LinkedHashMap args = LinkedHashMap(); + setContext(context); return Scaffold( appBar: AppBarCommonNav(), @@ -46,7 +48,7 @@ class _MyExercisePlanPage extends State { Navigator.of(context).pushNamed('exerciseByPlanPage', arguments: args) }, - child: Text("Execute My Selected Training Plan", + child: Text(t("Execute My Selected Training Plan"), style: TextStyle(fontSize: 18),) ), @@ -62,7 +64,7 @@ class _MyExercisePlanPage extends State { Navigator.of(context).pushNamed('exercisePlanCustomPage', arguments: args) }, - child: Text("Edit My Custom Plan", + child: Text(t("Edit My Custom Plan"), style: TextStyle(fontSize: 18),) ), FlatButton( @@ -74,7 +76,7 @@ class _MyExercisePlanPage extends State { { }, - child: Text("Suggested Plan", + child: Text(t("Suggested Training Plan"), style: TextStyle(fontSize: 18),) ), Stack( @@ -95,7 +97,7 @@ class _MyExercisePlanPage extends State { { }, - child: Text("My Special Plan", + child: Text(t("My Special Plan"), style: TextStyle(fontSize: 18),) ), @@ -119,7 +121,7 @@ class _MyExercisePlanPage extends State { { }, - child: Text("My Arnold's Plan", + child: Text(t("My Arnold's Plan"), style: TextStyle(fontSize: 18),) ), @@ -160,7 +162,7 @@ class _MyExercisePlanPage extends State { Navigator.of(context).pushNamed('exercisePlanCustomPage', arguments: args) }, - child: Text("My Trainee's Plan", + child: Text(t("My Trainee's Plan"), style: TextStyle(fontSize: 18),) ); } else { @@ -183,7 +185,7 @@ class _MyExercisePlanPage extends State { Navigator.of(context).pushNamed('exerciseByPlanPage', arguments: args) }, - child: Text("Execute My Trainee's Training Plan", + child: Text(t("Execute My Trainee's Training Plan"), style: TextStyle(fontSize: 18),) ); } else { diff --git a/lib/widgets/app_bar.dart b/lib/widgets/app_bar.dart index 1b273d7..9f17deb 100644 --- a/lib/widgets/app_bar.dart +++ b/lib/widgets/app_bar.dart @@ -1,6 +1,5 @@ import 'dart:async'; -import 'package:aitrainer_app/animations/test_progress_animation.dart'; import 'package:aitrainer_app/bloc/menu/menu_bloc.dart'; import 'package:aitrainer_app/localization/app_localization.dart'; import 'package:aitrainer_app/model/cache.dart'; @@ -12,7 +11,7 @@ import 'package:percent_indicator/linear_percent_indicator.dart'; import 'package:rainbow_color/rainbow_color.dart'; -class AppBarNav extends StatefulWidget implements PreferredSizeWidget { +class AppBarNav extends StatefulWidget implements PreferredSizeWidget { final MenuBloc menuBloc; const AppBarNav({this.menuBloc}); @@ -86,6 +85,8 @@ class _AppBarNav extends State with SingleTickerProviderStateMixin { @override Widget build(BuildContext context) { menuBloc = BlocProvider.of(context); + //setContext(context); + return AppBar( backgroundColor: Colors.black, title: Row( @@ -128,11 +129,13 @@ class _AppBarNav extends State with SingleTickerProviderStateMixin { } int sizeExerciseList = Cache().getExercises() == null? 0 : Cache().getExercises().length; if ( sizeExerciseList == 0 ) { + String text = AppLocalizations.of(context).translate("Make your first test"); + double fontSize = text.length > 15 ? 10 : 16; return Stack( alignment: Alignment.topLeft, children: [ - Text(AppLocalizations.of(context).translate("Make your first test"), - style: TextStyle(fontSize: 16, color: colorAnim.value, shadows: [Shadow(color: Colors.purple , blurRadius: 15)]), + Text(text, + style: TextStyle(fontSize: fontSize, color: colorAnim.value, shadows: [Shadow(color: Colors.purple , blurRadius: 15)]), ), //TestProgress(animation: sizeAnim), diff --git a/lib/widgets/app_bar_common.dart b/lib/widgets/app_bar_common.dart index f6c6c02..b769db1 100644 --- a/lib/widgets/app_bar_common.dart +++ b/lib/widgets/app_bar_common.dart @@ -97,11 +97,13 @@ class _AppBarCommonNav extends State with SingleTickerProvider } int sizeExerciseList = Cache().getExercises() == null? 0 : Cache().getExercises().length; if ( sizeExerciseList == 0 ) { + String text = AppLocalizations.of(context).translate("Make your first test"); + double fontSize = text.length > 17 ? 10 : 16; return Stack( alignment: Alignment.topLeft, children: [ - Text(AppLocalizations.of(context).translate("Make your first test"), - style: TextStyle(fontSize: 16, color: colorAnim.value, shadows: [Shadow(color: Colors.purple , blurRadius: 15)]), + Text(text, + style: TextStyle(fontSize: fontSize, color: colorAnim.value, shadows: [Shadow(color: Colors.purple , blurRadius: 15)]), ), //TestProgress(animation: sizeAnim), diff --git a/lib/widgets/home.dart b/lib/widgets/home.dart index 5c578f5..9ee7002 100644 --- a/lib/widgets/home.dart +++ b/lib/widgets/home.dart @@ -36,17 +36,18 @@ class _HomePageState extends State { } Future runDelayedEvent() async { - await Future.delayed(Duration(seconds: 3), () async { + await Future.delayed(Duration(seconds: 2), () async { if ( context != null) { // ignore: close_sinks SessionBloc sessionBloc = BlocProvider.of(context); if (sessionBloc.state != SessionReady()) { - sessionBloc.add(SessionStart()); // ignore: close_sinks SettingsBloc settingsBloc = BlocProvider.of(context); - String lang = AppLanguage().appLocal.languageCode; - print (" -- Loading delayed lang $lang"); - settingsBloc.add(SettingsChangeLanguage(language: lang)); + settingsBloc.context = context; + sessionBloc.add(SessionStart(settingsBloc: settingsBloc)); + //String lang = AppLanguage().appLocal.languageCode; + //print (" -- Loading delayed lang $lang"); + //settingsBloc.add(SettingsChangeLanguage(language: lang)); } } }); @@ -59,7 +60,12 @@ class _HomePageState extends State { child: BlocConsumer( listener: (context, state) { if ( state is SessionFailure) { - + Scaffold.of(context).showSnackBar(SnackBar( + content: Text( + state.message, + ), + backgroundColor: Colors.orange, + )); } }, builder: (context, state) { @@ -69,7 +75,7 @@ class _HomePageState extends State { print("loading"); return LoadingScreenMain(); } else if (state is SessionReady) { - print("ready"); + print("ready menu with " + Cache().startPage); if (Cache().startPage == 'login') { return LoginPage(); } else if (Cache().startPage == 'registration') { diff --git a/lib/widgets/menu_page_widget.dart b/lib/widgets/menu_page_widget.dart index ac3c14c..f8819a4 100644 --- a/lib/widgets/menu_page_widget.dart +++ b/lib/widgets/menu_page_widget.dart @@ -37,7 +37,7 @@ class MenuPageWidget extends StatelessWidget { child: Center( child: Stack( alignment: Alignment.bottomLeft, - clipBehavior: Clip.antiAliasWithSaveLayer, + //clipBehavior: Clip.antiAliasWithSaveLayer, children: [ FlatButton( child: _getButtonImage(workoutTree), @@ -46,7 +46,7 @@ class MenuPageWidget extends StatelessWidget { onPressed: () => menuClick(workoutTree, menuBloc, context), ), Positioned( - top: workoutTree.name.length > 30 ? 140 : 150, + top: workoutTree.name.length > 15 ? 140 : 150, left: 5, child: Container( height: 300, diff --git a/pubspec.lock b/pubspec.lock index 870339d..7b7c8aa 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.1" + version: "2.4.2" bloc: dependency: transitive description: @@ -113,6 +113,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "7.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" charcode: dependency: transitive description: @@ -134,6 +141,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.2.0" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" code_builder: dependency: transitive description: @@ -147,7 +161,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.12" + version: "1.14.13" convert: dependency: transitive description: @@ -161,14 +175,14 @@ packages: name: coverage url: "https://pub.dartlang.org" source: hosted - version: "0.13.11" + version: "0.14.1" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "2.1.5" csslib: dependency: transitive description: @@ -204,13 +218,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.5" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" file: dependency: transitive description: name: file url: "https://pub.dartlang.org" source: hosted - version: "5.1.0" + version: "5.2.1" fixnum: dependency: transitive description: @@ -380,7 +401,7 @@ packages: name: image url: "https://pub.dartlang.org" source: hosted - version: "2.1.12" + version: "2.1.14" intl: dependency: "direct dev" description: @@ -415,7 +436,7 @@ packages: name: json_rpc_2 url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.1" logging: dependency: transitive description: @@ -429,7 +450,7 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.6" + version: "0.12.8" meta: dependency: transitive description: @@ -451,13 +472,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.1.1" - multi_server_socket: - dependency: transitive - description: - name: multi_server_socket - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" nested: dependency: transitive description: @@ -499,7 +513,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.6.4" + version: "1.7.0" path_provider_linux: dependency: transitive description: @@ -534,7 +548,7 @@ packages: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "3.0.4" platform: dependency: transitive description: @@ -562,7 +576,7 @@ packages: name: process url: "https://pub.dartlang.org" source: hosted - version: "3.0.12" + version: "3.0.13" provider: dependency: transitive description: @@ -728,7 +742,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.9.5" stream_channel: dependency: transitive description: @@ -770,21 +784,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.14.4" + version: "1.15.2" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.15" + version: "0.2.17" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.3.4" + version: "0.3.10" timing: dependency: transitive description: @@ -798,7 +812,7 @@ packages: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.2.0" usage: dependency: transitive description: @@ -875,7 +889,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "3.6.1" + version: "4.2.0" yaml: dependency: transitive description: @@ -884,5 +898,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.7.0 <3.0.0" + dart: ">=2.9.0-14.0.dev <3.0.0" flutter: ">=1.16.0 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 78a0b86..68c1139 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.1.0+20 +version: 1.1.0+21 environment: sdk: ">=2.7.0 <3.0.0" @@ -33,7 +33,7 @@ dependencies: flutter_local_notifications: 1.1.1 flutter_facebook_login: ^3.0.0 flutter_bloc: ^6.0.5 - equatable: ^1.2.4 + equatable: ^1.2.5 freezed: ^0.11.6 flutter_form_bloc: ^0.19.0 spider_chart: ^0.1.5 @@ -51,7 +51,7 @@ dev_dependencies: flutter_driver: sdk: flutter test: any - bloc_test: ^7.0.3 + bloc_test: ^7.0.4 build_runner: