diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index c94790b..0548f7f 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ + android:icon="@mipmap/launcher_icon"> /// ****************************** + void showInstructions() { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + backgroundColor: Colors.grey[900], + title: const Text( + 'Instructions', + style: TextStyle( + color: Colors.white, + ), + ), + content: SizedBox( + width: double.maxFinite, + child: ListView.builder( + shrinkWrap: true, + itemCount: widget.exercise.cameraInstructions.length, + itemBuilder: (context, index) { + return ListTile( + title: Text( + "- ${widget.exercise.cameraInstructions[index]}", + style: const TextStyle( + color: Colors.white, + ), + ), + ); + }, + ), + ), + actions: [ + TextButton( + child: const Text( + 'OK', + style: TextStyle( + color: Colors.white, + ), + ), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ); + }, + ); + } + @override void initState() { repCounter = RepCounter(maxRepCount: widget.session.reps); @@ -105,7 +151,7 @@ class _CameraScreenState extends State _accelerationMagnitude = event.x * event.x + event.y * event.y + event.z * event.z; }); - isNotMoving = _accelerationMagnitude < 0.1; + isNotMoving = _accelerationMagnitude == 0.0; /*********************************/ super.initState(); @@ -130,7 +176,9 @@ class _CameraScreenState extends State classifier = PoseDetector(); classifier.loadModel(); - tts.speak("Welcome to Coach.ai! Start your warmup now."); + tts.speak( + "Welcome to Coach.ai! Please read the following instructions carefully."); + showInstructions(); startCameraStream(); } @@ -470,6 +518,7 @@ class _CameraScreenState extends State @override void dispose() { + tts.tts.stop(); cameraController.dispose(); _accelerometerSubscription.cancel(); isolate.stop(); diff --git a/lib/utils/exercise.dart b/lib/utils/exercise.dart index ccdefb3..b6cb4a3 100644 --- a/lib/utils/exercise.dart +++ b/lib/utils/exercise.dart @@ -7,6 +7,7 @@ class Exercise { final int trackingDirection; final String formCorrectnessModel; final List targetedMuscles; + final List cameraInstructions; Exercise({ required this.name, @@ -17,6 +18,7 @@ class Exercise { required this.trackingDirection, required this.formCorrectnessModel, required this.targetedMuscles, + required this.cameraInstructions, }); } @@ -34,6 +36,16 @@ final Exercise pushUps = Exercise( trackingDirection: 0, formCorrectnessModel: 'models/pushUp_version2.tflite', targetedMuscles: ['Chest', 'Triceps', 'Shoulders'], + cameraInstructions: [ + "For this exercise, you need to place your phone in a landscape orientation.", + "While exercising, your phone needs to be in a stable position (i.e. not move).", + "Your phone's camera should be able to view your entire body's right side, specially your right shoulder, since we use it to track your reps", + "Start a warmup for 15 seconds. This is necessary for our AI to calculate some statistics off your body.", + "Once you're done with your warmup, you should be able to start your workout", + "Once you have started a set, you should perform the required number of reps", + "When you're done, go back to your phone and start you rest period", + "If you want to, you can always just finish your set early and take your rest. Remember, exercise is supposed to be fun!", + ], ); final Exercise pullUps = Exercise( @@ -51,6 +63,16 @@ final Exercise pullUps = Exercise( trackingDirection: 1, formCorrectnessModel: 'models/pullUp.tflite', targetedMuscles: ['Back', 'Biceps', 'Shoulders'], + cameraInstructions: [ + "For this exercise, you need to place your phone in a portrait orientation.", + "While exercising, your phone needs to be in a stable position (i.e. not move).", + "Your phone's camera should be able to view your entire body's anterior, specially your nose, since we use it to track your reps", + "Start a warmup for 15 seconds. This is necessary for our AI to calculate some statistics off your body.", + "Once you're done with your warmup, you should be able to start your workout", + "Once you have started a set, you should perform the required number of reps", + "When you're done, go back to your phone and start you rest period", + "If you want to, you can always just finish your set early and take your rest. Remember, exercise is supposed to be fun!", + ], ); final Exercise squats = Exercise( @@ -68,6 +90,16 @@ final Exercise squats = Exercise( trackingDirection: 1, formCorrectnessModel: 'models/squat.tflite', targetedMuscles: ['Quads', 'Hip Flexors', 'Hamstrings', 'Glutes'], + cameraInstructions: [ + "For this exercise, you need to place your phone in a portrait orientation.", + "While exercising, your phone needs to be in a stable position (i.e. not move).", + "Your phone's camera should be able to view your entire body's anterior, specially your nose, since we use it to track your reps", + "Start a warmup for 15 seconds. This is necessary for our AI to calculate some statistics off your body.", + "Once you're done with your warmup, you should be able to start your workout", + "Once you have started a set, you should perform the required number of reps", + "When you're done, go back to your phone and start you rest period", + "If you want to, you can always just finish your set early and take your rest. Remember, exercise is supposed to be fun!", + ], ); /// MoveNet Keypoints constants diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index a2ec33f..96d3fee 100644 --- a/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,68 +1,68 @@ { - "images" : [ - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_16.png", - "scale" : "1x" + "info": { + "version": 1, + "author": "xcode" }, - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "2x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "1x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_64.png", - "scale" : "2x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_128.png", - "scale" : "1x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "2x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "1x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "2x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "1x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_1024.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} + "images": [ + { + "size": "16x16", + "idiom": "mac", + "filename": "app_icon_16.png", + "scale": "1x" + }, + { + "size": "16x16", + "idiom": "mac", + "filename": "app_icon_32.png", + "scale": "2x" + }, + { + "size": "32x32", + "idiom": "mac", + "filename": "app_icon_32.png", + "scale": "1x" + }, + { + "size": "32x32", + "idiom": "mac", + "filename": "app_icon_64.png", + "scale": "2x" + }, + { + "size": "128x128", + "idiom": "mac", + "filename": "app_icon_128.png", + "scale": "1x" + }, + { + "size": "128x128", + "idiom": "mac", + "filename": "app_icon_256.png", + "scale": "2x" + }, + { + "size": "256x256", + "idiom": "mac", + "filename": "app_icon_256.png", + "scale": "1x" + }, + { + "size": "256x256", + "idiom": "mac", + "filename": "app_icon_512.png", + "scale": "2x" + }, + { + "size": "512x512", + "idiom": "mac", + "filename": "app_icon_512.png", + "scale": "1x" + }, + { + "size": "512x512", + "idiom": "mac", + "filename": "app_icon_1024.png", + "scale": "2x" + } + ] +} \ No newline at end of file diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png index 82b6f9d..d4518dd 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png index 13b35eb..451a940 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png index 0a3f5fa..f8f3b43 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png index bdb5722..f3bef0f 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png index f083318..2456b34 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png index 326c0e7..67b3ed2 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png index 2f1632c..6f3819e 100644 Binary files a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png and b/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/pubspec.yaml b/pubspec.yaml index ee6ae8f..fce13b7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,21 +1,7 @@ name: coach_ai description: A new Flutter project. -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: "none" # Remove this line if you wish to publish to pub.dev +publish_to: "none" -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -# In Windows, build-name is used as the major, minor, and patch parts -# of the product and file versions while build-number is used as the build suffix. version: 1.0.0+1 # environment: @@ -24,12 +10,6 @@ version: 1.0.0+1 environment: sdk: ">=2.19.5 <3.0.0" -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter @@ -37,8 +17,6 @@ dependencies: firebase_auth: ^4.5.0 firebase_core_platform_interface: ^4.7.0 firebase_core: ^2.11.0 - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 google_fonts: ^4.0.4 carousel_slider: ^4.0.0 @@ -64,27 +42,34 @@ dev_dependencies: flutter_test: sdk: flutter - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. flutter_lints: ^2.0.1 - flutter_launcher_icons: ^0.11.0 flutter_native_splash: ^2.2.16 + flutter_launcher_icons: "^0.11.0" -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec +flutter_icons: + android: "launcher_icon" + ios: true + image_path: "assets/icon/icon-v2.png" + min_sdk_android: 21 + size: 128 + web: + generate: true + image_path: "assets/icon/icon-v2.png" + background_color: "#363636" + theme_color: "#363636" + windows: + generate: true + image_path: "assets/icon/icon-v2.png" + icon_size: 48 + macos: + generate: true + image_path: "assets/icon/icon-v2.png" -# The following section is specific to Flutter packages. flutter: - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. uses-material-design: true - # To add assets to your application, add an assets section, like this: assets: + - assets/icon/ - assets/models/ - assets/images/nutrition2.jpg - assets/images/image2.png diff --git a/web/favicon.png b/web/favicon.png index 8aaa46a..f8f3b43 100644 Binary files a/web/favicon.png and b/web/favicon.png differ diff --git a/web/icons/Icon-192.png b/web/icons/Icon-192.png index b749bfe..52eb56a 100644 Binary files a/web/icons/Icon-192.png and b/web/icons/Icon-192.png differ diff --git a/web/icons/Icon-512.png b/web/icons/Icon-512.png index 88cfd48..67b3ed2 100644 Binary files a/web/icons/Icon-512.png and b/web/icons/Icon-512.png differ diff --git a/web/icons/Icon-maskable-192.png b/web/icons/Icon-maskable-192.png index eb9b4d7..52eb56a 100644 Binary files a/web/icons/Icon-maskable-192.png and b/web/icons/Icon-maskable-192.png differ diff --git a/web/icons/Icon-maskable-512.png b/web/icons/Icon-maskable-512.png index d69c566..67b3ed2 100644 Binary files a/web/icons/Icon-maskable-512.png and b/web/icons/Icon-maskable-512.png differ diff --git a/web/manifest.json b/web/manifest.json index 94c9d58..bdabe8a 100644 --- a/web/manifest.json +++ b/web/manifest.json @@ -3,8 +3,8 @@ "short_name": "coach_ai", "start_url": ".", "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", + "background_color": "#363636", + "theme_color": "#363636", "description": "A new Flutter project.", "orientation": "portrait-primary", "prefer_related_applications": false, @@ -32,4 +32,4 @@ "purpose": "maskable" } ] -} +} \ No newline at end of file diff --git a/windows/runner/resources/app_icon.ico b/windows/runner/resources/app_icon.ico index c04e20c..751d4f7 100644 Binary files a/windows/runner/resources/app_icon.ico and b/windows/runner/resources/app_icon.ico differ