WT 1.1.25+3 flutter 2.8, activate training plan
This commit is contained in:
parent
72ae1c8f8c
commit
54a61fa585
@ -551,6 +551,6 @@
|
||||
"Exception: Please select your goal": "Please select your goal",
|
||||
"Exception: Please select your biologial gender": "Please select your biologial gender",
|
||||
"The found exercises are": "The found exercises are",
|
||||
"in red": "in red",
|
||||
"in green": "in green",
|
||||
"in your calendar": "in your calendar"
|
||||
}
|
@ -551,6 +551,6 @@
|
||||
"Exception: Please select your goal": "Kérlek válaszd ki a célod",
|
||||
"Exception: Please select your biologial gender": "Kérlek válaszd ki a biológiai nemed",
|
||||
"The found exercises are": "A keresett gyakorlatot",
|
||||
"in red": "pirossal",
|
||||
"in green": "zölddel",
|
||||
"in your calendar": "jelöltük a naptárban"
|
||||
}
|
107
ios/Podfile.lock
107
ios/Podfile.lock
@ -8,23 +8,14 @@ PODS:
|
||||
- Flutter
|
||||
- devicelocale (0.0.1):
|
||||
- Flutter
|
||||
- FBAEMKit (11.2.1):
|
||||
- FBAEMKit/AEM (= 11.2.1)
|
||||
- FBAEMKit/AEM (11.2.1):
|
||||
- FBSDKCoreKit_Basics (~> 11.2.1)
|
||||
- FBSDKCoreKit (11.2.1):
|
||||
- FBSDKCoreKit/Core (= 11.2.1)
|
||||
- FBSDKCoreKit/Core (11.2.1):
|
||||
- FBAEMKit (~> 11.2.1)
|
||||
- FBSDKCoreKit_Basics (~> 11.2.1)
|
||||
- FBSDKCoreKit_Basics (11.2.1):
|
||||
- FBSDKCoreKit_Basics/Basics (= 11.2.1)
|
||||
- FBSDKCoreKit_Basics/Basics (11.2.1)
|
||||
- FBSDKLoginKit (11.2.1):
|
||||
- FBSDKLoginKit/Login (= 11.2.1)
|
||||
- FBSDKLoginKit/Login (11.2.1):
|
||||
- FBSDKCoreKit (~> 11.2.1)
|
||||
- FBSDKCoreKit_Basics (~> 11.2.1)
|
||||
- FBAEMKit (12.1.0):
|
||||
- FBSDKCoreKit_Basics (= 12.1.0)
|
||||
- FBSDKCoreKit (12.1.0):
|
||||
- FBAEMKit (= 12.1.0)
|
||||
- FBSDKCoreKit_Basics (= 12.1.0)
|
||||
- FBSDKCoreKit_Basics (12.1.0)
|
||||
- FBSDKLoginKit (12.1.0):
|
||||
- FBSDKCoreKit (= 12.1.0)
|
||||
- Firebase/Analytics (8.9.0):
|
||||
- Firebase/Core
|
||||
- Firebase/Auth (8.9.0):
|
||||
@ -47,30 +38,30 @@ PODS:
|
||||
- Firebase/RemoteConfig (8.9.0):
|
||||
- Firebase/CoreOnly
|
||||
- FirebaseRemoteConfig (~> 8.9.0)
|
||||
- firebase_analytics (8.3.3):
|
||||
- firebase_analytics (9.0.3):
|
||||
- Firebase/Analytics (= 8.9.0)
|
||||
- firebase_core
|
||||
- Flutter
|
||||
- firebase_auth (3.1.2):
|
||||
- firebase_auth (3.3.3):
|
||||
- Firebase/Auth (= 8.9.0)
|
||||
- firebase_core
|
||||
- Flutter
|
||||
- firebase_core (1.10.0):
|
||||
- firebase_core (1.10.5):
|
||||
- Firebase/CoreOnly (= 8.9.0)
|
||||
- Flutter
|
||||
- firebase_dynamic_links (2.0.10):
|
||||
- firebase_dynamic_links (4.0.2):
|
||||
- Firebase/DynamicLinks (= 8.9.0)
|
||||
- firebase_core
|
||||
- Flutter
|
||||
- firebase_in_app_messaging (0.5.0-13):
|
||||
- firebase_in_app_messaging (0.6.0-4):
|
||||
- Firebase/InAppMessaging (= 8.9.0)
|
||||
- firebase_core
|
||||
- Flutter
|
||||
- firebase_messaging (10.0.8):
|
||||
- firebase_messaging (11.2.3):
|
||||
- Firebase/Messaging (= 8.9.0)
|
||||
- firebase_core
|
||||
- Flutter
|
||||
- firebase_remote_config (0.10.0-5):
|
||||
- firebase_remote_config (1.0.2):
|
||||
- Firebase/RemoteConfig (= 8.9.0)
|
||||
- firebase_core
|
||||
- Flutter
|
||||
@ -139,12 +130,14 @@ PODS:
|
||||
- Flutter (1.0.0)
|
||||
- flutter_app_badger (0.0.1):
|
||||
- Flutter
|
||||
- flutter_facebook_auth (3.5.1):
|
||||
- FBSDKCoreKit (~> 11.2.0)
|
||||
- FBSDKLoginKit (~> 11.2.0)
|
||||
- flutter_facebook_auth (3.5.3):
|
||||
- FBSDKCoreKit (~> 12.1.0)
|
||||
- FBSDKLoginKit (~> 12.1.0)
|
||||
- Flutter
|
||||
- flutter_secure_storage (3.3.1):
|
||||
- Flutter
|
||||
- flutter_smartlook (0.0.5):
|
||||
- Flutter
|
||||
- flutter_uxcam (2.0.1):
|
||||
- Flutter
|
||||
- UXCam (~> 3.3.6)
|
||||
@ -219,14 +212,14 @@ PODS:
|
||||
- path_provider (0.0.1):
|
||||
- Flutter
|
||||
- PromisesObjC (2.0.0)
|
||||
- Purchases (3.11.1):
|
||||
- PurchasesCoreSwift (= 3.11.1)
|
||||
- purchases_flutter (3.2.2):
|
||||
- Purchases (3.13.1):
|
||||
- PurchasesCoreSwift (= 3.13.1)
|
||||
- purchases_flutter (3.8.0):
|
||||
- Flutter
|
||||
- PurchasesHybridCommon (= 1.6.3)
|
||||
- PurchasesCoreSwift (3.11.1)
|
||||
- PurchasesHybridCommon (1.6.3):
|
||||
- Purchases (= 3.11.1)
|
||||
- PurchasesHybridCommon (= 1.11.1)
|
||||
- PurchasesCoreSwift (3.13.1)
|
||||
- PurchasesHybridCommon (1.11.1):
|
||||
- Purchases (= 3.13.1)
|
||||
- Sentry (7.1.4):
|
||||
- Sentry/Core (= 7.1.4)
|
||||
- Sentry/Core (7.1.4)
|
||||
@ -240,8 +233,6 @@ PODS:
|
||||
- Flutter
|
||||
- sign_in_with_apple (0.0.1):
|
||||
- Flutter
|
||||
- smartlook (0.0.5):
|
||||
- Flutter
|
||||
- sqflite (0.0.2):
|
||||
- Flutter
|
||||
- FMDB (>= 2.7.5)
|
||||
@ -269,6 +260,7 @@ DEPENDENCIES:
|
||||
- flutter_app_badger (from `.symlinks/plugins/flutter_app_badger/ios`)
|
||||
- flutter_facebook_auth (from `.symlinks/plugins/flutter_facebook_auth/ios`)
|
||||
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
|
||||
- flutter_smartlook (from `.symlinks/plugins/flutter_smartlook/ios`)
|
||||
- flutter_uxcam (from `.symlinks/plugins/flutter_uxcam/ios`)
|
||||
- google_sign_in (from `.symlinks/plugins/google_sign_in/ios`)
|
||||
- modal_progress_hud_nsn (from `.symlinks/plugins/modal_progress_hud_nsn/ios`)
|
||||
@ -280,7 +272,6 @@ DEPENDENCIES:
|
||||
- share (from `.symlinks/plugins/share/ios`)
|
||||
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
||||
- sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`)
|
||||
- smartlook (from `.symlinks/plugins/smartlook/ios`)
|
||||
- sqflite (from `.symlinks/plugins/sqflite/ios`)
|
||||
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
||||
- video_player (from `.symlinks/plugins/video_player/ios`)
|
||||
@ -347,6 +338,8 @@ EXTERNAL SOURCES:
|
||||
:path: ".symlinks/plugins/flutter_facebook_auth/ios"
|
||||
flutter_secure_storage:
|
||||
:path: ".symlinks/plugins/flutter_secure_storage/ios"
|
||||
flutter_smartlook:
|
||||
:path: ".symlinks/plugins/flutter_smartlook/ios"
|
||||
flutter_uxcam:
|
||||
:path: ".symlinks/plugins/flutter_uxcam/ios"
|
||||
google_sign_in:
|
||||
@ -369,8 +362,6 @@ EXTERNAL SOURCES:
|
||||
:path: ".symlinks/plugins/shared_preferences/ios"
|
||||
sign_in_with_apple:
|
||||
:path: ".symlinks/plugins/sign_in_with_apple/ios"
|
||||
smartlook:
|
||||
:path: ".symlinks/plugins/smartlook/ios"
|
||||
sqflite:
|
||||
:path: ".symlinks/plugins/sqflite/ios"
|
||||
url_launcher:
|
||||
@ -386,18 +377,18 @@ SPEC CHECKSUMS:
|
||||
AppAuth: 31bcec809a638d7bd2f86ea8a52bd45f6e81e7c7
|
||||
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
|
||||
devicelocale: b22617f40038496deffba44747101255cee005b0
|
||||
FBAEMKit: 5de0a7aaa854eec69bb5be20795952a63d38a5f6
|
||||
FBSDKCoreKit: bf655f808b040ed66a72b9922911b39d703e64f4
|
||||
FBSDKCoreKit_Basics: 73ebe3a27eb688ac5b5aa7e99f68992993042115
|
||||
FBSDKLoginKit: 2e76831ef08d356b8f9150ea51cce865074ea304
|
||||
FBAEMKit: 56c0bb9b42e3747cd82b67934f0c2b19325382ea
|
||||
FBSDKCoreKit: 75368765d9c2303073145a7925dfaa9d60bcd77b
|
||||
FBSDKCoreKit_Basics: 39865aff97e5f6951a78fb3e89dc4460e35e1895
|
||||
FBSDKLoginKit: e993f97c7cc794c5da4056d8aec3c3d66033a727
|
||||
Firebase: 13d8d96499e2635428d5bf0ec675df21f95d9a95
|
||||
firebase_analytics: b4b760056b69bcb2bf0ebbbb8cf6f969921a86fe
|
||||
firebase_auth: 45e41687f7d88ce8016c1f411320911b842245d7
|
||||
firebase_core: f770e033e790657b3505f04be4cb24c482912f11
|
||||
firebase_dynamic_links: db82b85aee9c6066de135cdb4bee41e5b9e281ac
|
||||
firebase_in_app_messaging: 180fcaea83c2c0555c5c0243bc9dc2c3b3358b2a
|
||||
firebase_messaging: 51b1029537c74503e935e4ccb221da8be8cbf26e
|
||||
firebase_remote_config: 2a43c3a6d3430fedb4f9f7360acc757d4d962bff
|
||||
firebase_analytics: 022be8bd68c73ddaa23b77895e9098afa7069cfb
|
||||
firebase_auth: fe3a1deb12ebd850295344234abc15588d086baf
|
||||
firebase_core: dfcae4c150a5e24436a0b7677c470478a234d5bf
|
||||
firebase_dynamic_links: 89300b4c80fa30b03487e56b2926d3261ae47af8
|
||||
firebase_in_app_messaging: 2a9226ba7eda70506a8ddf49ce1930d21fad3b5a
|
||||
firebase_messaging: c4696ded2f44fb5c2bf6e94f9a575105793e58fa
|
||||
firebase_remote_config: b6c8f06b74e803e9d03f9aa9adc58f0720feb3f7
|
||||
FirebaseABTesting: 9de50b34bf9eb4a07d4edb7af82c14152fd905aa
|
||||
FirebaseAnalytics: 4ab446ce08a3fe52e8a4303dd997cf26276bf968
|
||||
FirebaseAuth: 2b78b2a32c07b3ecfa4970bdf1d3632b8304099b
|
||||
@ -410,11 +401,12 @@ SPEC CHECKSUMS:
|
||||
FirebaseRemoteConfig: a75c1bd44ebd3ed4ad3fa1ff09414a8b133be405
|
||||
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
|
||||
flutter_app_badger: 65de4d6f0c34a891df49e6cfb8a1c0496426fa68
|
||||
flutter_facebook_auth: 870a465b1afff3ace7a592bd44665d921991726c
|
||||
flutter_facebook_auth: dfd6b2563406c538098e2127512d385c9ffd70ad
|
||||
flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec
|
||||
flutter_smartlook: 2aa304f6a38fc22b741ca750e0078606582525ae
|
||||
flutter_uxcam: 32e4e8b4355be6bf9d512ad36aed6d86c98a5cdf
|
||||
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
||||
google_sign_in: de494e5e993986afae63e22a32441e30c35c9823
|
||||
google_sign_in: c5cecea71f3be43282263550556e311c4cc03582
|
||||
GoogleAppMeasurement: 837649ad3987936c232f6717c5680216f6243d24
|
||||
GoogleDataTransport: 629c20a4d363167143f30ea78320d5a7eb8bd940
|
||||
GoogleSignIn: 7137d297ddc022a7e0aa4619c86d72c909fa7213
|
||||
@ -427,21 +419,20 @@ SPEC CHECKSUMS:
|
||||
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
|
||||
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
|
||||
PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58
|
||||
Purchases: 6351f9ff6bd514e5ec5aa0f989ea181effa94bf5
|
||||
purchases_flutter: 627527b070d80cdaf486fabe8b3d1dbe8d5cad92
|
||||
PurchasesCoreSwift: ee857e4c21e6254b09d7e303a756fcf2b9164408
|
||||
PurchasesHybridCommon: d65a799a61d688588534b80338edbcbf604ca93d
|
||||
Purchases: 2693d6444609de044ab25fcda9561bef038f24da
|
||||
purchases_flutter: 214d452aaf860496aeee822487eafcdd962fab33
|
||||
PurchasesCoreSwift: ca55f9ef671f89abed133775dd9e53f55007828d
|
||||
PurchasesHybridCommon: a0313de4f31fbaf137518b2686ccdca4c91dd2b4
|
||||
Sentry: 1d3eb1a25f8c5333c88dd5603904a6d461cd9fcf
|
||||
sentry_flutter: f20d4f199442900fbdab2b8496f1d2091d8b94d9
|
||||
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
|
||||
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
|
||||
sign_in_with_apple: f3bf75217ea4c2c8b91823f225d70230119b8440
|
||||
smartlook: bbc5c73a85c752a31dabf100c8930838c646342e
|
||||
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
|
||||
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
|
||||
UXCam: fb294bf954e708fc308a645ae65bb967cac0760e
|
||||
video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e
|
||||
wakelock: b0843b2479edbf6504d8d262c2959446f35373aa
|
||||
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f
|
||||
webview_flutter: 9f491a9b5a66f2573946a389b2677987b0ff8c0b
|
||||
|
||||
PODFILE CHECKSUM: f10c0438b63bc24e6bbc207956dc27d16c4408f2
|
||||
|
@ -177,7 +177,7 @@
|
||||
97C146E61CF9000F007C117D /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1210;
|
||||
LastUpgradeCheck = 1300;
|
||||
ORGANIZATIONNAME = "";
|
||||
TargetAttributes = {
|
||||
97C146ED1CF9000F007C117D = {
|
||||
@ -388,7 +388,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
CURRENT_PROJECT_VERSION = 3;
|
||||
DEVELOPMENT_TEAM = SFJJBDCU6Z;
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
@ -531,7 +531,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
CURRENT_PROJECT_VERSION = 3;
|
||||
DEVELOPMENT_TEAM = SFJJBDCU6Z;
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
@ -566,7 +566,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
CURRENT_PROJECT_VERSION = 3;
|
||||
DEVELOPMENT_TEAM = SFJJBDCU6Z;
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TestProgress extends AnimatedWidget {
|
||||
|
@ -17,7 +17,6 @@ import 'package:intl/intl.dart';
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
|
||||
part 'development_by_muscle_event.dart';
|
||||
|
@ -14,9 +14,7 @@ import 'package:aitrainer_app/util/enums.dart';
|
||||
import 'package:aitrainer_app/util/track.dart';
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/animation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:stop_watch_timer/stop_watch_timer.dart';
|
||||
|
||||
part 'exercise_new_event.dart';
|
||||
|
@ -18,7 +18,6 @@ import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:aitrainer_app/library/image_cache.dart' as wt;
|
||||
|
||||
part 'menu_event.dart';
|
||||
|
@ -172,7 +172,7 @@ class SalesBloc extends Bloc<SalesEvent, SalesState> with Logging {
|
||||
try {
|
||||
productSet = int.parse(productSetString);
|
||||
} on Exception catch (e) {
|
||||
log("Define the right productset!");
|
||||
log("Define the right productset! $e");
|
||||
productSet = 2;
|
||||
}
|
||||
|
||||
|
@ -9,8 +9,6 @@ import 'package:aitrainer_app/util/track.dart';
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
//import 'package:health/health.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
part 'settings_event.dart';
|
||||
part 'settings_state.dart';
|
||||
@ -20,71 +18,31 @@ class SettingsBloc extends Bloc<SettingsEvent, SettingsState> with Logging {
|
||||
Locale? _locale;
|
||||
BuildContext? context;
|
||||
|
||||
SettingsBloc({this.context}) : super(SettingsInitial());
|
||||
|
||||
void setLocale(Locale locale) {
|
||||
_locale = locale;
|
||||
SettingsBloc({this.context}) : super(SettingsInitial()) {
|
||||
on<SettingsChangeLanguage>(_onChangeLanguage);
|
||||
on<SettingsGetLanguage>(_onGetLanguage);
|
||||
on<SettingsSetServer>(_onSetServer);
|
||||
}
|
||||
|
||||
Locale? getLocale() {
|
||||
return _locale;
|
||||
void setLocale(Locale locale) => _locale = locale;
|
||||
Locale? getLocale() => _locale;
|
||||
|
||||
void _onChangeLanguage(SettingsChangeLanguage event, Emitter<SettingsState> emit) async {
|
||||
emit(SettingsLoading());
|
||||
await _changeLang(event.language);
|
||||
emit(SettingsReady());
|
||||
}
|
||||
|
||||
@override
|
||||
Stream<SettingsState> mapEventToState(
|
||||
SettingsEvent event,
|
||||
) async* {
|
||||
if (event is SettingsChangeLanguage) {
|
||||
yield SettingsLoading();
|
||||
await _changeLang(event.language);
|
||||
yield SettingsReady();
|
||||
} else if (event is SettingsGetLanguage) {
|
||||
await AppLanguage().fetchLocale();
|
||||
_locale = AppLanguage().appLocal;
|
||||
yield SettingsReady();
|
||||
} else if (event is SettingsSetServer) {
|
||||
//yield SettingsLoading();
|
||||
final bool live = event.live;
|
||||
Cache().setServer(live);
|
||||
Track().track(TrackingEvent.settings_server, eventValue: live.toString());
|
||||
//yield SettingsReady(_locale);
|
||||
} else if (event is SettingsSetHardware) {
|
||||
yield SettingsLoading();
|
||||
|
||||
bool selectedHardwareBefore = await Cache().selectedHardwareBefore();
|
||||
log("selectedBefore " + selectedHardwareBefore.toString());
|
||||
|
||||
final bool hasHardware = event.hasHardware;
|
||||
await Cache().setHardware(hasHardware);
|
||||
if (hasHardware == true) {
|
||||
await _accessHealthData();
|
||||
}
|
||||
Cache().initBadges();
|
||||
yield SettingsReady();
|
||||
} else if (event is SettingsActivateTutorial) {
|
||||
yield SettingsLoading();
|
||||
Cache().activitiesDone[event.activity.toStr()] = false;
|
||||
print(" ----------------- Setting ${event.activity} to false");
|
||||
yield SettingsReady();
|
||||
}
|
||||
void _onGetLanguage(SettingsGetLanguage event, Emitter<SettingsState> emit) async {
|
||||
await AppLanguage().fetchLocale();
|
||||
_locale = AppLanguage().appLocal;
|
||||
emit(SettingsReady());
|
||||
}
|
||||
|
||||
Future<void> _accessHealthData() async {
|
||||
/* final List<HealthDataType> types = [
|
||||
HealthDataType.ACTIVE_ENERGY_BURNED,
|
||||
HealthDataType.WATER,
|
||||
HealthDataType.STEPS,
|
||||
HealthDataType.HEART_RATE,
|
||||
HealthDataType.BASAL_ENERGY_BURNED,
|
||||
HealthDataType.BODY_TEMPERATURE,
|
||||
HealthDataType.HIGH_HEART_RATE_EVENT,
|
||||
HealthDataType.LOW_HEART_RATE_EVENT,
|
||||
HealthDataType.RESTING_HEART_RATE
|
||||
];
|
||||
final HealthFactory health = HealthFactory(); */
|
||||
//DateTime now = DateTime.now();
|
||||
//List<HealthDataPoint> _healthDataList = await health.getHealthDataFromTypes(now.subtract(Duration(minutes: 5)), now, types);
|
||||
//log(_healthDataList.toString());
|
||||
void _onSetServer(SettingsSetServer event, Emitter<SettingsState> emit) async {
|
||||
final bool live = event.live;
|
||||
Cache().setServer(live);
|
||||
Track().track(TrackingEvent.settings_server, eventValue: live.toString());
|
||||
}
|
||||
|
||||
Future<void> _changeLang(String lang) async {
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'dart:async';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:aitrainer_app/bloc/training_plan/training_plan_bloc.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
@ -16,7 +15,9 @@ part 'training_evaluation_state.dart';
|
||||
class TrainingEvaluationBloc extends Bloc<TrainingEvaluationEvent, TrainingEvaluationState> {
|
||||
final TrainingPlanBloc trainingPlanBloc;
|
||||
final String day;
|
||||
TrainingEvaluationBloc({required this.trainingPlanBloc, required this.day}) : super(TrainingEvaluationInitial());
|
||||
TrainingEvaluationBloc({required this.trainingPlanBloc, required this.day}) : super(TrainingEvaluationInitial()) {
|
||||
on<TrainingEvaluationLoad>(_onLoad);
|
||||
}
|
||||
|
||||
String duration = "-";
|
||||
String totalLift = "0";
|
||||
@ -27,6 +28,21 @@ class TrainingEvaluationBloc extends Bloc<TrainingEvaluationEvent, TrainingEvalu
|
||||
|
||||
List<TrainingEvaluationExercise> evaluationList = [];
|
||||
|
||||
void _onLoad(TrainingEvaluationLoad event, Emitter<TrainingEvaluationState> emit) async {
|
||||
getDuration();
|
||||
getTotalLift();
|
||||
getMaxRepeats();
|
||||
getTotalRepeats();
|
||||
createEvaluationData();
|
||||
getMaxLift();
|
||||
if (end == null || DateTime.now().difference(end!).inMinutes > 5) {
|
||||
emit(TrainingEvaluationReady());
|
||||
} else {
|
||||
emit(TrainingEvaluationVictoryReady());
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@override
|
||||
Stream<TrainingEvaluationState> mapEventToState(
|
||||
TrainingEvaluationEvent event,
|
||||
@ -50,9 +66,7 @@ class TrainingEvaluationBloc extends Bloc<TrainingEvaluationEvent, TrainingEvalu
|
||||
} on Exception catch (e) {
|
||||
yield TrainingEvaluationError(message: e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> saveResult() async {}
|
||||
} */
|
||||
|
||||
void createEvaluationData() {
|
||||
if (trainingPlanBloc.getMyPlan() == null || trainingPlanBloc.getMyPlan()!.days[day] == null) {
|
||||
@ -118,11 +132,11 @@ class TrainingEvaluationBloc extends Bloc<TrainingEvaluationEvent, TrainingEvalu
|
||||
}
|
||||
|
||||
String getTrendText(double rate) {
|
||||
if (rate > 1.10) {
|
||||
if (rate > 1.20) {
|
||||
return "Strongly Growing";
|
||||
} else if (rate > 1.05) {
|
||||
return "Growing";
|
||||
} else if (rate < 0.90) {
|
||||
} else if (rate < 0.80) {
|
||||
return "Strongly Sinking";
|
||||
} else if (rate < 0.95) {
|
||||
return "Sinking";
|
||||
@ -132,11 +146,11 @@ class TrainingEvaluationBloc extends Bloc<TrainingEvaluationEvent, TrainingEvalu
|
||||
}
|
||||
|
||||
Color getTrendColor(double rate) {
|
||||
if (rate > 1.10) {
|
||||
if (rate > 1.20) {
|
||||
return Colors.green[900]!;
|
||||
} else if (rate > 1.05) {
|
||||
return Colors.green[300]!;
|
||||
} else if (rate < 0.90) {
|
||||
} else if (rate < 0.80) {
|
||||
return Colors.red[900]!;
|
||||
} else if (rate < 0.95) {
|
||||
return Colors.red[400]!;
|
||||
|
@ -18,6 +18,7 @@ part 'training_log_state.dart';
|
||||
|
||||
class TrainingLogBloc extends Bloc<TrainingLogEvent, TrainingLogState> {
|
||||
final ExerciseRepository exerciseRepository = ExerciseRepository();
|
||||
|
||||
TrainingLogBloc() : super(TrainingLogInitial()) {
|
||||
on<TrainingLogLoad>(_onLoad);
|
||||
on<TrainingLogDelete>(_onDelete);
|
||||
@ -49,6 +50,11 @@ class TrainingLogBloc extends Bloc<TrainingLogEvent, TrainingLogState> {
|
||||
emit(TrainingLogLoading());
|
||||
exerciseRepository.exerciseList!.remove(event.exercise);
|
||||
await exerciseRepository.deleteExercise(event.exercise);
|
||||
if (Cache().getExercises() != null) {
|
||||
Cache().getExercises()!.remove(event.exercise);
|
||||
}
|
||||
_results.clear();
|
||||
_results.addAll(getTrainingResults());
|
||||
Track().track(TrackingEvent.exercise_log_delete);
|
||||
emit(TrainingLogReady());
|
||||
}
|
||||
@ -119,7 +125,7 @@ class TrainingLogBloc extends Bloc<TrainingLogEvent, TrainingLogState> {
|
||||
|
||||
Color color = exercise.trainingPlanDetailsId == null ? Colors.blue : Colors.orange;
|
||||
if (exerciseTypeIdSearched == exercise.exerciseTypeId) {
|
||||
color = Colors.redAccent;
|
||||
color = Color(0xffb4f500);
|
||||
}
|
||||
|
||||
trainings.add(TrainingResult(
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'dart:async';
|
||||
import 'package:aitrainer_app/main.dart';
|
||||
import 'package:aitrainer_app/bloc/menu/menu_bloc.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
@ -29,7 +28,25 @@ part 'training_plan_state.dart';
|
||||
class TrainingPlanBloc extends Bloc<TrainingPlanEvent, TrainingPlanState> {
|
||||
final TrainingPlanRepository trainingPlanRepository;
|
||||
final MenuBloc menuBloc;
|
||||
TrainingPlanBloc({required this.trainingPlanRepository, required this.menuBloc}) : super(TrainingPlanInitial());
|
||||
TrainingPlanBloc({required this.trainingPlanRepository, required this.menuBloc}) : super(TrainingPlanInitial()) {
|
||||
on<TrainingPlanActivate>(_onActivate);
|
||||
on<TrainingPlanWeightChangeRecalculate>(_onWeightChangeRecalculate);
|
||||
on<TrainingPlanSaveExercise>(_onSaveExercise);
|
||||
on<TrainingPlanSkipExercise>(_onSkipExercise);
|
||||
on<TrainingPlanSkipEntireExercise>(_onSkipEntireExercise);
|
||||
on<TrainingPlanFinishDropset>(_onFinishDropSet);
|
||||
on<TrainingPlanFinishDay>(_onFinishDay);
|
||||
on<TrainingPlanChangeCancel>(_onChangeCancel);
|
||||
|
||||
on<TrainingPlanAddLoad>(_onCustomLoad);
|
||||
on<TrainingPlanDeleteExerciseType>(_onDeleteExerciseType);
|
||||
on<TrainingPlanWeightChange>(_onCustomWeightChange);
|
||||
on<TrainingPlanSetChange>(_onCustomPlanSetChange);
|
||||
on<TrainingPlanRepeatsChange>(_onCustomPlanRepeatChange);
|
||||
on<TrainingPlanAddExerciseType>(_onCustomPlanAddExerciseType);
|
||||
|
||||
// on<TrainingPlanError>(_onTrainingPlanError);
|
||||
}
|
||||
|
||||
CustomerTrainingPlan? _myPlan;
|
||||
CustomerTrainingPlanDetails? _myDetail;
|
||||
@ -55,264 +72,351 @@ class TrainingPlanBloc extends Bloc<TrainingPlanEvent, TrainingPlanState> {
|
||||
CustomerTrainingPlanDetails? getMyDetail() => this._myDetail;
|
||||
setMyDetail(CustomerTrainingPlanDetails? value) => this._myDetail = value;
|
||||
|
||||
/// _onActivate
|
||||
/// activating the training plan, calculating the weights to the given repeats
|
||||
/// from previous exercises
|
||||
///
|
||||
/// event: TrainingPlanActivate
|
||||
void _onActivate(TrainingPlanActivate event, Emitter<TrainingPlanState> emit) async {
|
||||
emit(TrainingPlanLoading());
|
||||
_myPlan = trainingPlanRepository.activateTrainingPlan(event.trainingPlanId);
|
||||
_myPlan!.type = CustomerTrainingPlanType.template;
|
||||
|
||||
menuBloc.menuTreeRepository.sortedTree.forEach((name, list) {
|
||||
final List<WorkoutMenuTree> menuList = list as List<WorkoutMenuTree>;
|
||||
menuList.forEach((element) {
|
||||
element.exerciseType!.trainingPlanState = ExerciseTypeTrainingPlanState.none;
|
||||
});
|
||||
});
|
||||
this.activateDays();
|
||||
Cache().myTrainingPlan = _myPlan;
|
||||
await Cache().saveMyTrainingPlan();
|
||||
Track().track(TrackingEvent.training_plan_start, eventValue: event.trainingPlanId.toString());
|
||||
emit(TrainingPlanFinished());
|
||||
}
|
||||
|
||||
void _onWeightChangeRecalculate(TrainingPlanWeightChangeRecalculate event, Emitter<TrainingPlanState> emit) async {
|
||||
emit(TrainingPlanExerciseLoading());
|
||||
|
||||
if (event.detail.baseOneRepMax > 0 && event.detail.repeats != -1) {
|
||||
if (_myTrainingPlan == null) {
|
||||
setTrainingPlanFromCache();
|
||||
}
|
||||
final int originalRepeats = trainingPlanRepository.getOriginalRepeats(_myTrainingPlan!.trainingPlanId, event.detail);
|
||||
event.detail.repeats = Common.calculateQuantityByChangedWeight(event.detail.baseOneRepMax, event.weight, originalRepeats.toDouble());
|
||||
|
||||
print("Base1RM ${event.detail.baseOneRepMax} repeats: ${event.detail.repeats}");
|
||||
if (event.detail.repeats! < 1) {
|
||||
event.detail.repeats = 1;
|
||||
event.detail.weight = trainingPlanRepository.getOriginalWeight(_myTrainingPlan!.trainingPlanId, event.detail);
|
||||
}
|
||||
ExerciseSaveStream().repeats = event.detail.repeats!;
|
||||
ExerciseSaveStream().getStreamController().add(true);
|
||||
}
|
||||
event.detail.weight = event.weight;
|
||||
|
||||
///yield TrainingPlanExerciseReady();
|
||||
emit(TrainingPlanReady());
|
||||
}
|
||||
|
||||
/// _onSaveExercise
|
||||
/// - save the executed exercise to the DB
|
||||
/// - recalculate, if necessary the next weight to the give repeats
|
||||
/// - track this event
|
||||
/// - send the data to Mautic
|
||||
/// if [DropSet], the just set the state of the detail to finish
|
||||
///
|
||||
/// event: TrainingPlanWeightChange
|
||||
void _onSaveExercise(TrainingPlanSaveExercise event, Emitter<TrainingPlanState> emit) async {
|
||||
emit(TrainingPlanLoading());
|
||||
if (event.detail.repeats == -1) {
|
||||
emit(TrainingPlanReady());
|
||||
throw Exception("Please type your repeats!");
|
||||
}
|
||||
print("SAVE for ExerciseTypeID: ${event.detail.exerciseTypeId} weight: ${event.detail.weight}");
|
||||
if (event.detail.weight == -3) {
|
||||
print("DropSet");
|
||||
event.detail.state = ExercisePlanDetailState.finished;
|
||||
emit(TrainingPlanReady());
|
||||
} else {
|
||||
final Exercise exercise = Exercise();
|
||||
exercise.customerId = Cache().userLoggedIn!.customerId!;
|
||||
exercise.exerciseTypeId = event.detail.exerciseTypeId;
|
||||
exercise.quantity = event.detail.repeats!.toDouble();
|
||||
exercise.unit = event.detail.exerciseType!.unit;
|
||||
exercise.unitQuantity = event.detail.weight;
|
||||
exercise.dateAdd = DateTime.now();
|
||||
event.detail.exercises.add(exercise);
|
||||
if (this.isAllDetailsSameExerciseFinished(event.detail)) {
|
||||
event.detail.state = ExercisePlanDetailState.finished;
|
||||
}
|
||||
|
||||
// recalculate the weight to the original planned repeats for the next details
|
||||
int id = 0;
|
||||
if (exercise.unitQuantity != null && exercise.unitQuantity! > 0) {
|
||||
for (var nextDetail in _myPlan!.details) {
|
||||
if (nextDetail.exerciseTypeId == event.detail.exerciseTypeId) {
|
||||
if (id == 0 && nextDetail.customerTrainingPlanDetailsId == event.detail.customerTrainingPlanDetailsId) {
|
||||
id = nextDetail.customerTrainingPlanDetailsId!;
|
||||
}
|
||||
double weightFromPlan = trainingPlanRepository.getOriginalWeight(this.getMyPlan()!.trainingPlanId!, nextDetail);
|
||||
print("NextDetail detail: $nextDetail *** PlanWeight: $weightFromPlan");
|
||||
if (nextDetail.weight == -2 && nextDetail.customerTrainingPlanDetailsId != event.detail.customerTrainingPlanDetailsId) {
|
||||
print("Nr 1. - recalculating -2 ${event.detail.customerTrainingPlanDetailsId}");
|
||||
trainingPlanRepository.recalculateDetail(_myPlan!.trainingPlanId!, event.detail, nextDetail);
|
||||
nextDetail.baseOneRepMax = Common.calculate1RM(nextDetail.weight!, nextDetail.repeats!.toDouble());
|
||||
} else if (weightFromPlan == -1 && nextDetail.set! > 1 && nextDetail.exercises.length == 1) {
|
||||
print("Nr 2. recalculating -1 ${event.detail.customerTrainingPlanDetailsId}");
|
||||
nextDetail = trainingPlanRepository.recalculateDetailFixRepeats(_myPlan!.trainingPlanId!, nextDetail);
|
||||
nextDetail.baseOneRepMax = Common.calculate1RM(nextDetail.weight!, nextDetail.repeats!.toDouble());
|
||||
} else if (nextDetail.weight == -1 && nextDetail.set! == 1) {
|
||||
print("Nr 3. recalculating -1, set 1 ${event.detail.customerTrainingPlanDetailsId}");
|
||||
nextDetail = trainingPlanRepository.recalculateDetailFixRepeatsSet1(_myPlan!.trainingPlanId!, nextDetail, event.detail);
|
||||
nextDetail.baseOneRepMax = Common.calculate1RM(nextDetail.weight!, nextDetail.repeats!.toDouble());
|
||||
} else if (event.detail.set! == 1 &&
|
||||
(weightFromPlan == -2 || weightFromPlan == -1) &&
|
||||
nextDetail.customerTrainingPlanDetailsId! > id) {
|
||||
print("Nr 4. recalculating after the first exercise ${event.detail.customerTrainingPlanDetailsId}");
|
||||
nextDetail = trainingPlanRepository.recalculateDetailFixRepeatsSet1(_myPlan!.trainingPlanId!, nextDetail, event.detail);
|
||||
nextDetail.baseOneRepMax = Common.calculate1RM(nextDetail.weight!, nextDetail.repeats!.toDouble());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exercise.trainingPlanDetailsId = _myPlan!.trainingPlanId;
|
||||
|
||||
// save Exercise
|
||||
Exercise savedExercise = await ExerciseApi().addExercise(exercise);
|
||||
Cache().addExercise(savedExercise);
|
||||
|
||||
Cache().myTrainingPlan = _myPlan;
|
||||
await Cache().saveMyTrainingPlan();
|
||||
}
|
||||
if (!isInDebugMode) {
|
||||
CustomerRepository customerRepository = CustomerRepository();
|
||||
customerRepository.customer = Cache().userLoggedIn;
|
||||
MauticRepository mauticRepository = MauticRepository(customerRepository: customerRepository);
|
||||
await mauticRepository.sendMauticExercise();
|
||||
}
|
||||
Track().track(TrackingEvent.training_plan_execute, eventValue: event.detail.exerciseType!.name);
|
||||
|
||||
if (isDayDone()) {
|
||||
this.add(TrainingPlanFinishDay());
|
||||
} else {
|
||||
emit(TrainingPlanReady());
|
||||
}
|
||||
}
|
||||
|
||||
void _onSkipExercise(TrainingPlanSkipExercise event, Emitter<TrainingPlanState> emit) async {
|
||||
emit(TrainingPlanLoading());
|
||||
event.detail.state = ExercisePlanDetailState.skipped;
|
||||
Cache().myTrainingPlan = _myPlan;
|
||||
await Cache().saveMyTrainingPlan();
|
||||
if (isDayDone()) {
|
||||
this.add(TrainingPlanFinishDay());
|
||||
} else {
|
||||
emit(TrainingPlanReady());
|
||||
}
|
||||
}
|
||||
|
||||
void _onSkipEntireExercise(TrainingPlanSkipEntireExercise event, Emitter<TrainingPlanState> emit) async {
|
||||
emit(TrainingPlanLoading());
|
||||
List<CustomerTrainingPlanDetails> list = getAllDetailsSameExercise(event.detail);
|
||||
list.forEach((element) {
|
||||
if (!element.state.equalsTo(ExercisePlanDetailState.finished)) {
|
||||
element.state = ExercisePlanDetailState.skipped;
|
||||
}
|
||||
Cache().myTrainingPlan = _myPlan;
|
||||
});
|
||||
await Cache().saveMyTrainingPlan();
|
||||
if (isDayDone()) {
|
||||
this.add(TrainingPlanFinishDay());
|
||||
} else {
|
||||
emit(TrainingPlanReady());
|
||||
}
|
||||
}
|
||||
|
||||
void _onFinishDropSet(TrainingPlanFinishDropset event, Emitter<TrainingPlanState> emit) async {
|
||||
emit(TrainingPlanLoading());
|
||||
event.detail.state = ExercisePlanDetailState.finished;
|
||||
emit(TrainingPlanReady());
|
||||
}
|
||||
|
||||
void _onFinishDay(TrainingPlanFinishDay event, Emitter<TrainingPlanState> emit) async {
|
||||
emit(TrainingPlanLoading());
|
||||
celebrating = true;
|
||||
Track().track(TrackingEvent.training_plan_finished);
|
||||
emit(TrainingPlanDayFinished());
|
||||
}
|
||||
|
||||
void _onChangeCancel(TrainingPlanChangeCancel event, Emitter<TrainingPlanState> emit) async {
|
||||
emit(TrainingPlanLoading());
|
||||
print("Backup $_backupDetail");
|
||||
if (_backupDetail != null) {
|
||||
event.detail.repeats = _backupDetail!.repeats;
|
||||
event.detail.weight = _backupDetail!.weight;
|
||||
}
|
||||
emit(TrainingPlanReady());
|
||||
}
|
||||
|
||||
void _onCustomLoad(TrainingPlanAddLoad event, Emitter<TrainingPlanState> emit) async {
|
||||
emit(TrainingPlanLoading());
|
||||
addNewPlan();
|
||||
|
||||
_myDetail = CustomerTrainingPlanDetails();
|
||||
_myDetail!.exerciseType = event.exerciseType;
|
||||
_myDetail!.exerciseTypeId = event.exerciseType.exerciseTypeId;
|
||||
_myDetail!.repeats = 12;
|
||||
_myDetail!.weight = 30;
|
||||
_myDetail!.set = 3;
|
||||
_myDetail!.parallel = false;
|
||||
_myDetail!.day = "";
|
||||
_myDetail!.restingTime = 2;
|
||||
_myDetail!.state = ExercisePlanDetailState.start;
|
||||
|
||||
if (_myDetail!.exerciseType!.unitQuantityUnit != null) {
|
||||
_myDetail = trainingPlanRepository.getCalculatedWeightRepeats(event.exerciseType.exerciseTypeId, _myDetail!);
|
||||
} else {
|
||||
_myDetail!.weight = 0;
|
||||
}
|
||||
Track().track(TrackingEvent.training_plan_custom, eventValue: event.exerciseType.name);
|
||||
emit(TrainingPlanReady());
|
||||
}
|
||||
|
||||
void _onDeleteExerciseType(TrainingPlanDeleteExerciseType event, Emitter<TrainingPlanState> emit) async {
|
||||
if (_myPlan == null || _myPlan!.details.isEmpty) {
|
||||
throw Exception("No MyPlan");
|
||||
}
|
||||
emit(TrainingPlanLoading());
|
||||
CustomerTrainingPlanDetails? remove;
|
||||
for (var detail in _myPlan!.details) {
|
||||
if (event.exerciseType.exerciseTypeId == detail.exerciseTypeId) {
|
||||
remove = detail;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (remove != null) {
|
||||
_myPlan!.details.remove(remove);
|
||||
}
|
||||
event.exerciseType.trainingPlanState = ExerciseTypeTrainingPlanState.none;
|
||||
emit(TrainingPlanReady());
|
||||
}
|
||||
|
||||
/// _onWeightChange
|
||||
/// change the weight of the actual [CustomerTrainingPlanDetails] from the UI
|
||||
///
|
||||
/// event: TrainingPlanWeightChange
|
||||
void _onCustomWeightChange(TrainingPlanWeightChange event, Emitter<TrainingPlanState> emit) async {
|
||||
emit(TrainingPlanExerciseLoading());
|
||||
event.detail.weight = event.weight;
|
||||
|
||||
emit(TrainingPlanExerciseReady());
|
||||
emit(TrainingPlanReady());
|
||||
}
|
||||
|
||||
void _onCustomPlanSetChange(TrainingPlanSetChange event, Emitter<TrainingPlanState> emit) async {
|
||||
emit(TrainingPlanLoading());
|
||||
event.detail.set = event.set;
|
||||
emit(TrainingPlanReady());
|
||||
}
|
||||
|
||||
void _onCustomPlanRepeatChange(TrainingPlanRepeatsChange event, Emitter<TrainingPlanState> emit) async {
|
||||
emit(TrainingPlanLoading());
|
||||
event.detail.repeats = event.repeats;
|
||||
emit(TrainingPlanReady());
|
||||
}
|
||||
|
||||
void _onCustomPlanAddExerciseType(TrainingPlanAddExerciseType event, Emitter<TrainingPlanState> emit) async {
|
||||
if (_myDetail == null) {
|
||||
throw Exception("Create new Detail");
|
||||
}
|
||||
emit(TrainingPlanLoading());
|
||||
_myDetail!.exerciseType!.trainingPlanState = ExerciseTypeTrainingPlanState.added;
|
||||
_myPlan!.details.add(this._myDetail!);
|
||||
emit(TrainingPlanReady());
|
||||
}
|
||||
/*
|
||||
@override
|
||||
Stream<TrainingPlanState> mapEventToState(TrainingPlanEvent event) async* {
|
||||
try {
|
||||
if (event is TrainingPlanActivate) {
|
||||
yield TrainingPlanLoading();
|
||||
_myPlan = trainingPlanRepository.activateTrainingPlan(event.trainingPlanId);
|
||||
_myPlan!.type = CustomerTrainingPlanType.template;
|
||||
|
||||
menuBloc.menuTreeRepository.sortedTree.forEach((name, list) {
|
||||
final List<WorkoutMenuTree> menuList = list as List<WorkoutMenuTree>;
|
||||
menuList.forEach((element) {
|
||||
element.exerciseType!.trainingPlanState = ExerciseTypeTrainingPlanState.none;
|
||||
});
|
||||
});
|
||||
this.activateDays();
|
||||
Cache().myTrainingPlan = _myPlan;
|
||||
await Cache().saveMyTrainingPlan();
|
||||
Track().track(TrackingEvent.training_plan_start, eventValue: event.trainingPlanId.toString());
|
||||
yield TrainingPlanFinished();
|
||||
} else if (event is TrainingPlanWeightChange) {
|
||||
yield TrainingPlanExerciseLoading();
|
||||
print("New weight: ${event.weight}");
|
||||
event.detail.weight = event.weight;
|
||||
|
||||
yield TrainingPlanExerciseReady();
|
||||
yield TrainingPlanReady();
|
||||
} else if (event is TrainingPlanWeightChangeUp) {
|
||||
yield TrainingPlanExerciseLoading();
|
||||
if (event.detail.weight != null) {
|
||||
event.detail.repeats =
|
||||
Common.reCalculateRepeatsByChangedWeight(event.detail.weight!, event.detail.repeats!.toDouble(), event.detail.weight! + 1);
|
||||
event.detail.weight = event.detail.weight! + 1;
|
||||
ExerciseSaveStream().weight = event.detail.weight!;
|
||||
ExerciseSaveStream().repeats = event.detail.repeats!;
|
||||
ExerciseSaveStream().getStreamController().add(true);
|
||||
}
|
||||
} else if (event is TrainingPlanWeightChangeRecalculate) {
|
||||
|
||||
yield TrainingPlanExerciseReady();
|
||||
yield TrainingPlanReady();
|
||||
} else if (event is TrainingPlanWeightChangeDown) {
|
||||
yield TrainingPlanExerciseLoading();
|
||||
if (event.detail.weight != null) {
|
||||
event.detail.repeats =
|
||||
Common.reCalculateRepeatsByChangedWeight(event.detail.weight!, event.detail.repeats!.toDouble(), event.detail.weight! - 1);
|
||||
event.detail.weight = event.detail.weight! - 1;
|
||||
ExerciseSaveStream().weight = event.detail.weight!;
|
||||
ExerciseSaveStream().repeats = event.detail.repeats!;
|
||||
ExerciseSaveStream().getStreamController().add(true);
|
||||
}
|
||||
|
||||
yield TrainingPlanExerciseReady();
|
||||
yield TrainingPlanReady();
|
||||
} else if (event is TrainingPlanWeightChangeRecalculate) {
|
||||
yield TrainingPlanExerciseLoading();
|
||||
|
||||
if (event.detail.baseOneRepMax > 0 && event.detail.repeats != -1) {
|
||||
if (_myTrainingPlan == null) {
|
||||
setTrainingPlanFromCache();
|
||||
}
|
||||
final int originalRepeats = trainingPlanRepository.getOriginalRepeats(_myTrainingPlan!.trainingPlanId, event.detail);
|
||||
event.detail.repeats =
|
||||
Common.calculateQuantityByChangedWeight(event.detail.baseOneRepMax, event.weight, originalRepeats.toDouble());
|
||||
|
||||
print("Base1RM ${event.detail.baseOneRepMax} repeats: ${event.detail.repeats}");
|
||||
if (event.detail.repeats! < 1) {
|
||||
event.detail.repeats = 1;
|
||||
event.detail.weight = trainingPlanRepository.getOriginalWeight(_myTrainingPlan!.trainingPlanId, event.detail);
|
||||
}
|
||||
ExerciseSaveStream().repeats = event.detail.repeats!;
|
||||
ExerciseSaveStream().getStreamController().add(true);
|
||||
}
|
||||
event.detail.weight = event.weight;
|
||||
yield TrainingPlanExerciseReady();
|
||||
yield TrainingPlanReady();
|
||||
} else if (event is TrainingPlanRepeatsChange) {
|
||||
yield TrainingPlanExerciseLoading();
|
||||
|
||||
event.detail.repeats = event.repeats;
|
||||
yield TrainingPlanExerciseReady();
|
||||
yield TrainingPlanReady();
|
||||
} else if (event is TrainingPlanSetChange) {
|
||||
yield TrainingPlanLoading();
|
||||
|
||||
event.detail.set = event.set;
|
||||
|
||||
yield TrainingPlanReady();
|
||||
} else if (event is TrainingPlanSaveExercise) {
|
||||
yield TrainingPlanLoading();
|
||||
if (event.detail.repeats == -1) {
|
||||
yield TrainingPlanReady();
|
||||
throw Exception("Please type your repeats!");
|
||||
}
|
||||
print("SAVE for ExerciseTypeID: ${event.detail.exerciseTypeId} weight: ${event.detail.weight}");
|
||||
if (event.detail.weight == -3) {
|
||||
print("DropSet");
|
||||
event.detail.state = ExercisePlanDetailState.finished;
|
||||
yield TrainingPlanReady();
|
||||
} else {
|
||||
final Exercise exercise = Exercise();
|
||||
exercise.customerId = Cache().userLoggedIn!.customerId!;
|
||||
exercise.exerciseTypeId = event.detail.exerciseTypeId;
|
||||
exercise.quantity = event.detail.repeats!.toDouble();
|
||||
exercise.unit = event.detail.exerciseType!.unit;
|
||||
exercise.unitQuantity = event.detail.weight;
|
||||
exercise.dateAdd = DateTime.now();
|
||||
event.detail.exercises.add(exercise);
|
||||
if (this.isAllDetailsSameExerciseFinished(event.detail)) {
|
||||
event.detail.state = ExercisePlanDetailState.finished;
|
||||
}
|
||||
// recalculate the weight to the original planned repeats for the next details
|
||||
if (exercise.unitQuantity != null && exercise.unitQuantity! > 0) {
|
||||
for (var nextDetail in _myPlan!.details) {
|
||||
double weightFromPlan = trainingPlanRepository.getOriginalWeight(this.getMyPlan()!.trainingPlanId!, nextDetail);
|
||||
print("NextDetail detail: $nextDetail *** PlanWeight: $weightFromPlan");
|
||||
if (nextDetail.exerciseTypeId == event.detail.exerciseTypeId &&
|
||||
nextDetail.weight == -2 &&
|
||||
nextDetail.customerTrainingPlanDetailsId != event.detail.customerTrainingPlanDetailsId) {
|
||||
print("recalculating -2 ${event.detail.customerTrainingPlanDetailsId}");
|
||||
trainingPlanRepository.recalculateDetail(_myPlan!.trainingPlanId!, event.detail, nextDetail);
|
||||
nextDetail.baseOneRepMax = Common.calculate1RM(nextDetail.weight!, nextDetail.repeats!.toDouble());
|
||||
} else if (nextDetail.exerciseTypeId == event.detail.exerciseTypeId && weightFromPlan == -1 && nextDetail.set! > 1) {
|
||||
print("recalculating -1 ${event.detail.customerTrainingPlanDetailsId}");
|
||||
nextDetail = trainingPlanRepository.recalculateDetailFixRepeats(_myPlan!.trainingPlanId!, nextDetail);
|
||||
nextDetail.baseOneRepMax = Common.calculate1RM(nextDetail.weight!, nextDetail.repeats!.toDouble());
|
||||
} else if (nextDetail.exerciseTypeId == event.detail.exerciseTypeId && nextDetail.weight == -1 && nextDetail.set! == 1) {
|
||||
print("recalculating -1, set 1 ${event.detail.customerTrainingPlanDetailsId}");
|
||||
nextDetail = trainingPlanRepository.recalculateDetailFixRepeatsSet1(_myPlan!.trainingPlanId!, nextDetail, event.detail);
|
||||
nextDetail.baseOneRepMax = Common.calculate1RM(nextDetail.weight!, nextDetail.repeats!.toDouble());
|
||||
} /* else if (nextDetail.exerciseTypeId == event.detail.exerciseTypeId &&
|
||||
weightFromPlan == -2 &&
|
||||
nextDetail.set! == 1 &&
|
||||
nextDetail.exercises.length == 0) {
|
||||
print("recalculating -1/ no exercise, set 1 ${event.detail.customerTrainingPlanDetailsId}");
|
||||
nextDetail = trainingPlanRepository.recalculateDetailFixRepeatsSet1(_myPlan!.trainingPlanId!, nextDetail, event.detail);
|
||||
nextDetail.baseOneRepMax = Common.calculate1RM(nextDetail.weight!, nextDetail.repeats!.toDouble());
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
exercise.trainingPlanDetailsId = _myPlan!.trainingPlanId;
|
||||
|
||||
// save Exercise
|
||||
Exercise savedExercise = await ExerciseApi().addExercise(exercise);
|
||||
Cache().addExercise(savedExercise);
|
||||
|
||||
Cache().myTrainingPlan = _myPlan;
|
||||
await Cache().saveMyTrainingPlan();
|
||||
}
|
||||
if (!isInDebugMode) {
|
||||
CustomerRepository customerRepository = CustomerRepository();
|
||||
customerRepository.customer = Cache().userLoggedIn;
|
||||
MauticRepository mauticRepository = MauticRepository(customerRepository: customerRepository);
|
||||
await mauticRepository.sendMauticExercise();
|
||||
}
|
||||
Track().track(TrackingEvent.training_plan_execute, eventValue: event.detail.exerciseType!.name);
|
||||
|
||||
if (isDayDone()) {
|
||||
this.add(TrainingPlanFinishDay());
|
||||
} else {
|
||||
yield TrainingPlanReady();
|
||||
}
|
||||
} else if (event is TrainingPlanSkipExercise) {
|
||||
yield TrainingPlanLoading();
|
||||
event.detail.state = ExercisePlanDetailState.skipped;
|
||||
Cache().myTrainingPlan = _myPlan;
|
||||
await Cache().saveMyTrainingPlan();
|
||||
if (isDayDone()) {
|
||||
this.add(TrainingPlanFinishDay());
|
||||
} else {
|
||||
yield TrainingPlanReady();
|
||||
}
|
||||
|
||||
} else if (event is TrainingPlanSkipEntireExercise) {
|
||||
yield TrainingPlanLoading();
|
||||
List<CustomerTrainingPlanDetails> list = getAllDetailsSameExercise(event.detail);
|
||||
list.forEach((element) {
|
||||
if (!element.state.equalsTo(ExercisePlanDetailState.finished)) {
|
||||
element.state = ExercisePlanDetailState.skipped;
|
||||
}
|
||||
Cache().myTrainingPlan = _myPlan;
|
||||
});
|
||||
await Cache().saveMyTrainingPlan();
|
||||
if (isDayDone()) {
|
||||
this.add(TrainingPlanFinishDay());
|
||||
} else {
|
||||
yield TrainingPlanReady();
|
||||
}
|
||||
|
||||
} else if (event is TrainingPlanFinishDay) {
|
||||
yield TrainingPlanLoading();
|
||||
celebrating = true;
|
||||
Track().track(TrackingEvent.training_plan_finished);
|
||||
yield TrainingPlanDayFinished();
|
||||
|
||||
} else if (event is TrainingPlanGoToRestart) {
|
||||
yield TrainingPlanLoading();
|
||||
restarting = true;
|
||||
yield TrainingPlanDayReadyToRestart();
|
||||
} else if (event is TrainingPlanAddExerciseType) {
|
||||
if (_myDetail == null) {
|
||||
throw Exception("Create new Detail");
|
||||
}
|
||||
yield TrainingPlanLoading();
|
||||
_myDetail!.exerciseType!.trainingPlanState = ExerciseTypeTrainingPlanState.added;
|
||||
_myPlan!.details.add(this._myDetail!);
|
||||
yield TrainingPlanReady();
|
||||
|
||||
} else if (event is TrainingPlanDeleteExerciseType) {
|
||||
if (_myPlan == null || _myPlan!.details.isEmpty) {
|
||||
throw Exception("No MyPlan");
|
||||
}
|
||||
yield TrainingPlanLoading();
|
||||
CustomerTrainingPlanDetails? remove;
|
||||
for (var detail in _myPlan!.details) {
|
||||
if (event.exerciseType.exerciseTypeId == detail.exerciseTypeId) {
|
||||
remove = detail;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (remove != null) {
|
||||
_myPlan!.details.remove(remove);
|
||||
}
|
||||
event.exerciseType.trainingPlanState = ExerciseTypeTrainingPlanState.none;
|
||||
yield TrainingPlanReady();
|
||||
|
||||
} else if (event is TrainingPlanCustomAddLoad) {
|
||||
yield TrainingPlanLoading();
|
||||
addNewPlan();
|
||||
|
||||
_myDetail = CustomerTrainingPlanDetails();
|
||||
_myDetail!.exerciseType = event.exerciseType;
|
||||
_myDetail!.exerciseTypeId = event.exerciseType.exerciseTypeId;
|
||||
_myDetail!.repeats = 12;
|
||||
_myDetail!.weight = 30;
|
||||
_myDetail!.set = 3;
|
||||
_myDetail!.parallel = false;
|
||||
_myDetail!.day = "";
|
||||
_myDetail!.restingTime = 2;
|
||||
_myDetail!.state = ExercisePlanDetailState.start;
|
||||
|
||||
if (_myDetail!.exerciseType!.unitQuantityUnit != null) {
|
||||
_myDetail = trainingPlanRepository.getCalculatedWeightRepeats(event.exerciseType.exerciseTypeId, _myDetail!);
|
||||
} else {
|
||||
_myDetail!.weight = 0;
|
||||
}
|
||||
Track().track(TrackingEvent.training_plan_custom, eventValue: event.exerciseType.name);
|
||||
yield TrainingPlanReady();
|
||||
} else if (event is TrainingPlanChangeCancel) {
|
||||
yield TrainingPlanLoading();
|
||||
print("Backup $_backupDetail");
|
||||
if (_backupDetail != null) {
|
||||
event.detail.repeats = _backupDetail!.repeats;
|
||||
event.detail.weight = _backupDetail!.weight;
|
||||
}
|
||||
yield TrainingPlanReady();
|
||||
|
||||
} else if (event is TrainingPlanFinishDropset) {
|
||||
yield TrainingPlanLoading();
|
||||
event.detail.state = ExercisePlanDetailState.finished;
|
||||
yield TrainingPlanReady();
|
||||
|
||||
}
|
||||
} on Exception catch (e) {
|
||||
yield TrainingPlanError(message: e.toString());
|
||||
}
|
||||
} */
|
||||
|
||||
CustomerTrainingPlanDetails? createDetailFromExerciseType(ExerciseType exerciseType, CustomerTrainingPlanDetails origDetail) {
|
||||
List<CustomerTrainingPlanDetails> list = [];
|
||||
int index = 0;
|
||||
TrainingPlanDetail? trainingPlanDetail;
|
||||
if (_myTrainingPlan == null) {
|
||||
setTrainingPlanFromCache();
|
||||
}
|
||||
for (var planDetail in _myTrainingPlan!.details!) {
|
||||
if (planDetail.exerciseTypeId == origDetail.exerciseTypeId!) {
|
||||
trainingPlanDetail = planDetail;
|
||||
break;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if (trainingPlanDetail != null) {
|
||||
list =
|
||||
trainingPlanRepository.createDetail(_myPlan!, trainingPlanDetail, exerciseType.exerciseTypeId, index, changeExerciseType: true);
|
||||
|
||||
List<int> deleteIndicies = [];
|
||||
index = 0;
|
||||
_myPlan!.details.forEach((element) {
|
||||
if (element.exerciseTypeId == origDetail.exerciseTypeId) {
|
||||
deleteIndicies.add(index);
|
||||
}
|
||||
index++;
|
||||
});
|
||||
|
||||
index = 0;
|
||||
deleteIndicies.forEach((i) {
|
||||
_myPlan!.details.removeAt(i - index);
|
||||
index++;
|
||||
});
|
||||
_myPlan!.details.insertAll(deleteIndicies[0], list);
|
||||
}
|
||||
if (list.length > 0) {
|
||||
return list[0];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
void backupDetail(CustomerTrainingPlanDetails detail) {
|
||||
@ -380,7 +484,8 @@ class TrainingPlanBloc extends Bloc<TrainingPlanEvent, TrainingPlanState> {
|
||||
}
|
||||
|
||||
if (isDone100Percent()) {
|
||||
this.add(TrainingPlanGoToRestart());
|
||||
//this.add(TrainingPlanGoToRestart());
|
||||
print("---------------- TrainingPlanGoToRestart");
|
||||
}
|
||||
dayNames.clear();
|
||||
_myPlan!.days.clear();
|
||||
@ -556,20 +661,29 @@ class TrainingPlanBloc extends Bloc<TrainingPlanEvent, TrainingPlanState> {
|
||||
int getStep(CustomerTrainingPlanDetails detail) {
|
||||
List<CustomerTrainingPlanDetails> details = getAllDetailsSameExercise(detail);
|
||||
int step = 0;
|
||||
int indexElement = 0;
|
||||
details.forEach((element) {
|
||||
if (indexElement == 0) {
|
||||
if (element.exercises.length < element.set! && element.exercises.length > 0) {
|
||||
step = element.exercises.length;
|
||||
} else {
|
||||
step += element.exercises.length;
|
||||
}
|
||||
indexElement++;
|
||||
});
|
||||
|
||||
step++;
|
||||
//print("STEP: $step ");
|
||||
return step;
|
||||
}
|
||||
|
||||
int getHighlightStep(CustomerTrainingPlanDetails detail) {
|
||||
List<CustomerTrainingPlanDetails> details = getAllDetailsSameExercise(detail);
|
||||
int step = 0;
|
||||
details.forEach((element) {
|
||||
//print("Highlight element $element");
|
||||
if (element.exercises.length >= element.set!) {
|
||||
step++;
|
||||
}
|
||||
});
|
||||
//print("Highlight step: $step ");
|
||||
return step;
|
||||
}
|
||||
|
||||
CustomerTrainingPlanDetails? getNext() {
|
||||
if (_myPlan == null || _myPlan!.details.isEmpty) {
|
||||
return null;
|
||||
@ -655,8 +769,8 @@ class TrainingPlanBloc extends Bloc<TrainingPlanEvent, TrainingPlanState> {
|
||||
}
|
||||
prev = detail;
|
||||
}
|
||||
int index = indexInStart > indexInProgress ? indexInStart : indexInProgress;
|
||||
offset = (index) * 300;
|
||||
double index = indexInStart > indexInProgress ? indexInStart.toDouble() : indexInProgress.toDouble();
|
||||
offset = 325 * index;
|
||||
print("Offset: $offset day: $day ($indexInStart, $indexInProgress)");
|
||||
return offset;
|
||||
}
|
||||
@ -706,7 +820,8 @@ class TrainingPlanBloc extends Bloc<TrainingPlanEvent, TrainingPlanState> {
|
||||
|
||||
if (activeDayIndex >= dayNames.length) {
|
||||
activeDayIndex = 0;
|
||||
this.add(TrainingPlanGoToRestart());
|
||||
//this.add(TrainingPlanGoToRestart());
|
||||
print("---------------- TrainingPlanGoToRestart");
|
||||
}
|
||||
print("ActiveDayIndex $activeDayIndex");
|
||||
return activeDayIndex;
|
||||
|
@ -119,20 +119,13 @@ class TrainingPlanChangeCancel extends TrainingPlanEvent {
|
||||
List<Object> get props => [detail];
|
||||
}
|
||||
|
||||
class TrainingPlanDeleteExerciseType extends TrainingPlanEvent {
|
||||
class TrainingPlanAlternateChange extends TrainingPlanEvent {
|
||||
final int index;
|
||||
final ExerciseType exerciseType;
|
||||
const TrainingPlanDeleteExerciseType({required this.exerciseType});
|
||||
const TrainingPlanAlternateChange({required this.index, required this.exerciseType});
|
||||
|
||||
@override
|
||||
List<Object> get props => [exerciseType];
|
||||
}
|
||||
|
||||
class TrainingPlanCustomAddLoad extends TrainingPlanEvent {
|
||||
final ExerciseType exerciseType;
|
||||
const TrainingPlanCustomAddLoad({required this.exerciseType});
|
||||
|
||||
@override
|
||||
List<Object> get props => [exerciseType];
|
||||
List<Object> get props => [index, exerciseType];
|
||||
}
|
||||
|
||||
class TrainingPlanFinishDropset extends TrainingPlanEvent {
|
||||
@ -142,3 +135,19 @@ class TrainingPlanFinishDropset extends TrainingPlanEvent {
|
||||
@override
|
||||
List<Object> get props => [detail];
|
||||
}
|
||||
|
||||
class TrainingPlanAddLoad extends TrainingPlanEvent {
|
||||
final ExerciseType exerciseType;
|
||||
const TrainingPlanAddLoad({required this.exerciseType});
|
||||
|
||||
@override
|
||||
List<Object> get props => [exerciseType];
|
||||
}
|
||||
|
||||
class TrainingPlanDeleteExerciseType extends TrainingPlanEvent {
|
||||
final ExerciseType exerciseType;
|
||||
const TrainingPlanDeleteExerciseType({required this.exerciseType});
|
||||
|
||||
@override
|
||||
List<Object> get props => [exerciseType];
|
||||
}
|
||||
|
@ -2,9 +2,7 @@ library dropdown_search;
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
import 'popup_menu.dart';
|
||||
import 'select_dialog.dart';
|
||||
|
@ -3,7 +3,6 @@ import 'dart:async';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
const Duration _kMenuDuration = Duration(milliseconds: 300);
|
||||
const double _kMenuCloseIntervalEnd = 2.0 / 3.0;
|
||||
|
@ -8,7 +8,6 @@ import 'dart:collection' show Queue;
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:vector_math/vector_math_64.dart' show Vector3;
|
||||
|
||||
const double _kActiveFontSize = 14.0;
|
||||
|
@ -1,6 +1,5 @@
|
||||
library flutter_radar_chart;
|
||||
|
||||
import 'dart:ui';
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
@ -2,7 +2,6 @@ import 'dart:math';
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
enum TooltipDirection { up, down, left, right }
|
||||
enum ShowCloseButton { inside, outside, none }
|
||||
|
@ -1,3 +1,5 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'package:aitrainer_app/bloc/test_set_execute/test_set_execute_bloc.dart';
|
||||
@ -46,18 +48,16 @@ import 'package:aitrainer_app/view/training_plan_exercise.dart';
|
||||
import 'package:aitrainer_app/widgets/home.dart';
|
||||
import 'package:aitrainer_app/library/facebook_app_events/facebook_app_events.dart';
|
||||
import 'package:firebase_analytics/firebase_analytics.dart';
|
||||
import 'package:firebase_analytics/observer.dart';
|
||||
//import 'package:flurry_data/flurry_data.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:aitrainer_app/util/app_localization.dart';
|
||||
import 'package:flutter_uxcam/flutter_uxcam.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||
import 'package:smartlook/smartlook.dart';
|
||||
import 'package:flutter_smartlook/flutter_smartlook.dart';
|
||||
import 'package:upgrader/upgrader.dart';
|
||||
import 'bloc/account/account_bloc.dart';
|
||||
import 'bloc/body_development/body_development_bloc.dart';
|
||||
@ -144,6 +144,13 @@ Future<Null> main() async {
|
||||
},
|
||||
);
|
||||
}
|
||||
Future<void> initThirdParty() async {
|
||||
if (!isInDebugMode) {
|
||||
//await FlurryData.initialize(androidKey: "JNYCTCWBT34FM3J8TV36", iosKey: "3QBG7BSMGPDH24S8TRQP", enableLog: true);
|
||||
FlutterUxcam.optIntoSchematicRecordings();
|
||||
}
|
||||
await FirebaseApi().initializeFlutterFire();
|
||||
}
|
||||
|
||||
final WorkoutTreeRepository menuTreeRepository = WorkoutTreeRepository();
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
@ -152,7 +159,11 @@ Future<Null> main() async {
|
||||
|
||||
SetupOptions options = (new SetupOptionsBuilder('682883e5cd71a46160c4f6ed070530ee593f49c6')).build();
|
||||
Smartlook.setupAndStartRecording(options);
|
||||
Smartlook.setEventTrackingMode(EventTrackingMode.FULL_TRACKING);
|
||||
}
|
||||
await initThirdParty();
|
||||
final FirebaseAnalytics analytics = FirebaseAnalytics.instance;
|
||||
;
|
||||
|
||||
print(" -- FireBase init..");
|
||||
|
||||
@ -192,27 +203,22 @@ Future<Null> main() async {
|
||||
return TrainingPlanBloc(menuBloc: menuBloc, trainingPlanRepository: TrainingPlanRepository());
|
||||
}),
|
||||
],
|
||||
child: WorkoutTestApp(),
|
||||
child: WorkoutTestApp(analytics: analytics),
|
||||
));
|
||||
}, (error, stackTrace) async {
|
||||
await _reportError(error, stackTrace);
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> initThirdParty() async {
|
||||
if (!isInDebugMode) {
|
||||
//await FlurryData.initialize(androidKey: "JNYCTCWBT34FM3J8TV36", iosKey: "3QBG7BSMGPDH24S8TRQP", enableLog: true);
|
||||
FlutterUxcam.optIntoSchematicRecordings();
|
||||
}
|
||||
await FirebaseApi().initializeFlutterFire();
|
||||
}
|
||||
|
||||
class WorkoutTestApp extends StatelessWidget {
|
||||
final FirebaseAnalytics analytics;
|
||||
|
||||
const WorkoutTestApp({required this.analytics});
|
||||
|
||||
static final facebookAppEvents = FacebookAppEvents();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
final FirebaseAnalytics analytics = FirebaseAnalytics();
|
||||
|
||||
// Only call clearSavedSettings() during testing to reset internal values.
|
||||
Upgrader().clearSavedSettings(); // REMOVE this for release builds
|
||||
@ -225,7 +231,6 @@ class WorkoutTestApp extends StatelessWidget {
|
||||
// valid identifier already in the App Store.
|
||||
|
||||
//facebookAppEvents.setAdvertiserTracking(enabled: true);
|
||||
initThirdParty();
|
||||
|
||||
return MaterialApp(
|
||||
localizationsDelegates: [
|
||||
|
@ -38,7 +38,7 @@ import 'package:package_info/package_info.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:aitrainer_app/model/exercise_type.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:smartlook/smartlook.dart';
|
||||
import 'package:flutter_smartlook/flutter_smartlook.dart';
|
||||
|
||||
import 'customer_exercise_device.dart';
|
||||
import 'exercise_device.dart';
|
||||
|
@ -150,5 +150,13 @@ class CustomerTrainingPlanDetails {
|
||||
this.day = from.day;
|
||||
this.dayId = from.dayId;
|
||||
this.baseOneRepMax = from.baseOneRepMax;
|
||||
if (from.exercises.length == 0) {
|
||||
this.exercises = [];
|
||||
}
|
||||
if (from.alternatives.length > 0) {
|
||||
from.alternatives.forEach((alternative) {
|
||||
this.alternatives.add(alternative);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -257,6 +257,12 @@ class CustomerRepository with Logging {
|
||||
Future<void> saveCustomer() async {
|
||||
if (this.customer == null) throw Exception("Initialize the customer object");
|
||||
final Customer modelCustomer = customer!;
|
||||
if (modelCustomer.sex == null) {
|
||||
modelCustomer.sex = "m";
|
||||
}
|
||||
if (modelCustomer.fitnessLevel == null) {
|
||||
modelCustomer.fitnessLevel = "beginner";
|
||||
}
|
||||
await CustomerApi().saveCustomer(modelCustomer);
|
||||
await this.saveProperties(modelCustomer.properties);
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import 'package:aitrainer_app/model/evaluation.dart';
|
||||
import 'package:aitrainer_app/model/evaluation_attribute.dart';
|
||||
import 'package:aitrainer_app/util/enums.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class EvaluationRepository {
|
||||
List<Evaluation>? evaluations;
|
||||
|
@ -166,7 +166,7 @@ class ExercisePlanRepository {
|
||||
if (exercisePlan == null) {
|
||||
this.createNewPlan();
|
||||
}
|
||||
;
|
||||
|
||||
Cache().setMyExercisePlan(exercisePlan!);
|
||||
return exercisePlan;
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import 'package:aitrainer_app/model/exercise_plan_detail.dart';
|
||||
import 'package:aitrainer_app/model/exercise_tree.dart';
|
||||
import 'package:aitrainer_app/model/fitness_state.dart';
|
||||
import 'package:aitrainer_app/model/training_plan.dart';
|
||||
import 'package:aitrainer_app/model/training_plan_detail.dart';
|
||||
import 'package:aitrainer_app/repository/training_plan_day_repository.dart';
|
||||
import 'package:aitrainer_app/util/app_language.dart';
|
||||
import 'package:aitrainer_app/util/common.dart';
|
||||
@ -69,9 +70,13 @@ class TrainingPlanRepository {
|
||||
|
||||
// 3 calculate weights
|
||||
int index = 0;
|
||||
|
||||
int exerciseTypeIdOrig = 0;
|
||||
trainingPlan.details!.forEach((elem) {
|
||||
CustomerTrainingPlanDetails detail = CustomerTrainingPlanDetails();
|
||||
List<CustomerTrainingPlanDetails> list = createDetail(plan, elem, exerciseTypeIdOrig, index);
|
||||
list.forEach((element) {
|
||||
plan.details.add(element);
|
||||
});
|
||||
/* CustomerTrainingPlanDetails detail = CustomerTrainingPlanDetails();
|
||||
detail.customerTrainingPlanDetailsId = ++index;
|
||||
detail.trainingPlanDetailsId = elem.trainingPlanDetailId;
|
||||
detail.exerciseTypeId = elem.exerciseTypeId;
|
||||
@ -107,7 +112,25 @@ class TrainingPlanRepository {
|
||||
detail.baseOneRepMax = Common.calculate1RM(detail.weight!, detail.repeats!.toDouble());
|
||||
}
|
||||
detail.alternatives = Common.getExerciseTypeAlternatives(detail.exerciseTypeId);
|
||||
plan.details.add(detail);
|
||||
|
||||
// first repeat: 50% more
|
||||
if (detail.weight != null && detail.weight! > 0 && exerciseTypeIdOrig != detail.exerciseTypeId && detail.repeats! > 0) {
|
||||
CustomerTrainingPlanDetails firstDetail = CustomerTrainingPlanDetails();
|
||||
firstDetail.copy(detail);
|
||||
firstDetail.repeats = (detail.repeats! * 1.5).round();
|
||||
firstDetail.set = 1;
|
||||
detail.set = detail.set! - 1;
|
||||
if (detail.set! > 0) {
|
||||
index++;
|
||||
}
|
||||
detail.customerTrainingPlanDetailsId = index;
|
||||
plan.details.add(firstDetail);
|
||||
exerciseTypeIdOrig = detail.exerciseTypeId!;
|
||||
}
|
||||
|
||||
if (detail.set! > 0) {
|
||||
plan.details.add(detail);
|
||||
} */
|
||||
});
|
||||
|
||||
Cache().myTrainingPlan = plan;
|
||||
@ -116,6 +139,68 @@ class TrainingPlanRepository {
|
||||
return plan;
|
||||
}
|
||||
|
||||
List<CustomerTrainingPlanDetails> createDetail(CustomerTrainingPlan plan, TrainingPlanDetail elem, int exerciseTypeIdOrig, int index,
|
||||
{bool changeExerciseType = false}) {
|
||||
List<CustomerTrainingPlanDetails> list = [];
|
||||
CustomerTrainingPlanDetails detail = CustomerTrainingPlanDetails();
|
||||
detail.customerTrainingPlanDetailsId = ++index;
|
||||
detail.trainingPlanDetailsId = elem.trainingPlanDetailId;
|
||||
detail.exerciseTypeId = changeExerciseType ? exerciseTypeIdOrig : elem.exerciseTypeId;
|
||||
detail.repeats = elem.repeats;
|
||||
detail.set = elem.set;
|
||||
detail.dayId = elem.dayId;
|
||||
TrainingPlanDayRepository trainingPlanDayRepository = TrainingPlanDayRepository();
|
||||
detail.day = trainingPlanDayRepository.getNameById(elem.dayId);
|
||||
detail.parallel = elem.parallel;
|
||||
detail.restingTime = elem.restingTime;
|
||||
detail.exerciseType = Cache().getExerciseTypeById(detail.exerciseTypeId!);
|
||||
detail.alternatives = Common.getExerciseTypeAlternatives(detail.exerciseTypeId);
|
||||
if (elem.weight == -1) {
|
||||
if (detail.exerciseType!.unitQuantityUnit != null) {
|
||||
detail = getCalculatedWeightRepeats(elem.exerciseTypeId, detail);
|
||||
} else {
|
||||
detail.weight = 0;
|
||||
}
|
||||
} else if (elem.weight == -2) {
|
||||
final CustomerTrainingPlanDetails calculated = this.isWeightCalculatedByExerciseType(elem.exerciseTypeId, detail, plan);
|
||||
if (calculated.weight != -1) {
|
||||
detail.weight = calculated.weight;
|
||||
} else {
|
||||
detail.weight = -2;
|
||||
}
|
||||
} else {
|
||||
detail.weight = elem.weight;
|
||||
}
|
||||
print("Detail $detail exerciseType: ${detail.exerciseType!.exerciseTypeId}");
|
||||
|
||||
detail.state = ExercisePlanDetailState.start;
|
||||
if (detail.weight != null && detail.weight! > 0) {
|
||||
detail.baseOneRepMax = Common.calculate1RM(detail.weight!, detail.repeats!.toDouble());
|
||||
}
|
||||
|
||||
// first repeat: 50% more
|
||||
if (detail.weight != null && detail.weight! > 0 && exerciseTypeIdOrig != detail.exerciseTypeId && detail.repeats! > 0) {
|
||||
CustomerTrainingPlanDetails firstDetail = CustomerTrainingPlanDetails();
|
||||
firstDetail.copy(detail);
|
||||
firstDetail.repeats = (detail.repeats! * 1.5).round();
|
||||
firstDetail.set = 1;
|
||||
detail.set = detail.set! - 1;
|
||||
if (detail.set! > 0) {
|
||||
index++;
|
||||
}
|
||||
detail.customerTrainingPlanDetailsId = index;
|
||||
//plan.details.add(firstDetail);
|
||||
list.add(firstDetail);
|
||||
exerciseTypeIdOrig = detail.exerciseTypeId!;
|
||||
}
|
||||
|
||||
if (detail.set! > 0) {
|
||||
//plan.details.add(detail);
|
||||
list.add(detail);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
CustomerTrainingPlanDetails isWeightCalculatedByExerciseType(
|
||||
int exerciseTypeId, CustomerTrainingPlanDetails detail, CustomerTrainingPlan plan) {
|
||||
CustomerTrainingPlanDetails calculated = detail;
|
||||
@ -172,10 +257,16 @@ class TrainingPlanRepository {
|
||||
|
||||
Exercise? lastExercise1RM;
|
||||
DateTime dt = DateTime.now().subtract(Duration(days: 30));
|
||||
Cache().getExercises()!.forEach((exercise) {
|
||||
List<Exercise> exercises = Cache().getExercises()!;
|
||||
exercises.sort((a, b) {
|
||||
// reverse
|
||||
return a.dateAdd!.compareTo(b.dateAdd!);
|
||||
});
|
||||
exercises.forEach((exercise) {
|
||||
if (exercise.exerciseTypeId == exerciseTypeId && exercise.dateAdd!.compareTo(dt) >= 0) {
|
||||
detail.weight = weight;
|
||||
lastExercise1RM = exercise;
|
||||
print("last exercise: $exercise");
|
||||
}
|
||||
});
|
||||
|
||||
@ -185,7 +276,8 @@ class TrainingPlanRepository {
|
||||
return detail;
|
||||
}
|
||||
|
||||
double oneRepMax = Common.calculate1RM(lastExercise1RM!.unitQuantity!, lastExercise1RM!.quantity!);
|
||||
double oneRepMax = calculateMax1RMSameDay(lastExercise1RM!);
|
||||
// Common.calculate1RM(lastExercise1RM!.unitQuantity!, lastExercise1RM!.quantity!);
|
||||
print("Exercise $exerciseTypeId - 1RM : $oneRepMax");
|
||||
weight = oneRepMax * Common.get1RMPercent(detail.repeats!);
|
||||
print("Exercise $exerciseTypeId - weight : $weight");
|
||||
@ -201,6 +293,25 @@ class TrainingPlanRepository {
|
||||
return detail;
|
||||
}
|
||||
|
||||
double calculateMax1RMSameDay(Exercise actual) {
|
||||
List<Exercise> exercises = Cache().getExercises()!;
|
||||
double max1RM = 0.0;
|
||||
|
||||
exercises.forEach((exercise) {
|
||||
if (actual.exerciseTypeId == exercise.exerciseTypeId &&
|
||||
actual.dateAdd!.year == exercise.dateAdd!.year &&
|
||||
actual.dateAdd!.month == exercise.dateAdd!.month &&
|
||||
actual.dateAdd!.day == exercise.dateAdd!.day) {
|
||||
double oneRepMax = Common.calculate1RM(exercise.unitQuantity!, exercise.quantity!);
|
||||
if (max1RM < oneRepMax) {
|
||||
max1RM = oneRepMax;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return max1RM;
|
||||
}
|
||||
|
||||
int getOriginalRepeats(int trainingPlanId, CustomerTrainingPlanDetails detail) {
|
||||
TrainingPlan? plan = getTrainingPlanById(trainingPlanId);
|
||||
if (plan == null) {
|
||||
|
@ -7,13 +7,28 @@ import 'package:flutter/services.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
|
||||
class APIClient with Common, Logging {
|
||||
static final APIClient _singleton = APIClient._internal();
|
||||
late bool cert;
|
||||
|
||||
factory APIClient() {
|
||||
return _singleton;
|
||||
}
|
||||
|
||||
APIClient._internal() {
|
||||
cert = false;
|
||||
}
|
||||
|
||||
dynamic authenticateUser(String email, String password) async {
|
||||
var url = Cache().getBaseUrl() + "authenticate";
|
||||
|
||||
try {
|
||||
ByteData data = await rootBundle.load('asset/data/aitrainer_server.crt.pem');
|
||||
SecurityContext context = SecurityContext.defaultContext;
|
||||
context.setTrustedCertificatesBytes(data.buffer.asUint8List(), password: "[xxxx]");
|
||||
if (cert == false) {
|
||||
print("Set CERT $cert");
|
||||
context.setTrustedCertificatesBytes(data.buffer.asUint8List(), password: "[xxxx]");
|
||||
cert = true;
|
||||
}
|
||||
|
||||
HttpClient client = new HttpClient(); //context: context Todo provide the right certificate
|
||||
client.badCertificateCallback = ((X509Certificate cert, String host, int port) {
|
||||
@ -52,7 +67,9 @@ class APIClient with Common, Logging {
|
||||
}
|
||||
var uri = Uri.parse(url);
|
||||
HttpClient client = new HttpClient();
|
||||
|
||||
client.badCertificateCallback = ((X509Certificate cert, String host, int port) => true);
|
||||
|
||||
final HttpClientRequest request = await client.postUrl(uri);
|
||||
request.headers.contentType = new ContentType("application", "json", charset: "utf-8");
|
||||
request.headers.set('Authorization', 'Bearer $authToken');
|
||||
@ -87,7 +104,9 @@ class APIClient with Common, Logging {
|
||||
var uri = Uri.parse(url);
|
||||
|
||||
HttpClient client = new HttpClient();
|
||||
|
||||
client.badCertificateCallback = ((X509Certificate cert, String host, int port) => true);
|
||||
|
||||
final HttpClientRequest request = await client.getUrl(uri);
|
||||
request.headers.set('Content-Type', 'application/json');
|
||||
request.headers.set('Authorization', 'Bearer $authToken');
|
||||
|
@ -6,7 +6,7 @@ import 'dart:convert';
|
||||
import 'api.dart';
|
||||
|
||||
class CustomerExerciseDeviceApi with Logging {
|
||||
final APIClient _client = new APIClient();
|
||||
final APIClient _client = APIClient();
|
||||
|
||||
Future<List<CustomerExerciseDevice>> getDevices(int customerId) async {
|
||||
List<CustomerExerciseDevice> devices = [];
|
||||
|
@ -10,7 +10,7 @@ import 'package:aitrainer_app/service/logging.dart';
|
||||
import 'package:aitrainer_app/util/not_found_exception.dart';
|
||||
|
||||
class CustomerApi with Logging {
|
||||
final APIClient _client = new APIClient();
|
||||
final APIClient _client = APIClient();
|
||||
|
||||
Future<List<Customer>> getRealCustomers(String param) async {
|
||||
final body = await _client.get("customers/", param);
|
||||
|
@ -5,7 +5,7 @@ import 'package:aitrainer_app/model/exercise_device.dart';
|
||||
import 'api.dart';
|
||||
|
||||
class ExerciseDeviceApi {
|
||||
final APIClient _client = new APIClient();
|
||||
final APIClient _client = APIClient();
|
||||
|
||||
Future<List<ExerciseDevice>> getDevices() async {
|
||||
final body = await _client.get("exercise_device/", "");
|
||||
|
@ -6,7 +6,7 @@ import 'dart:convert';
|
||||
import 'api.dart';
|
||||
|
||||
class ExercisePlanApi with Logging {
|
||||
final APIClient _client = new APIClient();
|
||||
final APIClient _client = APIClient();
|
||||
|
||||
Future<ExercisePlan> saveExercisePlan(ExercisePlan exercisePlan) async {
|
||||
String body = JsonEncoder().convert(exercisePlan.toJson());
|
||||
|
@ -6,7 +6,7 @@ import 'package:aitrainer_app/service/logging.dart';
|
||||
import 'api.dart';
|
||||
|
||||
class ExerciseResultApi with Logging {
|
||||
final APIClient _client = new APIClient();
|
||||
final APIClient _client = APIClient();
|
||||
|
||||
Future<void> saveExerciseResult(ExerciseResult exerciseResult) async {
|
||||
String body = JsonEncoder().convert(exerciseResult.toJson());
|
||||
|
@ -4,7 +4,7 @@ import 'package:aitrainer_app/service/api.dart';
|
||||
import 'package:aitrainer_app/service/logging.dart';
|
||||
|
||||
class ExerciseApi with Logging {
|
||||
final APIClient _client = new APIClient();
|
||||
final APIClient _client = APIClient();
|
||||
|
||||
Future<void> saveExercise(Exercise exercise) async {
|
||||
String body = JsonEncoder().convert(exercise.toJson());
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter/services.dart';
|
||||
import 'api.dart';
|
||||
|
||||
class ExerciseTreeApi with Logging {
|
||||
final APIClient _client = new APIClient();
|
||||
final APIClient _client = APIClient();
|
||||
|
||||
Future<List<ExerciseTree>> getExerciseTree() async {
|
||||
final String body = await _client.get("exercise_tree", "");
|
||||
|
@ -6,7 +6,7 @@ import 'package:aitrainer_app/service/logging.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class ExerciseTypeApi with Logging {
|
||||
final APIClient _client = new APIClient();
|
||||
final APIClient _client = APIClient();
|
||||
|
||||
Future<List<ExerciseType>> getExerciseTypes() async {
|
||||
final body = await _client.get("exercise_type", "");
|
||||
|
@ -31,7 +31,7 @@ import 'customer_service.dart';
|
||||
import 'exercise_tree_service.dart';
|
||||
|
||||
class PackageApi {
|
||||
final APIClient _client = new APIClient();
|
||||
final APIClient _client = APIClient();
|
||||
|
||||
Future<void> getPackage() async {
|
||||
late List<ExerciseTree> exerciseTree;
|
||||
|
@ -5,7 +5,7 @@ import 'package:aitrainer_app/model/product.dart';
|
||||
import 'package:aitrainer_app/service/api.dart';
|
||||
|
||||
class ProductApi {
|
||||
final APIClient _client = new APIClient();
|
||||
final APIClient _client = APIClient();
|
||||
|
||||
Future<List<Product>> getProducts() async {
|
||||
final body = await _client.get("product/", "");
|
||||
|
@ -6,7 +6,7 @@ import 'package:aitrainer_app/service/api.dart';
|
||||
import '../model/property.dart';
|
||||
|
||||
class PropertyApi {
|
||||
final APIClient _client = new APIClient();
|
||||
final APIClient _client = APIClient();
|
||||
|
||||
Future<List<Property>> getProperties() async {
|
||||
final body = await _client.get("property/", "");
|
||||
|
@ -6,7 +6,7 @@ import 'dart:convert';
|
||||
import 'api.dart';
|
||||
|
||||
class PurchaseApi with Logging {
|
||||
final APIClient _client = new APIClient();
|
||||
final APIClient _client = APIClient();
|
||||
|
||||
Future<List<Purchase>> getPurchasesByCustomer(int customerId) async {
|
||||
List<Purchase> purchases = [];
|
||||
|
@ -6,7 +6,7 @@ import 'package:aitrainer_app/service/api.dart';
|
||||
import '../model/sport.dart';
|
||||
|
||||
class SportApi {
|
||||
final APIClient _client = new APIClient();
|
||||
final APIClient _client = APIClient();
|
||||
|
||||
Future<List<Sport>> getSports() async {
|
||||
final body = await _client.get("sports/", "");
|
||||
|
@ -4,7 +4,7 @@ import 'dart:convert';
|
||||
import 'api.dart';
|
||||
|
||||
class TrackingApi with Logging {
|
||||
final APIClient _client = new APIClient();
|
||||
final APIClient _client = APIClient();
|
||||
|
||||
Future<void> saveTracking(Tracking tracking) async {
|
||||
try {
|
||||
|
@ -6,7 +6,7 @@ import 'package:aitrainer_app/service/api.dart';
|
||||
import 'package:aitrainer_app/service/logging.dart';
|
||||
|
||||
class TrainingPlanApi with Logging {
|
||||
final APIClient _client = new APIClient();
|
||||
final APIClient _client = APIClient();
|
||||
|
||||
Future<CustomerTrainingPlan> saveCustomerTrainingPlan(CustomerTrainingPlan plan) async {
|
||||
String body = JsonEncoder().convert(plan.toJson());
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:aitrainer_app/service/logging.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
@ -4,7 +4,6 @@ import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/model/exercise_type.dart';
|
||||
import 'package:aitrainer_app/repository/user_repository.dart';
|
||||
import 'package:badges/badges.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
|
@ -8,11 +8,11 @@ import 'package:firebase_analytics/firebase_analytics.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
//import 'package:flurry_data/flurry_data.dart';
|
||||
import 'package:flutter_uxcam/flutter_uxcam.dart';
|
||||
import 'package:smartlook/smartlook.dart';
|
||||
import 'package:flutter_smartlook/flutter_smartlook.dart';
|
||||
|
||||
class Track with Logging {
|
||||
static final Track _singleton = Track._internal();
|
||||
static FirebaseAnalytics analytics = FirebaseAnalytics();
|
||||
static FirebaseAnalytics analytics = FirebaseAnalytics.instance;
|
||||
|
||||
factory Track() {
|
||||
return _singleton;
|
||||
|
@ -183,7 +183,7 @@ class AccountPage extends StatelessWidget with Trans {
|
||||
}
|
||||
|
||||
ListTile messaging() {
|
||||
FirebaseInAppMessaging fiam = FirebaseInAppMessaging();
|
||||
FirebaseInAppMessaging fiam = FirebaseInAppMessaging.instance;
|
||||
ListTile element = ListTile(
|
||||
leading: Icon(Icons.message),
|
||||
title: TextButton(
|
||||
|
@ -1,12 +1,10 @@
|
||||
import 'dart:collection';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:aitrainer_app/bloc/body_type/bodytype_bloc.dart';
|
||||
import 'package:aitrainer_app/util/app_localization.dart';
|
||||
import 'package:aitrainer_app/repository/customer_repository.dart';
|
||||
import 'package:aitrainer_app/util/enums.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||
import 'package:aitrainer_app/widgets/dialog_html.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
@ -6,7 +6,6 @@ import 'package:aitrainer_app/repository/customer_exercise_device_repository.dar
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar.dart';
|
||||
import 'package:aitrainer_app/widgets/image_button.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
@ -8,9 +8,7 @@ import 'package:aitrainer_app/model/fitness_state.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
@ -52,7 +50,6 @@ class _CustomerFitnessPageState extends State<CustomerFitnessPage> with Trans {
|
||||
if (!fulldata) {
|
||||
_bar = AppBarProgress(max: 30, min: 15);
|
||||
}
|
||||
final double h = 27;
|
||||
return Scaffold(
|
||||
appBar: _bar,
|
||||
body: Container(
|
||||
|
@ -6,7 +6,6 @@ import 'package:aitrainer_app/repository/customer_repository.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
@ -5,9 +5,7 @@ import 'package:aitrainer_app/repository/customer_repository.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
|
@ -13,8 +13,6 @@ import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_progress.dart';
|
||||
import 'package:aitrainer_app/widgets/number_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
|
@ -6,9 +6,7 @@ import 'package:aitrainer_app/repository/customer_repository.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
|
@ -6,9 +6,7 @@ import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_progress.dart';
|
||||
import 'package:aitrainer_app/widgets/number_picker.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'dart:collection';
|
||||
import 'dart:ui';
|
||||
import 'package:aitrainer_app/bloc/tutorial/tutorial_bloc.dart';
|
||||
import 'package:aitrainer_app/widgets/tutorial_widget.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
@ -12,7 +12,6 @@ import 'package:aitrainer_app/widgets/dialog_html.dart';
|
||||
import 'package:aitrainer_app/widgets/number_picker.dart';
|
||||
import 'package:aitrainer_app/widgets/timer_widget.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
|
@ -8,7 +8,6 @@ import 'package:aitrainer_app/widgets/treeview_parent_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import 'package:flutter_html/style.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
|
@ -8,7 +8,6 @@ import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||
import 'package:aitrainer_app/widgets/dialog_common.dart';
|
||||
import 'package:aitrainer_app/widgets/dialog_web_browser.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
|
@ -3,7 +3,6 @@ import 'package:aitrainer_app/bloc/menu/menu_bloc.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar.dart';
|
||||
import 'package:aitrainer_app/widgets/bottom_nav.dart';
|
||||
import 'package:aitrainer_app/widgets/menu_page_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
|
@ -99,7 +99,7 @@ class MyDevelopmentLog extends StatelessWidget with Trans, Common {
|
||||
view: CalendarView.month,
|
||||
monthViewSettings: MonthViewSettings(
|
||||
showAgenda: true,
|
||||
appointmentDisplayMode: MonthAppointmentDisplayMode.appointment,
|
||||
appointmentDisplayMode: MonthAppointmentDisplayMode.indicator,
|
||||
showTrailingAndLeadingDates: true,
|
||||
),
|
||||
appointmentTimeTextFormat: 'HH:mm',
|
||||
@ -307,11 +307,11 @@ class MyDevelopmentLog extends StatelessWidget with Trans, Common {
|
||||
TextSpan(text: t("The found exercises are")),
|
||||
TextSpan(text: " "),
|
||||
TextSpan(
|
||||
text: t("in red"),
|
||||
text: t("in green"),
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: Colors.redAccent,
|
||||
color: Color(0xffb4f500),
|
||||
),
|
||||
),
|
||||
TextSpan(text: " "),
|
||||
|
@ -11,9 +11,7 @@ import 'package:aitrainer_app/bloc/development_by_muscle/development_by_muscle_b
|
||||
import 'package:aitrainer_app/model/workout_menu_tree.dart';
|
||||
import 'package:aitrainer_app/library/tree_view.dart';
|
||||
import 'package:aitrainer_app/widgets/bottom_nav.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
|
@ -14,7 +14,6 @@ import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar.dart';
|
||||
import 'package:aitrainer_app/widgets/bottom_nav.dart';
|
||||
import 'package:aitrainer_app/widgets/image_button.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MyDevelopmentPage extends StatefulWidget {
|
||||
|
@ -2,9 +2,7 @@ import 'package:aitrainer_app/bloc/development_sizes/development_sizes_bloc.dart
|
||||
import 'package:aitrainer_app/model/property.dart';
|
||||
import 'package:aitrainer_app/repository/customer_repository.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
|
@ -10,7 +10,6 @@ import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||
import 'package:aitrainer_app/widgets/dialog_common.dart';
|
||||
import 'package:aitrainer_app/widgets/dialog_web_browser.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
|
@ -3,7 +3,6 @@ import 'package:aitrainer_app/repository/user_repository.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
|
@ -4,11 +4,9 @@ import 'package:aitrainer_app/service/logging.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||
import 'package:aitrainer_app/widgets/dialog_common.dart';
|
||||
import 'package:aitrainer_app/widgets/sales_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import 'package:flutter_html/style.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
|
||||
|
@ -12,7 +12,6 @@ import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||
import 'package:aitrainer_app/widgets/bottom_nav.dart';
|
||||
import 'package:aitrainer_app/widgets/dialog_web_browser.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
|
@ -20,7 +20,6 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import 'package:flutter_html/style.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
import 'package:syncfusion_flutter_datagrid/datagrid.dart';
|
||||
|
@ -1,5 +1,3 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:aitrainer_app/bloc/training_plan/training_plan_bloc.dart';
|
||||
import 'package:aitrainer_app/library/custom_icon_icons.dart';
|
||||
import 'package:aitrainer_app/model/customer_training_plan.dart';
|
||||
@ -185,7 +183,7 @@ class _ExerciseTileState extends State<ExerciseTile> with Trans {
|
||||
}
|
||||
|
||||
void activateCustomPlan() {
|
||||
widget.bloc.add(TrainingPlanCustomAddLoad(exerciseType: widget.exerciseType));
|
||||
widget.bloc.add(TrainingPlanAddLoad(exerciseType: widget.exerciseType));
|
||||
Navigator.of(context).popAndPushNamed("myTrainingPlanCustomAdd");
|
||||
}
|
||||
|
||||
|
@ -3,12 +3,9 @@ import 'package:aitrainer_app/util/app_language.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:keyboard_actions/keyboard_actions.dart';
|
||||
import 'package:keyboard_actions/keyboard_actions_config.dart';
|
||||
import 'package:keyboard_actions/keyboard_actions_item.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
|
||||
class TrainingPlanCustomAddPage extends StatefulWidget {
|
||||
|
@ -5,6 +5,7 @@ import 'package:aitrainer_app/library/custom_icon_icons.dart';
|
||||
import 'package:aitrainer_app/model/customer_training_plan_details.dart';
|
||||
import 'package:aitrainer_app/model/exercise_plan_detail.dart';
|
||||
import 'package:aitrainer_app/util/app_localization.dart';
|
||||
import 'package:aitrainer_app/util/common.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar.dart';
|
||||
import 'package:aitrainer_app/widgets/dialog_common.dart';
|
||||
@ -12,6 +13,7 @@ import 'package:aitrainer_app/widgets/dialog_html.dart';
|
||||
|
||||
import 'package:aitrainer_app/widgets/menu_image.dart';
|
||||
import 'package:badges/badges.dart';
|
||||
import 'package:carousel_slider/carousel_slider.dart';
|
||||
import 'package:extended_tabs/extended_tabs.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -312,7 +314,6 @@ class _ExerciseListState extends State<ExerciseList> with Trans {
|
||||
|
||||
void animate() {
|
||||
offset = widget.bloc.getOffset();
|
||||
//print("Offset: $offset");
|
||||
if (scrollController.hasClients) {
|
||||
scrollController.animateTo(offset, duration: Duration(milliseconds: 300), curve: Curves.easeIn);
|
||||
}
|
||||
@ -390,7 +391,10 @@ class _ExerciseListState extends State<ExerciseList> with Trans {
|
||||
tiles.add(GestureDetector(
|
||||
onTap: () =>
|
||||
bloc.getNext() != null ? executeExercise(bloc, bloc.getNext()!, context) : Navigator.of(context).pushNamed('home'),
|
||||
child: ExerciseTile(bloc: bloc, detail: element)));
|
||||
child: ExerciseTile(
|
||||
bloc: bloc,
|
||||
detail: element,
|
||||
)));
|
||||
}
|
||||
prev = element;
|
||||
});
|
||||
@ -407,10 +411,9 @@ class ExerciseTile extends StatelessWidget with Trans {
|
||||
|
||||
ExerciseTile({required this.bloc, required this.detail});
|
||||
|
||||
Widget getExerciseQuantities(CustomerTrainingPlanDetails detail, int step, bool noFilter) {
|
||||
Widget getExerciseQuantities(CustomerTrainingPlanDetails detail, int step, bool noFilter, int highlightStep) {
|
||||
bool skipped = detail.state == ExercisePlanDetailState.skipped;
|
||||
String quantities = "";
|
||||
String set = "";
|
||||
List<TextSpan> spans = [];
|
||||
if (detail.exerciseType!.name == "Warming Up") {
|
||||
quantities = t("Min. 10 minutes");
|
||||
@ -423,47 +426,50 @@ class ExerciseTile extends StatelessWidget with Trans {
|
||||
TextSpan(text: quantities),
|
||||
);
|
||||
} else {
|
||||
set = detail.set! > 1 ? "${detail.set} " + t("set") : "";
|
||||
List<CustomerTrainingPlanDetails> details = bloc.getAllDetailsSameExercise(detail);
|
||||
int index = 0;
|
||||
bool isWeight = true;
|
||||
|
||||
if (set.length > 0) {
|
||||
spans.add(
|
||||
TextSpan(
|
||||
text: step.toString() + " ",
|
||||
style: GoogleFonts.archivoBlack(
|
||||
color: Colors.orange[600],
|
||||
)),
|
||||
);
|
||||
spans.add(
|
||||
TextSpan(text: "/ " + set),
|
||||
);
|
||||
}
|
||||
|
||||
details.forEach((element) {
|
||||
quantities = "";
|
||||
String delimiter = ",";
|
||||
if (index == 0) {
|
||||
delimiter = "";
|
||||
|
||||
if (index > 0) {
|
||||
spans.add(
|
||||
TextSpan(text: ", "),
|
||||
);
|
||||
}
|
||||
//print("STEP $step highlight: $highlightStep index: $index");
|
||||
if (element.set! > 1) {
|
||||
spans.add(
|
||||
TextSpan(
|
||||
text: (element.exercises.length + 1).toString(),
|
||||
style: GoogleFonts.archivoBlack(
|
||||
color: highlightStep == index && noFilter ? Colors.orange[600] : Colors.white,
|
||||
)),
|
||||
);
|
||||
spans.add(
|
||||
TextSpan(text: "/${element.set} x "),
|
||||
);
|
||||
}
|
||||
|
||||
if (element.repeats == -1) {
|
||||
quantities += delimiter + " MAX ";
|
||||
quantities += " MAX ";
|
||||
} else {
|
||||
quantities += delimiter + " ${element.repeats}";
|
||||
quantities += "${element.repeats}";
|
||||
}
|
||||
if (element.exerciseType!.unitQuantityUnit != null) {
|
||||
|
||||
if (element.exerciseType!.unitQuantityUnit != null && element.weight != null) {
|
||||
quantities += "x";
|
||||
if (element.weight == -1 || element.weight == -2 || element.weight == -3) {
|
||||
quantities += "? kg";
|
||||
} else {
|
||||
num weight = element.weight! % element.weight!.round() == 0 ? element.weight!.round() : element.weight!;
|
||||
|
||||
quantities += "$weight kg";
|
||||
}
|
||||
} else {
|
||||
isWeight = false;
|
||||
}
|
||||
if (step == index && noFilter) {
|
||||
if (highlightStep == index && noFilter) {
|
||||
spans.add(
|
||||
TextSpan(
|
||||
text: quantities,
|
||||
@ -509,15 +515,55 @@ class ExerciseTile extends StatelessWidget with Trans {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
setContext(context);
|
||||
//bloc.setTileKey(tileKey);
|
||||
return CarouselSlider(
|
||||
options: CarouselOptions(
|
||||
viewportFraction: 1,
|
||||
reverse: false,
|
||||
enableInfiniteScroll: false,
|
||||
autoPlay: false,
|
||||
aspectRatio: 1.3,
|
||||
enlargeCenterPage: true,
|
||||
onPageChanged: (index, reason) => {print("index changed $index")},
|
||||
enlargeStrategy: CenterPageEnlargeStrategy.scale),
|
||||
items: getExerciseTiles(detail),
|
||||
);
|
||||
}
|
||||
|
||||
List<Widget> getExerciseTiles(CustomerTrainingPlanDetails detail) {
|
||||
final List<Widget> list = [];
|
||||
list.add(getTile(detail));
|
||||
|
||||
/* if (detail.alternatives.length == 0) {
|
||||
detail.alternatives = Common.getExerciseTypeAlternatives(detail.exerciseTypeId);
|
||||
}
|
||||
if (detail.alternatives.length > 0) {
|
||||
detail.alternatives.forEach((element) {
|
||||
CustomerTrainingPlanDetails? alternative = bloc.createDetailFromExerciseType(element, detail);
|
||||
if (alternative != null) {
|
||||
final Widget widget = getTile(alternative);
|
||||
print("Alternatives for ${detail.exerciseTypeId}: $alternative");
|
||||
list.add(widget);
|
||||
}
|
||||
});
|
||||
} */
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
Widget getTile(CustomerTrainingPlanDetails detail) {
|
||||
final CustomerTrainingPlanDetails? next = bloc.getNext();
|
||||
final bool noFilter = next != null && next.exerciseTypeId == detail.exerciseTypeId;
|
||||
final bool done = bloc.isAllDetailsSameExerciseFinished(detail); //detail.state == ExercisePlanDetailState.finished;
|
||||
final int step = bloc.getStep(detail); //detail.exercises.length;
|
||||
final bool done = bloc.isAllDetailsSameExerciseFinished(detail);
|
||||
final bool buddyWarning = detail.exerciseType == null ? false : detail.exerciseType!.buddyWarning;
|
||||
final bool hasAlternative = false; //detail.alternatives.length > 0;
|
||||
final int step = bloc.getStep(detail);
|
||||
final int highlightStep = bloc.getHighlightStep(detail);
|
||||
final bool hasAlternative = detail.alternatives.length > 0;
|
||||
|
||||
return Container(
|
||||
child: Stack(alignment: Alignment.centerRight, children: [
|
||||
//key: this.tileKey,
|
||||
child: ClipRect(
|
||||
child: Stack(alignment: Alignment.centerRight, children: [
|
||||
Stack(alignment: Alignment.centerLeft, children: [
|
||||
Stack(alignment: Alignment.bottomLeft, children: [
|
||||
Badge(
|
||||
@ -529,7 +575,7 @@ class ExerciseTile extends StatelessWidget with Trans {
|
||||
badgeColor: Colors.transparent,
|
||||
showBadge: noFilter || done,
|
||||
badgeContent: IconButton(
|
||||
iconSize: 40,
|
||||
iconSize: 36,
|
||||
onPressed: () => !done ? skip() : {},
|
||||
icon: Icon(
|
||||
done ? CustomIcon.ok_circled : Icons.cancel,
|
||||
@ -559,13 +605,13 @@ class ExerciseTile extends StatelessWidget with Trans {
|
||||
child: Badge(
|
||||
elevation: 0,
|
||||
padding: EdgeInsets.all(0),
|
||||
position: BadgePosition.topEnd(top: 65, end: 1),
|
||||
position: BadgePosition.topEnd(top: 5, end: 60),
|
||||
animationDuration: Duration(milliseconds: 500),
|
||||
animationType: BadgeAnimationType.fade,
|
||||
badgeColor: Colors.transparent,
|
||||
showBadge: buddyWarning,
|
||||
badgeContent: IconButton(
|
||||
iconSize: 50,
|
||||
iconSize: 36,
|
||||
onPressed: () => showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
@ -608,7 +654,7 @@ class ExerciseTile extends StatelessWidget with Trans {
|
||||
: null,
|
||||
height: 80,
|
||||
width: double.infinity,
|
||||
child: getExerciseQuantities(detail, step, noFilter),
|
||||
child: getExerciseQuantities(detail, step, noFilter, highlightStep),
|
||||
)
|
||||
])))),
|
||||
Container(
|
||||
@ -639,25 +685,31 @@ class ExerciseTile extends StatelessWidget with Trans {
|
||||
),
|
||||
]),
|
||||
hasAlternative
|
||||
? Image.asset(
|
||||
'asset/image/alternatives_arrow.png',
|
||||
height: 100,
|
||||
width: 100,
|
||||
)
|
||||
? Positioned(
|
||||
top: 50,
|
||||
child: Image.asset(
|
||||
'asset/image/alternatives_arrow.png',
|
||||
height: 100,
|
||||
width: 100,
|
||||
color: noFilter ? Color(0xffb4f500) : Colors.grey,
|
||||
))
|
||||
: Offstage(),
|
||||
]),
|
||||
hasAlternative
|
||||
? Transform.rotate(
|
||||
angle: pi,
|
||||
alignment: Alignment.center,
|
||||
child: Image.asset(
|
||||
'asset/image/alternatives_arrow.png',
|
||||
height: 100,
|
||||
width: 100,
|
||||
),
|
||||
? Positioned(
|
||||
top: 50,
|
||||
child: Transform.rotate(
|
||||
angle: pi,
|
||||
alignment: Alignment.center,
|
||||
child: Image.asset(
|
||||
'asset/image/alternatives_arrow.png',
|
||||
height: 100,
|
||||
width: 100,
|
||||
color: noFilter ? Color(0xffb4f500) : Colors.grey,
|
||||
)),
|
||||
)
|
||||
: Offstage(),
|
||||
]));
|
||||
])));
|
||||
}
|
||||
|
||||
void skip() {
|
||||
|
@ -112,8 +112,8 @@ class TrainingPlanExercise extends StatelessWidget with Trans {
|
||||
set: detail.set,
|
||||
exerciseNr: detail.exercises.length + 1,
|
||||
onUnitQuantityChanged: (value) => bloc.add(TrainingPlanWeightChangeRecalculate(weight: value, detail: detail)),
|
||||
onUnitQuantityChangeUp: () => bloc.add(TrainingPlanWeightChangeUp(detail: detail)),
|
||||
onUnitQuantityChangeDown: () => bloc.add(TrainingPlanWeightChangeDown(detail: detail)),
|
||||
//onUnitQuantityChangeUp: () => bloc.add(TrainingPlanWeightChangeUp(detail: detail)),
|
||||
//onUnitQuantityChangeDown: () => bloc.add(TrainingPlanWeightChangeDown(detail: detail)),
|
||||
onQuantityChanged: (value) => bloc.add(TrainingPlanRepeatsChange(repeats: value.toInt(), detail: detail)),
|
||||
exerciseTypeId: detail.exerciseType!.exerciseTypeId,
|
||||
originalQuantity: originalQuantity,
|
||||
|
@ -10,7 +10,6 @@ import 'package:aitrainer_app/widgets/app_bar.dart';
|
||||
import 'package:aitrainer_app/widgets/bottom_nav.dart';
|
||||
import 'package:aitrainer_app/widgets/dialog_common.dart';
|
||||
import 'package:aitrainer_app/widgets/image_button.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
@ -6,7 +6,6 @@ import 'package:aitrainer_app/util/app_localization.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/repository/exercise_repository.dart';
|
||||
import 'package:aitrainer_app/util/common.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
@ -1,7 +1,6 @@
|
||||
import 'package:aitrainer_app/bloc/timer/timer_bloc.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/util/common.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
@ -1,6 +1,5 @@
|
||||
import 'package:aitrainer_app/bloc/timer/timer_bloc.dart';
|
||||
import 'package:aitrainer_app/util/common.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:aitrainer_app/library/liquid_progress_indicator/liquid_linear_progress_indicator.dart';
|
||||
|
@ -1,9 +1,7 @@
|
||||
import 'package:aitrainer_app/bloc/exercise_new/exercise_new_bloc.dart';
|
||||
import 'package:aitrainer_app/util/app_localization.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:syncfusion_flutter_gauges/gauges.dart';
|
||||
import 'app_bar.dart';
|
||||
|
@ -3,9 +3,7 @@ import 'package:aitrainer_app/util/app_localization.dart';
|
||||
import 'package:aitrainer_app/model/fitness_state.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/library/dropdown_search/dropdown_search.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'app_bar.dart';
|
||||
import 'package:keyboard_actions/keyboard_actions.dart';
|
||||
|
@ -1,5 +1,3 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/service/logging.dart';
|
||||
import 'package:aitrainer_app/util/common.dart';
|
||||
|
@ -1,7 +1,6 @@
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import 'package:flutter_html/style.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
|
@ -11,7 +11,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:keyboard_actions/keyboard_actions.dart';
|
||||
import 'package:keyboard_actions/keyboard_actions_config.dart';
|
||||
import 'package:stop_watch_timer/stop_watch_timer.dart';
|
||||
import 'package:wakelock/wakelock.dart';
|
||||
import 'dialog_html.dart';
|
||||
|
@ -9,10 +9,8 @@ import 'package:aitrainer_app/view/login.dart';
|
||||
import 'package:aitrainer_app/view/menu_page.dart';
|
||||
import 'package:aitrainer_app/widgets/dialog_common.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:upgrader/upgrader.dart';
|
||||
import 'loading.dart';
|
||||
|
@ -1,7 +1,6 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LoadingScreenMain extends StatelessWidget {
|
||||
|
@ -3,7 +3,6 @@ import 'dart:convert';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:aitrainer_app/library/image_cache.dart' as wt;
|
||||
import 'package:aitrainer_app/library/transparent_image.dart';
|
||||
import 'package:flutter_html/shims/dart_ui_real.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class MenuImage extends StatelessWidget {
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'dart:collection';
|
||||
import 'dart:ui';
|
||||
import 'package:aitrainer_app/bloc/training_plan/training_plan_bloc.dart';
|
||||
import 'package:aitrainer_app/model/exercise_ability.dart';
|
||||
import 'package:aitrainer_app/bloc/menu/menu_bloc.dart';
|
||||
@ -19,9 +18,7 @@ import 'package:aitrainer_app/widgets/dialog_common.dart';
|
||||
import 'package:badges/badges.dart';
|
||||
import 'package:ezanimation/ezanimation.dart';
|
||||
import 'package:firebase_dynamic_links/firebase_dynamic_links.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/painting.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
@ -108,15 +105,12 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
|
||||
}
|
||||
|
||||
Future<void> initDynamicLinks() async {
|
||||
FirebaseDynamicLinks.instance.onLink(onSuccess: (PendingDynamicLinkData? dynamicLink) async {
|
||||
final Uri? deepLink = dynamicLink?.link;
|
||||
FirebaseDynamicLinks.instance.onLink.listen((dynamicLink) {
|
||||
final Uri deepLink = dynamicLink.link;
|
||||
print("DeepLink: $deepLink");
|
||||
if (deepLink != null) {
|
||||
// ignore: unawaited_futures
|
||||
final String deepLinkPath = deepLink.path.replaceFirst("/", "");
|
||||
Navigator.pushNamed(context, deepLinkPath);
|
||||
}
|
||||
}, onError: (OnLinkErrorException e) async {
|
||||
final String deepLinkPath = deepLink.path.replaceFirst("/", "");
|
||||
Navigator.pushNamed(context, deepLinkPath);
|
||||
}, onError: (e) async {
|
||||
print('onLinkError');
|
||||
print(e.message);
|
||||
});
|
||||
|
@ -2,9 +2,7 @@ import 'package:aitrainer_app/bloc/exercise_new/exercise_new_bloc.dart';
|
||||
import 'package:aitrainer_app/library/custom_icon_icons.dart';
|
||||
import 'package:aitrainer_app/model/property.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'app_bar.dart';
|
||||
import 'input_dialog_widget.dart';
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
|
@ -7,7 +7,6 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import 'package:flutter_html/style.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:aitrainer_app/library/super_tooltip.dart';
|
||||
|
||||
@ -41,8 +40,11 @@ class TutorialWidget with Trans, Logging {
|
||||
}
|
||||
|
||||
void explanation(BuildContext context, Widget widget) {
|
||||
final height = MediaQuery.of(context).size.height;
|
||||
print("Height $height");
|
||||
|
||||
tooltip = SuperTooltip(
|
||||
top: 120,
|
||||
top: height < 800 ? 60 : 120,
|
||||
left: 20,
|
||||
right: 20,
|
||||
backgroundColor: Colors.black87,
|
||||
|
190
pubspec.lock
190
pubspec.lock
@ -42,7 +42,7 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.8.1"
|
||||
version: "2.8.2"
|
||||
badges:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -140,7 +140,7 @@ packages:
|
||||
name: characters
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.2.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -161,7 +161,7 @@ packages:
|
||||
name: chewie
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "1.1.0"
|
||||
chewie_audio:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -330,125 +330,139 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.1.0"
|
||||
firebase:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "9.0.1"
|
||||
firebase_analytics:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: firebase_analytics
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "8.3.3"
|
||||
version: "9.0.3"
|
||||
firebase_analytics_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_analytics_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
version: "3.0.2"
|
||||
firebase_analytics_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_analytics_web
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.0+1"
|
||||
version: "0.4.0+3"
|
||||
firebase_auth:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: firebase_auth
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.1.2"
|
||||
version: "3.3.3"
|
||||
firebase_auth_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_auth_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "6.1.1"
|
||||
version: "6.1.8"
|
||||
firebase_auth_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_auth_web
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.1.1"
|
||||
version: "3.3.4"
|
||||
firebase_core:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: firebase_core
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
version: "1.10.5"
|
||||
firebase_core_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_core_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.1.0"
|
||||
version: "4.2.2"
|
||||
firebase_core_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_core_web
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.5.2"
|
||||
firebase_dynamic_links:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: firebase_dynamic_links
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.10"
|
||||
version: "4.0.2"
|
||||
firebase_dynamic_links_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_dynamic_links_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.0+2"
|
||||
firebase_in_app_messaging:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: firebase_in_app_messaging
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.5.0+13"
|
||||
version: "0.6.0+4"
|
||||
firebase_in_app_messaging_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_in_app_messaging_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.0+4"
|
||||
firebase_messaging:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: firebase_messaging
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "10.0.8"
|
||||
version: "11.2.3"
|
||||
firebase_messaging_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_messaging_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.6"
|
||||
version: "3.1.3"
|
||||
firebase_messaging_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_messaging_web
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.6"
|
||||
version: "2.2.4"
|
||||
firebase_remote_config:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: firebase_remote_config
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.10.0+5"
|
||||
version: "1.0.2"
|
||||
firebase_remote_config_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_remote_config_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.0+6"
|
||||
version: "1.0.2"
|
||||
firebase_remote_config_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_remote_config_web
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.2"
|
||||
fixnum:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -488,14 +502,14 @@ packages:
|
||||
name: flutter_facebook_auth
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.5.2"
|
||||
version: "3.5.7"
|
||||
flutter_facebook_auth_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_facebook_auth_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.7.0"
|
||||
version: "2.7.1"
|
||||
flutter_facebook_auth_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -549,7 +563,49 @@ packages:
|
||||
name: flutter_secure_storage
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.2.1"
|
||||
version: "5.0.2"
|
||||
flutter_secure_storage_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_secure_storage_linux
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
flutter_secure_storage_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_secure_storage_macos
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
flutter_secure_storage_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_secure_storage_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
flutter_secure_storage_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_secure_storage_web
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.2"
|
||||
flutter_secure_storage_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_secure_storage_windows
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
flutter_smartlook:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_smartlook
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.4"
|
||||
flutter_svg:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -601,14 +657,14 @@ packages:
|
||||
name: google_sign_in
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.1.0"
|
||||
version: "5.2.1"
|
||||
google_sign_in_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: google_sign_in_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
version: "2.1.0"
|
||||
google_sign_in_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -727,7 +783,7 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.10"
|
||||
version: "0.12.11"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -797,42 +853,42 @@ packages:
|
||||
name: package_info_plus
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "1.3.0"
|
||||
package_info_plus_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_info_plus_linux
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "1.0.3"
|
||||
package_info_plus_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_info_plus_macos
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.3.0"
|
||||
package_info_plus_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_info_plus_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "1.0.2"
|
||||
package_info_plus_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_info_plus_web
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "1.0.4"
|
||||
package_info_plus_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_info_plus_windows
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "1.0.4"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -923,7 +979,7 @@ packages:
|
||||
name: plugin_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
version: "2.0.2"
|
||||
pool:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -972,7 +1028,7 @@ packages:
|
||||
name: purchases_flutter
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.2.2"
|
||||
version: "3.8.0"
|
||||
quiver:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1007,7 +1063,7 @@ packages:
|
||||
name: rxdart
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.27.0"
|
||||
version: "0.27.3"
|
||||
sentry:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1105,19 +1161,26 @@ packages:
|
||||
name: sign_in_with_apple
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.2.0"
|
||||
version: "3.3.0"
|
||||
sign_in_with_apple_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sign_in_with_apple_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
sign_in_with_apple_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sign_in_with_apple_web
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.99"
|
||||
smartlook:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: smartlook
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
source_gen:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1180,7 +1243,7 @@ packages:
|
||||
name: stop_watch_timer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0+1"
|
||||
version: "1.3.1"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1271,21 +1334,21 @@ packages:
|
||||
name: test
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.17.10"
|
||||
version: "1.17.12"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.2"
|
||||
version: "0.4.3"
|
||||
test_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_core
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.0"
|
||||
version: "0.4.2"
|
||||
timeline_tile:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -1348,7 +1411,7 @@ packages:
|
||||
name: upgrader
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.5.1"
|
||||
version: "3.11.0"
|
||||
url_launcher:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -1404,7 +1467,7 @@ packages:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.1"
|
||||
version:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1446,28 +1509,35 @@ packages:
|
||||
name: wakelock
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.0"
|
||||
version: "0.5.6"
|
||||
wakelock_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: wakelock_macos
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.0+3"
|
||||
version: "0.4.0"
|
||||
wakelock_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: wakelock_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.1+3"
|
||||
version: "0.3.0"
|
||||
wakelock_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: wakelock_web
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.0+3"
|
||||
version: "0.4.0"
|
||||
wakelock_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: wakelock_windows
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.0"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1540,4 +1610,4 @@ packages:
|
||||
version: "3.1.0"
|
||||
sdks:
|
||||
dart: ">=2.14.0 <3.0.0"
|
||||
flutter: ">=2.0.0"
|
||||
flutter: ">=2.5.0"
|
||||
|
32
pubspec.yaml
32
pubspec.yaml
@ -40,13 +40,13 @@ dependencies:
|
||||
keyboard_actions: ^3.4.0
|
||||
badges: ^2.0.1
|
||||
#health: ^3.0.0
|
||||
stop_watch_timer: ^1.2.0+1
|
||||
stop_watch_timer: ^1.3.1
|
||||
#location: ^3.2.4
|
||||
modal_progress_hud_nsn: ^0.1.0-nullsafety-1
|
||||
flutter_html: ^2.0.0
|
||||
wakelock: ^ 0.4.0
|
||||
wakelock: ^ 0.5.6
|
||||
timeline_tile: ^2.0.0
|
||||
purchases_flutter: ^3.2.2
|
||||
purchases_flutter: ^3.8.0
|
||||
package_info: ^2.0.0
|
||||
ezanimation: ^0.5.0
|
||||
confetti: ^0.6.0-nullsafety
|
||||
@ -55,19 +55,19 @@ dependencies:
|
||||
convex_bottom_bar: ^3.0.0
|
||||
flutter_app_badger: ^1.2.0
|
||||
extended_tabs: ^2.2.0
|
||||
upgrader: ^3.5.1
|
||||
upgrader: ^3.11.0
|
||||
web_browser: ^0.5.0
|
||||
flutter_fadein: ^2.0.0
|
||||
mailto: ^2.0.0
|
||||
url_launcher: ^6.0.9
|
||||
|
||||
firebase_core: ^1.5.0
|
||||
firebase_analytics: ^8.1.0
|
||||
firebase_messaging: ^10.0.0
|
||||
firebase_auth: ^3.0.2
|
||||
firebase_remote_config: ^0.10.0+4
|
||||
firebase_dynamic_links: ^2.0.8
|
||||
firebase_in_app_messaging: ^0.5.0+13
|
||||
firebase_core: ^1.10.5
|
||||
firebase_analytics: ^9.0.3
|
||||
firebase_messaging: ^11.2.3
|
||||
firebase_auth: ^3.3.3
|
||||
firebase_remote_config: ^1.0.2
|
||||
firebase_dynamic_links: ^4.0.2
|
||||
firebase_in_app_messaging: ^0.6.0+4
|
||||
|
||||
syncfusion_flutter_gauges: ^19.3.48
|
||||
syncfusion_flutter_datagrid: ^19.1.63
|
||||
@ -75,11 +75,11 @@ dependencies:
|
||||
syncfusion_flutter_calendar: ^19.3.53
|
||||
syncfusion_localizations: ^19.3.54
|
||||
|
||||
flutter_facebook_auth: ^3.5.1
|
||||
google_sign_in: ^5.0.3
|
||||
sign_in_with_apple: ^3.0.0
|
||||
flutter_facebook_auth: ^3.5.7
|
||||
google_sign_in: ^5.2.1
|
||||
sign_in_with_apple: ^3.3.0
|
||||
|
||||
smartlook: ^2.0.1
|
||||
flutter_smartlook: ^3.0.4
|
||||
#flurry_data: ^0.0.1
|
||||
flutter_uxcam: ^2.0.1
|
||||
|
||||
@ -87,7 +87,7 @@ dependencies:
|
||||
|
||||
mockito: ^5.0.3
|
||||
sqflite: ^2.0.0+3
|
||||
flutter_secure_storage: ^4.2.0
|
||||
flutter_secure_storage: ^5.0.2
|
||||
#social_share: ^2.1.1
|
||||
|
||||
flutter_localizations:
|
||||
|
@ -6,7 +6,7 @@
|
||||
// tree, read text, and verify that the values of widget properties are correct.
|
||||
|
||||
//import 'package:aitrainer_app/bloc/login_form_bloc.dart';
|
||||
import 'package:aitrainer_app/helper/database.dart';
|
||||
/*
|
||||
import 'package:aitrainer_app/library_keys.dart';
|
||||
import 'package:aitrainer_app/util/app_localization.dart';
|
||||
import 'package:aitrainer_app/model/user.dart';
|
||||
@ -16,9 +16,10 @@ import 'package:aitrainer_app/view/login.dart';
|
||||
import 'package:bloc_test/bloc_test.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart'; */
|
||||
import 'package:aitrainer_app/helper/database.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
//import 'package:mockito/mockito.dart';
|
||||
|
||||
void main() {
|
||||
group('SQFLite', () {
|
||||
|
@ -6,7 +6,6 @@
|
||||
// tree, read text, and verify that the values of widget properties are correct.
|
||||
|
||||
//import 'package:aitrainer_app/bloc/login_form_bloc.dart';
|
||||
import 'package:aitrainer_app/bloc/login/login_bloc.dart';
|
||||
import 'package:aitrainer_app/helper/database.dart';
|
||||
import 'package:aitrainer_app/library_keys.dart';
|
||||
import 'package:aitrainer_app/util/app_localization.dart';
|
||||
@ -14,7 +13,7 @@ import 'package:aitrainer_app/model/user.dart';
|
||||
import 'package:aitrainer_app/repository/user_repository.dart';
|
||||
import 'package:aitrainer_app/util/common.dart';
|
||||
import 'package:aitrainer_app/view/login.dart';
|
||||
import 'package:bloc_test/bloc_test.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
|
@ -1,5 +1,5 @@
|
||||
//import 'package:flutter_driver/driver_extension.dart';
|
||||
import 'package:aitrainer_app/main.dart' as app;
|
||||
//import 'package:aitrainer_app/main.dart' as app;
|
||||
|
||||
/* void main() {
|
||||
// This line enables the extension.
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Imports the Flutter Driver API.
|
||||
//import 'package:flutter_driver/flutter_driver.dart';
|
||||
import 'package:test/test.dart';
|
||||
//import 'package:test/test.dart';
|
||||
|
||||
import '../lib/helper/database.dart';
|
||||
//import '../lib/helper/database.dart';
|
||||
/*
|
||||
void main() {
|
||||
FlutterDriver driver;
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'package:aitrainer_app/model/customer.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../lib/helper/database.dart';
|
||||
|
||||
class CustomerApi {
|
||||
|
Loading…
Reference in New Issue
Block a user