From d3e5c59cd46930dbf2838aa89042db4b28d5512a Mon Sep 17 00:00:00 2001 From: Oliver Bagge Date: Mon, 11 Mar 2024 17:13:52 +0100 Subject: [PATCH] refactor and clean up code, update README --- open_earable/lib/{ => apps_tab}/apps_tab.dart | 35 ++++---- .../jump_height_test/assets/logo.png | Bin .../jump_height_test/jump_height_chart.dart | 0 .../jump_height_test/jump_height_test.dart | 4 +- .../jump_rope_counter/assets/logo.png | Bin .../jump_rope_counter/jump_rope_counter.dart | 2 +- .../neck_stretch/assets/Head_Front.png | Bin .../neck_stretch/assets/Head_Side.png | Bin .../neck_stretch/assets/Neck_Front.png | Bin .../neck_stretch/assets/Neck_Left_Stretch.png | Bin .../neck_stretch/assets/Neck_Main_Stretch.png | Bin .../assets/Neck_Right_Stretch.png | Bin .../neck_stretch/assets/Neck_Side.png | Bin .../neck_stretch/assets/Neck_Side_Stretch.png | Bin .../neck_stretch/assets/logo.png | Bin .../neck_stretch/assets/logo2.png | Bin .../assets/neck_stretcher_logo.webp | Bin .../assets/neck_stretcher_logo2.webp | Bin .../neck_stretch/model/stretch_colors.dart | 0 .../neck_stretch/model/stretch_state.dart | 16 ++-- .../neck_stretch/view/stretch_app_view.dart | 16 ++-- .../view/stretch_arc_painter.dart | 76 +++++++++--------- .../neck_stretch/view/stretch_roll_view.dart | 11 ++- .../view/stretch_settings_view.dart | 4 +- .../neck_stretch/view/stretch_stats_view.dart | 4 +- .../view/stretch_tracker_view.dart | 10 +-- .../view/stretch_tutorial_view.dart | 10 +-- .../view_model/stretch_view_model.dart | 6 +- .../posture_tracker/assets/Head_Front.png | Bin .../posture_tracker/assets/Head_Side.png | Bin .../posture_tracker/assets/Neck_Front.png | Bin .../posture_tracker/assets/Neck_Side.png | Bin .../posture_tracker/assets/logo.png | Bin .../posture_tracker/model/attitude.dart | 28 +++---- .../model/attitude_tracker.dart | 0 .../model/bad_posture_reminder.dart | 4 +- .../model/earable_attitude_tracker.dart | 4 +- .../posture_tracker/model/ewma.dart | 2 +- .../model/mock_attitude_tracker.dart | 4 +- .../posture_tracker/view/arc_painter.dart | 0 .../view/posture_roll_view.dart | 16 ++-- .../view/posture_tracker_view.dart | 18 ++--- .../posture_tracker/view/settings_view.dart | 4 +- .../posture_tracker_view_model.dart | 25 ++++-- .../powernapper/assets/logo.png | Bin .../powernapper/assets/powernapping.png} | Bin .../powernapper/home_screen.dart | 2 +- .../powernapper/interact.dart | 0 .../powernapper/movementTracker.dart | 4 +- .../powernapper/sensor_datatypes.dart | 0 .../powernapper/timerscreen.dart | 10 +-- .../recorder/assets/logo.png | Bin .../recorder/assets/logo_old.png | Bin .../recorder/lib/recorder.dart | 2 +- .../lib/{apps => apps_tab}/step_counter.dart | 0 .../tightness/assets/logo.png | Bin .../tightness/tightness.dart | 4 +- .../{ble.dart => ble/ble_connect_view.dart} | 2 +- .../lib/{ => ble}/ble_controller.dart | 0 .../lib/controls_tab/views/audio_player.dart | 7 +- .../lib/controls_tab/views/connect.dart | 4 +- .../lib/controls_tab/views/led_color.dart | 9 ++- .../views/sensor_configuration.dart | 4 +- open_earable/lib/main.dart | 10 +-- .../lib/sensor_data_tab/earable_3d_model.dart | 4 +- .../lib/sensor_data_tab/sensor_chart.dart | 5 +- .../lib/sensor_data_tab/sensor_data_tab.dart | 3 - .../dynamic_value_picker.dart | 0 .../earable_not_connected_warning.dart | 0 .../lib/{ => shared}/global_theme.dart | 0 .../{ => shared}/open_earable_icon_icons.dart | 0 open_earable/pubspec.yaml | 14 ++-- 72 files changed, 197 insertions(+), 186 deletions(-) rename open_earable/lib/{ => apps_tab}/apps_tab.dart (81%) rename open_earable/lib/{apps => apps_tab}/jump_height_test/assets/logo.png (100%) rename open_earable/lib/{apps => apps_tab}/jump_height_test/jump_height_chart.dart (100%) rename open_earable/lib/{apps => apps_tab}/jump_height_test/jump_height_test.dart (98%) rename open_earable/lib/{apps => apps_tab}/jump_rope_counter/assets/logo.png (100%) rename open_earable/lib/{apps => apps_tab}/jump_rope_counter/jump_rope_counter.dart (99%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/assets/Head_Front.png (100%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/assets/Head_Side.png (100%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/assets/Neck_Front.png (100%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/assets/Neck_Left_Stretch.png (100%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/assets/Neck_Main_Stretch.png (100%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/assets/Neck_Right_Stretch.png (100%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/assets/Neck_Side.png (100%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/assets/Neck_Side_Stretch.png (100%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/assets/logo.png (100%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/assets/logo2.png (100%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/assets/neck_stretcher_logo.webp (100%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/assets/neck_stretcher_logo2.webp (100%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/model/stretch_colors.dart (100%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/model/stretch_state.dart (92%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/view/stretch_app_view.dart (88%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/view/stretch_arc_painter.dart (73%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/view/stretch_roll_view.dart (86%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/view/stretch_settings_view.dart (98%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/view/stretch_stats_view.dart (94%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/view/stretch_tracker_view.dart (95%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/view/stretch_tutorial_view.dart (97%) rename open_earable/lib/{apps => apps_tab}/neck_stretch/view_model/stretch_view_model.dart (94%) rename open_earable/lib/{apps => apps_tab}/posture_tracker/assets/Head_Front.png (100%) rename open_earable/lib/{apps => apps_tab}/posture_tracker/assets/Head_Side.png (100%) rename open_earable/lib/{apps => apps_tab}/posture_tracker/assets/Neck_Front.png (100%) rename open_earable/lib/{apps => apps_tab}/posture_tracker/assets/Neck_Side.png (100%) rename open_earable/lib/{apps => apps_tab}/posture_tracker/assets/logo.png (100%) rename open_earable/lib/{apps => apps_tab}/posture_tracker/model/attitude.dart (57%) rename open_earable/lib/{apps => apps_tab}/posture_tracker/model/attitude_tracker.dart (100%) rename open_earable/lib/{apps => apps_tab}/posture_tracker/model/bad_posture_reminder.dart (96%) rename open_earable/lib/{apps => apps_tab}/posture_tracker/model/earable_attitude_tracker.dart (90%) rename open_earable/lib/{apps => apps_tab}/posture_tracker/model/ewma.dart (99%) rename open_earable/lib/{apps => apps_tab}/posture_tracker/model/mock_attitude_tracker.dart (90%) rename open_earable/lib/{apps => apps_tab}/posture_tracker/view/arc_painter.dart (100%) rename open_earable/lib/{apps => apps_tab}/posture_tracker/view/posture_roll_view.dart (85%) rename open_earable/lib/{apps => apps_tab}/posture_tracker/view/posture_tracker_view.dart (85%) rename open_earable/lib/{apps => apps_tab}/posture_tracker/view/settings_view.dart (98%) rename open_earable/lib/{apps => apps_tab}/posture_tracker/view_model/posture_tracker_view_model.dart (72%) rename open_earable/lib/{apps => apps_tab}/powernapper/assets/logo.png (100%) rename open_earable/{assets/powernapping_timer/198155.png => lib/apps_tab/powernapper/assets/powernapping.png} (100%) rename open_earable/lib/{apps => apps_tab}/powernapper/home_screen.dart (97%) rename open_earable/lib/{apps => apps_tab}/powernapper/interact.dart (100%) rename open_earable/lib/{apps => apps_tab}/powernapper/movementTracker.dart (94%) rename open_earable/lib/{apps => apps_tab}/powernapper/sensor_datatypes.dart (100%) rename open_earable/lib/{apps => apps_tab}/powernapper/timerscreen.dart (92%) rename open_earable/lib/{apps => apps_tab}/recorder/assets/logo.png (100%) rename open_earable/lib/{apps => apps_tab}/recorder/assets/logo_old.png (100%) rename open_earable/lib/{apps => apps_tab}/recorder/lib/recorder.dart (99%) rename open_earable/lib/{apps => apps_tab}/step_counter.dart (100%) rename open_earable/lib/{apps => apps_tab}/tightness/assets/logo.png (100%) rename open_earable/lib/{apps => apps_tab}/tightness/tightness.dart (96%) rename open_earable/lib/{ble.dart => ble/ble_connect_view.dart} (99%) rename open_earable/lib/{ => ble}/ble_controller.dart (100%) rename open_earable/lib/{widgets => shared}/dynamic_value_picker.dart (100%) rename open_earable/lib/{widgets => shared}/earable_not_connected_warning.dart (100%) rename open_earable/lib/{ => shared}/global_theme.dart (100%) rename open_earable/lib/{ => shared}/open_earable_icon_icons.dart (100%) diff --git a/open_earable/lib/apps_tab.dart b/open_earable/lib/apps_tab/apps_tab.dart similarity index 81% rename from open_earable/lib/apps_tab.dart rename to open_earable/lib/apps_tab/apps_tab.dart index 531bee6..b260b9d 100644 --- a/open_earable/lib/apps_tab.dart +++ b/open_earable/lib/apps_tab/apps_tab.dart @@ -2,16 +2,16 @@ import 'dart:io'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:open_earable/apps/posture_tracker/model/earable_attitude_tracker.dart'; -import 'package:open_earable/apps/posture_tracker/view/posture_tracker_view.dart'; -import 'package:open_earable/apps/neck_stretch/view/stretch_app_view.dart'; -import 'package:open_earable/apps/tightness/tightness.dart'; -import 'package:open_earable/apps/recorder/lib/recorder.dart'; -import 'package:open_earable/apps/jump_height_test/jump_height_test.dart'; +import 'package:open_earable/apps_tab/posture_tracker/model/earable_attitude_tracker.dart'; +import 'package:open_earable/apps_tab/posture_tracker/view/posture_tracker_view.dart'; +import 'package:open_earable/apps_tab/neck_stretch/view/stretch_app_view.dart'; +import 'package:open_earable/apps_tab/tightness/tightness.dart'; +import 'package:open_earable/apps_tab/recorder/lib/recorder.dart'; +import 'package:open_earable/apps_tab/jump_height_test/jump_height_test.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; -import 'global_theme.dart'; -import 'package:open_earable/apps/jump_rope_counter/jump_rope_counter.dart'; -import 'apps/powernapper/home_screen.dart'; +import '../shared/global_theme.dart'; +import 'package:open_earable/apps_tab/jump_rope_counter/jump_rope_counter.dart'; +import 'powernapper/home_screen.dart'; class AppInfo { final String logoPath; @@ -34,7 +34,7 @@ class AppsTab extends StatelessWidget { List sampleApps(BuildContext context) { return [ AppInfo( - logoPath: "lib/apps/recorder/assets/logo.png", + logoPath: "lib/apps_tab/recorder/assets/logo.png", title: "Recorder", description: "Record data from OpenEarable", onTap: () { @@ -48,7 +48,7 @@ class AppsTab extends StatelessWidget { }), AppInfo( logoPath: - "lib/apps/posture_tracker/assets/logo.png", //iconData: Icons.face_6, + "lib/apps_tab/posture_tracker/assets/logo.png", //iconData: Icons.face_6, title: "Posture Tracker", description: "Get feedback on bad posture", onTap: () { @@ -63,7 +63,8 @@ class AppsTab extends StatelessWidget { _openEarable))))); }), AppInfo( - logoPath: "lib/apps/jump_height_test/assets/logo.png", //Icons.height, + logoPath: + "lib/apps_tab/jump_height_test/assets/logo.png", //Icons.height, title: "Jump Height Test", description: "Measure the height of your jumps", onTap: () { @@ -78,7 +79,7 @@ class AppsTab extends StatelessWidget { }), AppInfo( logoPath: - "lib/apps/jump_rope_counter/assets/logo.png", //iconData: Icons.keyboard_double_arrow_up, + "lib/apps_tab/jump_rope_counter/assets/logo.png", //iconData: Icons.keyboard_double_arrow_up, title: "Jump Rope Counter", description: "Count your rope skips", onTap: () { @@ -92,8 +93,8 @@ class AppsTab extends StatelessWidget { }), AppInfo( logoPath: - "lib/apps/powernapper/assets/logo.png", //iconData: Icons.face_5, - title: "Powernapping", + "lib/apps_tab/powernapper/assets/logo.png", //iconData: Icons.face_5, + title: "Powernapper", description: "Time starts when you're asleep", onTap: () { Navigator.push( @@ -106,7 +107,7 @@ class AppsTab extends StatelessWidget { }), AppInfo( logoPath: - "lib/apps/tightness/assets/logo.png", //iconData: Icons.music_note, + "lib/apps_tab/tightness/assets/logo.png", //iconData: Icons.music_note, title: "Tightness Meter", description: "Practice your sense of rythm", onTap: () { @@ -119,7 +120,7 @@ class AppsTab extends StatelessWidget { child: TightnessMeter(_openEarable))))); }), AppInfo( - logoPath: "lib/apps/neck_stretch/assets/logo.png", + logoPath: "lib/apps_tab/neck_stretch/assets/logo.png", title: "Guided Neck Stretch", description: "Relax your neck with a stretch.", onTap: () { diff --git a/open_earable/lib/apps/jump_height_test/assets/logo.png b/open_earable/lib/apps_tab/jump_height_test/assets/logo.png similarity index 100% rename from open_earable/lib/apps/jump_height_test/assets/logo.png rename to open_earable/lib/apps_tab/jump_height_test/assets/logo.png diff --git a/open_earable/lib/apps/jump_height_test/jump_height_chart.dart b/open_earable/lib/apps_tab/jump_height_test/jump_height_chart.dart similarity index 100% rename from open_earable/lib/apps/jump_height_test/jump_height_chart.dart rename to open_earable/lib/apps_tab/jump_height_test/jump_height_chart.dart diff --git a/open_earable/lib/apps/jump_height_test/jump_height_test.dart b/open_earable/lib/apps_tab/jump_height_test/jump_height_test.dart similarity index 98% rename from open_earable/lib/apps/jump_height_test/jump_height_test.dart rename to open_earable/lib/apps_tab/jump_height_test/jump_height_test.dart index 436ea1a..4ae9a02 100644 --- a/open_earable/lib/apps/jump_height_test/jump_height_test.dart +++ b/open_earable/lib/apps_tab/jump_height_test/jump_height_test.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; -import 'package:open_earable/apps/jump_height_test/jump_height_chart.dart'; +import 'package:open_earable/apps_tab/jump_height_test/jump_height_chart.dart'; import 'dart:async'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; import 'package:simple_kalman/simple_kalman.dart'; import 'dart:math'; -import '../../widgets/earable_not_connected_warning.dart'; +import 'package:open_earable/shared/earable_not_connected_warning.dart'; /// An app that lets you test your jump height using an OpenEarable device. class JumpHeightTest extends StatefulWidget { diff --git a/open_earable/lib/apps/jump_rope_counter/assets/logo.png b/open_earable/lib/apps_tab/jump_rope_counter/assets/logo.png similarity index 100% rename from open_earable/lib/apps/jump_rope_counter/assets/logo.png rename to open_earable/lib/apps_tab/jump_rope_counter/assets/logo.png diff --git a/open_earable/lib/apps/jump_rope_counter/jump_rope_counter.dart b/open_earable/lib/apps_tab/jump_rope_counter/jump_rope_counter.dart similarity index 99% rename from open_earable/lib/apps/jump_rope_counter/jump_rope_counter.dart rename to open_earable/lib/apps_tab/jump_rope_counter/jump_rope_counter.dart index 4d998a4..399aeb1 100644 --- a/open_earable/lib/apps/jump_rope_counter/jump_rope_counter.dart +++ b/open_earable/lib/apps_tab/jump_rope_counter/jump_rope_counter.dart @@ -1,7 +1,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; -import 'package:open_earable/widgets/earable_not_connected_warning.dart'; +import 'package:open_earable/shared/earable_not_connected_warning.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; import 'dart:async'; import 'package:intl/intl.dart'; diff --git a/open_earable/lib/apps/neck_stretch/assets/Head_Front.png b/open_earable/lib/apps_tab/neck_stretch/assets/Head_Front.png similarity index 100% rename from open_earable/lib/apps/neck_stretch/assets/Head_Front.png rename to open_earable/lib/apps_tab/neck_stretch/assets/Head_Front.png diff --git a/open_earable/lib/apps/neck_stretch/assets/Head_Side.png b/open_earable/lib/apps_tab/neck_stretch/assets/Head_Side.png similarity index 100% rename from open_earable/lib/apps/neck_stretch/assets/Head_Side.png rename to open_earable/lib/apps_tab/neck_stretch/assets/Head_Side.png diff --git a/open_earable/lib/apps/neck_stretch/assets/Neck_Front.png b/open_earable/lib/apps_tab/neck_stretch/assets/Neck_Front.png similarity index 100% rename from open_earable/lib/apps/neck_stretch/assets/Neck_Front.png rename to open_earable/lib/apps_tab/neck_stretch/assets/Neck_Front.png diff --git a/open_earable/lib/apps/neck_stretch/assets/Neck_Left_Stretch.png b/open_earable/lib/apps_tab/neck_stretch/assets/Neck_Left_Stretch.png similarity index 100% rename from open_earable/lib/apps/neck_stretch/assets/Neck_Left_Stretch.png rename to open_earable/lib/apps_tab/neck_stretch/assets/Neck_Left_Stretch.png diff --git a/open_earable/lib/apps/neck_stretch/assets/Neck_Main_Stretch.png b/open_earable/lib/apps_tab/neck_stretch/assets/Neck_Main_Stretch.png similarity index 100% rename from open_earable/lib/apps/neck_stretch/assets/Neck_Main_Stretch.png rename to open_earable/lib/apps_tab/neck_stretch/assets/Neck_Main_Stretch.png diff --git a/open_earable/lib/apps/neck_stretch/assets/Neck_Right_Stretch.png b/open_earable/lib/apps_tab/neck_stretch/assets/Neck_Right_Stretch.png similarity index 100% rename from open_earable/lib/apps/neck_stretch/assets/Neck_Right_Stretch.png rename to open_earable/lib/apps_tab/neck_stretch/assets/Neck_Right_Stretch.png diff --git a/open_earable/lib/apps/neck_stretch/assets/Neck_Side.png b/open_earable/lib/apps_tab/neck_stretch/assets/Neck_Side.png similarity index 100% rename from open_earable/lib/apps/neck_stretch/assets/Neck_Side.png rename to open_earable/lib/apps_tab/neck_stretch/assets/Neck_Side.png diff --git a/open_earable/lib/apps/neck_stretch/assets/Neck_Side_Stretch.png b/open_earable/lib/apps_tab/neck_stretch/assets/Neck_Side_Stretch.png similarity index 100% rename from open_earable/lib/apps/neck_stretch/assets/Neck_Side_Stretch.png rename to open_earable/lib/apps_tab/neck_stretch/assets/Neck_Side_Stretch.png diff --git a/open_earable/lib/apps/neck_stretch/assets/logo.png b/open_earable/lib/apps_tab/neck_stretch/assets/logo.png similarity index 100% rename from open_earable/lib/apps/neck_stretch/assets/logo.png rename to open_earable/lib/apps_tab/neck_stretch/assets/logo.png diff --git a/open_earable/lib/apps/neck_stretch/assets/logo2.png b/open_earable/lib/apps_tab/neck_stretch/assets/logo2.png similarity index 100% rename from open_earable/lib/apps/neck_stretch/assets/logo2.png rename to open_earable/lib/apps_tab/neck_stretch/assets/logo2.png diff --git a/open_earable/lib/apps/neck_stretch/assets/neck_stretcher_logo.webp b/open_earable/lib/apps_tab/neck_stretch/assets/neck_stretcher_logo.webp similarity index 100% rename from open_earable/lib/apps/neck_stretch/assets/neck_stretcher_logo.webp rename to open_earable/lib/apps_tab/neck_stretch/assets/neck_stretcher_logo.webp diff --git a/open_earable/lib/apps/neck_stretch/assets/neck_stretcher_logo2.webp b/open_earable/lib/apps_tab/neck_stretch/assets/neck_stretcher_logo2.webp similarity index 100% rename from open_earable/lib/apps/neck_stretch/assets/neck_stretcher_logo2.webp rename to open_earable/lib/apps_tab/neck_stretch/assets/neck_stretcher_logo2.webp diff --git a/open_earable/lib/apps/neck_stretch/model/stretch_colors.dart b/open_earable/lib/apps_tab/neck_stretch/model/stretch_colors.dart similarity index 100% rename from open_earable/lib/apps/neck_stretch/model/stretch_colors.dart rename to open_earable/lib/apps_tab/neck_stretch/model/stretch_colors.dart diff --git a/open_earable/lib/apps/neck_stretch/model/stretch_state.dart b/open_earable/lib/apps_tab/neck_stretch/model/stretch_state.dart similarity index 92% rename from open_earable/lib/apps/neck_stretch/model/stretch_state.dart rename to open_earable/lib/apps_tab/neck_stretch/model/stretch_state.dart index 79c5b40..7d37f27 100644 --- a/open_earable/lib/apps/neck_stretch/model/stretch_state.dart +++ b/open_earable/lib/apps_tab/neck_stretch/model/stretch_state.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:open_earable/apps/neck_stretch/view_model/stretch_view_model.dart'; +import 'package:open_earable/apps_tab/neck_stretch/view_model/stretch_view_model.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; /// Enum for the neck stretch states @@ -33,11 +33,11 @@ extension NeckStretchStateExtension on NeckStretchState { String get assetPathNeckFront { switch (this) { case NeckStretchState.rightNeckStretch: - return 'lib/apps/neck_stretch/assets/Neck_Right_Stretch.png'; + return 'lib/apps_tab/neck_stretch/assets/Neck_Right_Stretch.png'; case NeckStretchState.leftNeckStretch: - return 'lib/apps/neck_stretch/assets/Neck_Left_Stretch.png'; + return 'lib/apps_tab/neck_stretch/assets/Neck_Left_Stretch.png'; default: - return 'lib/apps/neck_stretch/assets/Neck_Front.png'; + return 'lib/apps_tab/neck_stretch/assets/Neck_Front.png'; } } @@ -45,20 +45,20 @@ extension NeckStretchStateExtension on NeckStretchState { String get assetPathNeckSide { switch (this) { case NeckStretchState.mainNeckStretch: - return 'lib/apps/neck_stretch/assets/Neck_Main_Stretch.png'; + return 'lib/apps_tab/neck_stretch/assets/Neck_Main_Stretch.png'; default: - return 'lib/apps/neck_stretch/assets/Neck_Side.png'; + return 'lib/apps_tab/neck_stretch/assets/Neck_Side.png'; } } /// Gets the corresponding asset path for the Head Front Image String get assetPathHeadFront { - return 'lib/apps/neck_stretch/assets/Head_Front.png'; + return 'lib/apps_tab/neck_stretch/assets/Head_Front.png'; } /// Gets the corresponding asset path for the Head Side Image String get assetPathHeadSide { - return 'lib/apps/neck_stretch/assets/Head_Side.png'; + return 'lib/apps_tab/neck_stretch/assets/Head_Side.png'; } } diff --git a/open_earable/lib/apps/neck_stretch/view/stretch_app_view.dart b/open_earable/lib/apps_tab/neck_stretch/view/stretch_app_view.dart similarity index 88% rename from open_earable/lib/apps/neck_stretch/view/stretch_app_view.dart rename to open_earable/lib/apps_tab/neck_stretch/view/stretch_app_view.dart index 4b25011..0dfc38b 100644 --- a/open_earable/lib/apps/neck_stretch/view/stretch_app_view.dart +++ b/open_earable/lib/apps_tab/neck_stretch/view/stretch_app_view.dart @@ -1,13 +1,13 @@ import 'package:flutter/material.dart'; -import 'package:open_earable/apps/posture_tracker/model/attitude_tracker.dart'; -import 'package:open_earable/apps/neck_stretch/view/stretch_tracker_view.dart'; -import 'package:open_earable/apps/neck_stretch/view/stretch_tutorial_view.dart'; -import 'package:open_earable/apps/neck_stretch/view_model/stretch_view_model.dart'; -import 'package:open_earable/apps/neck_stretch/model/stretch_state.dart'; -import 'package:open_earable/apps/neck_stretch/view/stretch_settings_view.dart'; -import 'package:open_earable/apps/neck_stretch/view/stretch_stats_view.dart'; -import 'package:open_earable/global_theme.dart'; +import 'package:open_earable/apps_tab/posture_tracker/model/attitude_tracker.dart'; +import 'package:open_earable/apps_tab/neck_stretch/view/stretch_tracker_view.dart'; +import 'package:open_earable/apps_tab/neck_stretch/view/stretch_tutorial_view.dart'; +import 'package:open_earable/apps_tab/neck_stretch/view_model/stretch_view_model.dart'; +import 'package:open_earable/apps_tab/neck_stretch/model/stretch_state.dart'; +import 'package:open_earable/apps_tab/neck_stretch/view/stretch_settings_view.dart'; +import 'package:open_earable/apps_tab/neck_stretch/view/stretch_stats_view.dart'; +import 'package:open_earable/shared/global_theme.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; diff --git a/open_earable/lib/apps/neck_stretch/view/stretch_arc_painter.dart b/open_earable/lib/apps_tab/neck_stretch/view/stretch_arc_painter.dart similarity index 73% rename from open_earable/lib/apps/neck_stretch/view/stretch_arc_painter.dart rename to open_earable/lib/apps_tab/neck_stretch/view/stretch_arc_painter.dart index 3abab82..abf15f6 100644 --- a/open_earable/lib/apps/neck_stretch/view/stretch_arc_painter.dart +++ b/open_earable/lib/apps_tab/neck_stretch/view/stretch_arc_painter.dart @@ -1,10 +1,9 @@ import 'dart:math'; import 'package:flutter/material.dart'; -import 'package:open_earable/apps/neck_stretch/model/stretch_state.dart'; -import 'package:open_earable/apps/posture_tracker/view/arc_painter.dart'; -import 'package:open_earable/apps/neck_stretch/model/stretch_colors.dart'; - +import 'package:open_earable/apps_tab/neck_stretch/model/stretch_state.dart'; +import 'package:open_earable/apps_tab/posture_tracker/view/arc_painter.dart'; +import 'package:open_earable/apps_tab/neck_stretch/model/stretch_colors.dart'; class StretchArcPainter extends CustomPainter { /// the angle of rotation @@ -13,10 +12,11 @@ class StretchArcPainter extends CustomPainter { final NeckStretchState stretchState; final bool isFront; - StretchArcPainter({required this.angle, - this.angleThreshold = 0, - this.stretchState = NeckStretchState.noStretch, - required this.isFront}); + StretchArcPainter( + {required this.angle, + this.angleThreshold = 0, + this.stretchState = NeckStretchState.noStretch, + required this.isFront}); @override void paint(Canvas canvas, Size size) { @@ -69,39 +69,41 @@ class StretchArcPainter extends CustomPainter { ); } else { angleOvershootPath.addArc( - Rect.fromCircle(center: center, radius: radius), - // create a rectangle from the center and radius - startAngle + angle.sign * angleThreshold, // start angle - // If you are facing the wrong direction you don't need to draw this - !_isWrongStretchDirection() ? angle.sign * (angle.abs() - angleThreshold) : 0, // sweep angle - ); + Rect.fromCircle(center: center, radius: radius), + // create a rectangle from the center and radius + startAngle + angle.sign * angleThreshold, // start angle + // If you are facing the wrong direction you don't need to draw this + !_isWrongStretchDirection() + ? angle.sign * (angle.abs() - angleThreshold) + : 0, // sweep angle + ); } Paint angleOvershootPaint = Paint() - ..color = _getOvershootColor() - ..style = PaintingStyle.stroke - ..strokeCap = StrokeCap.round - ..strokeWidth = 5.0; + ..color = _getOvershootColor() + ..style = PaintingStyle.stroke + ..strokeCap = StrokeCap.round + ..strokeWidth = 5.0; Path thresholdPath = Path(); thresholdPath.addArc( - Rect.fromCircle(center: center, radius: radius), - // create a rectangle from the center and radius - _getStartAngle(startAngle, angleThreshold), // start angle - _getThreshold(angleThreshold), // sweep angle + Rect.fromCircle(center: center, radius: radius), + // create a rectangle from the center and radius + _getStartAngle(startAngle, angleThreshold), // start angle + _getThreshold(angleThreshold), // sweep angle ); Paint thresholdPaint = Paint() - ..color = _getThresholdColor() - ..style = PaintingStyle.stroke - ..strokeCap = StrokeCap.round - ..strokeWidth = 5.0; + ..color = _getThresholdColor() + ..style = PaintingStyle.stroke + ..strokeCap = StrokeCap.round + ..strokeWidth = 5.0; // Draw the path on the canvas canvas.drawPath(thresholdPath, thresholdPaint); canvas.drawPath(anglePath, anglePaint); if (angle.abs() > angleThreshold.abs()) { - canvas.drawPath(angleOvershootPath, angleOvershootPaint); + canvas.drawPath(angleOvershootPath, angleOvershootPaint); } } @@ -125,7 +127,9 @@ class StretchArcPainter extends CustomPainter { switch (this.stretchState) { case NeckStretchState.rightNeckStretch: case NeckStretchState.leftNeckStretch: - return threshold + (0.775 * pi); // Will place the dark grey area till the start of the neck + return threshold + + (0.775 * + pi); // Will place the dark grey area till the start of the neck default: return 2 * threshold; } @@ -133,7 +137,9 @@ class StretchArcPainter extends CustomPainter { switch (this.stretchState) { case NeckStretchState.mainNeckStretch: - return threshold + (0.8 * pi); // Will place the dark grey area till the start of the neck + return threshold + + (0.8 * + pi); // Will place the dark grey area till the start of the neck default: return 2 * threshold; } @@ -164,7 +170,7 @@ class StretchArcPainter extends CustomPainter { /// or is positive (should stretch that part) bool _isNegativeOvershoot() { return (this.isFront && - this.stretchState == NeckStretchState.mainNeckStretch) || + this.stretchState == NeckStretchState.mainNeckStretch) || (!this.isFront && (this.stretchState == NeckStretchState.leftNeckStretch || this.stretchState == NeckStretchState.rightNeckStretch)); @@ -193,13 +199,9 @@ class StretchArcPainter extends CustomPainter { /// Gets the right indicator color depending on stretch angle and part Color _getIndicatorColor() { - if(_isNegativeOvershoot()) - return goodStretchColor; - - - if(_isWrongStretchDirection()) - return badStretchIndicatorColor; + if (_isNegativeOvershoot()) return goodStretchColor; + if (_isWrongStretchDirection()) return badStretchIndicatorColor; return goodStretchIndicatorColor; } @@ -209,4 +211,4 @@ class StretchArcPainter extends CustomPainter { // check if oldDelegate is an ArcPainter and if the angle is the same return oldDelegate is ArcPainter && oldDelegate.angle != this.angle; } -} \ No newline at end of file +} diff --git a/open_earable/lib/apps/neck_stretch/view/stretch_roll_view.dart b/open_earable/lib/apps_tab/neck_stretch/view/stretch_roll_view.dart similarity index 86% rename from open_earable/lib/apps/neck_stretch/view/stretch_roll_view.dart rename to open_earable/lib/apps_tab/neck_stretch/view/stretch_roll_view.dart index 2e79215..31d8c6d 100644 --- a/open_earable/lib/apps/neck_stretch/view/stretch_roll_view.dart +++ b/open_earable/lib/apps_tab/neck_stretch/view/stretch_roll_view.dart @@ -1,8 +1,8 @@ import 'dart:math'; import 'package:flutter/material.dart'; -import 'package:open_earable/apps/neck_stretch/model/stretch_state.dart'; -import 'package:open_earable/apps/neck_stretch/view/stretch_arc_painter.dart'; +import 'package:open_earable/apps_tab/neck_stretch/model/stretch_state.dart'; +import 'package:open_earable/apps_tab/neck_stretch/view/stretch_arc_painter.dart'; /// A widget that displays the roll of the head and neck for the meditation. class StretchRollView extends StatelessWidget { @@ -44,8 +44,11 @@ class StretchRollView extends StatelessWidget { fontSize: 30, fontWeight: FontWeight.bold)), CustomPaint( - painter: - StretchArcPainter(angle: this.roll, angleThreshold: this.angleThreshold, stretchState: this.stretchState, isFront: _isFront()), + painter: StretchArcPainter( + angle: this.roll, + angleThreshold: this.angleThreshold, + stretchState: this.stretchState, + isFront: _isFront()), child: Padding( padding: EdgeInsets.all(10), child: ClipOval( diff --git a/open_earable/lib/apps/neck_stretch/view/stretch_settings_view.dart b/open_earable/lib/apps_tab/neck_stretch/view/stretch_settings_view.dart similarity index 98% rename from open_earable/lib/apps/neck_stretch/view/stretch_settings_view.dart rename to open_earable/lib/apps_tab/neck_stretch/view/stretch_settings_view.dart index 972df96..213ffa3 100644 --- a/open_earable/lib/apps/neck_stretch/view/stretch_settings_view.dart +++ b/open_earable/lib/apps_tab/neck_stretch/view/stretch_settings_view.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:open_earable/apps/neck_stretch/model/stretch_state.dart'; -import 'package:open_earable/apps/neck_stretch/view_model/stretch_view_model.dart'; +import 'package:open_earable/apps_tab/neck_stretch/model/stretch_state.dart'; +import 'package:open_earable/apps_tab/neck_stretch/view_model/stretch_view_model.dart'; import 'package:provider/provider.dart'; import 'dart:core'; diff --git a/open_earable/lib/apps/neck_stretch/view/stretch_stats_view.dart b/open_earable/lib/apps_tab/neck_stretch/view/stretch_stats_view.dart similarity index 94% rename from open_earable/lib/apps/neck_stretch/view/stretch_stats_view.dart rename to open_earable/lib/apps_tab/neck_stretch/view/stretch_stats_view.dart index 68e444a..ea83867 100644 --- a/open_earable/lib/apps/neck_stretch/view/stretch_stats_view.dart +++ b/open_earable/lib/apps_tab/neck_stretch/view/stretch_stats_view.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:open_earable/apps/neck_stretch/model/stretch_state.dart'; -import 'package:open_earable/apps/neck_stretch/view_model/stretch_view_model.dart'; +import 'package:open_earable/apps_tab/neck_stretch/model/stretch_state.dart'; +import 'package:open_earable/apps_tab/neck_stretch/view_model/stretch_view_model.dart'; class StretchStatsView extends StatefulWidget { final StretchViewModel _viewModel; diff --git a/open_earable/lib/apps/neck_stretch/view/stretch_tracker_view.dart b/open_earable/lib/apps_tab/neck_stretch/view/stretch_tracker_view.dart similarity index 95% rename from open_earable/lib/apps/neck_stretch/view/stretch_tracker_view.dart rename to open_earable/lib/apps_tab/neck_stretch/view/stretch_tracker_view.dart index a69f9c9..6194000 100644 --- a/open_earable/lib/apps/neck_stretch/view/stretch_tracker_view.dart +++ b/open_earable/lib/apps_tab/neck_stretch/view/stretch_tracker_view.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:open_earable/apps/neck_stretch/view/stretch_roll_view.dart'; -import 'package:open_earable/apps/neck_stretch/view_model/stretch_view_model.dart'; -import 'package:open_earable/apps/neck_stretch/model/stretch_state.dart'; -import 'package:open_earable/apps/neck_stretch/view/stretch_settings_view.dart'; -import 'package:open_earable/apps/neck_stretch/model/stretch_colors.dart'; +import 'package:open_earable/apps_tab/neck_stretch/view/stretch_roll_view.dart'; +import 'package:open_earable/apps_tab/neck_stretch/view_model/stretch_view_model.dart'; +import 'package:open_earable/apps_tab/neck_stretch/model/stretch_state.dart'; +import 'package:open_earable/apps_tab/neck_stretch/view/stretch_settings_view.dart'; +import 'package:open_earable/apps_tab/neck_stretch/model/stretch_colors.dart'; class StretchTrackerView extends StatefulWidget { final StretchViewModel _viewModel; diff --git a/open_earable/lib/apps/neck_stretch/view/stretch_tutorial_view.dart b/open_earable/lib/apps_tab/neck_stretch/view/stretch_tutorial_view.dart similarity index 97% rename from open_earable/lib/apps/neck_stretch/view/stretch_tutorial_view.dart rename to open_earable/lib/apps_tab/neck_stretch/view/stretch_tutorial_view.dart index 17414f0..77437d5 100644 --- a/open_earable/lib/apps/neck_stretch/view/stretch_tutorial_view.dart +++ b/open_earable/lib/apps_tab/neck_stretch/view/stretch_tutorial_view.dart @@ -3,11 +3,11 @@ import 'package:provider/provider.dart'; import 'package:youtube_player_flutter/youtube_player_flutter.dart'; -import 'package:open_earable/apps/neck_stretch/model/stretch_colors.dart'; -import 'package:open_earable/apps/neck_stretch/view/stretch_tracker_view.dart'; -import 'package:open_earable/apps/neck_stretch/view_model/stretch_view_model.dart'; -import 'package:open_earable/apps/neck_stretch/model/stretch_state.dart'; -import 'package:open_earable/apps/neck_stretch/view/stretch_settings_view.dart'; +import 'package:open_earable/apps_tab/neck_stretch/model/stretch_colors.dart'; +import 'package:open_earable/apps_tab/neck_stretch/view/stretch_tracker_view.dart'; +import 'package:open_earable/apps_tab/neck_stretch/view_model/stretch_view_model.dart'; +import 'package:open_earable/apps_tab/neck_stretch/model/stretch_state.dart'; +import 'package:open_earable/apps_tab/neck_stretch/view/stretch_settings_view.dart'; class StretchTutorialView extends StatefulWidget { final StretchViewModel _viewModel; diff --git a/open_earable/lib/apps/neck_stretch/view_model/stretch_view_model.dart b/open_earable/lib/apps_tab/neck_stretch/view_model/stretch_view_model.dart similarity index 94% rename from open_earable/lib/apps/neck_stretch/view_model/stretch_view_model.dart rename to open_earable/lib/apps_tab/neck_stretch/view_model/stretch_view_model.dart index 9b4a9e6..7b49e9e 100644 --- a/open_earable/lib/apps/neck_stretch/view_model/stretch_view_model.dart +++ b/open_earable/lib/apps_tab/neck_stretch/view_model/stretch_view_model.dart @@ -1,9 +1,9 @@ import "dart:core"; import "dart:async"; import "package:flutter/material.dart"; -import "package:open_earable/apps/posture_tracker/model/attitude.dart"; -import "package:open_earable/apps/posture_tracker/model/attitude_tracker.dart"; -import 'package:open_earable/apps/neck_stretch/model/stretch_state.dart'; +import 'package:open_earable/apps_tab/posture_tracker/model/attitude.dart'; +import 'package:open_earable/apps_tab/posture_tracker/model/attitude_tracker.dart'; +import 'package:open_earable/apps_tab/neck_stretch/model/stretch_state.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; class StretchViewModel extends ChangeNotifier { diff --git a/open_earable/lib/apps/posture_tracker/assets/Head_Front.png b/open_earable/lib/apps_tab/posture_tracker/assets/Head_Front.png similarity index 100% rename from open_earable/lib/apps/posture_tracker/assets/Head_Front.png rename to open_earable/lib/apps_tab/posture_tracker/assets/Head_Front.png diff --git a/open_earable/lib/apps/posture_tracker/assets/Head_Side.png b/open_earable/lib/apps_tab/posture_tracker/assets/Head_Side.png similarity index 100% rename from open_earable/lib/apps/posture_tracker/assets/Head_Side.png rename to open_earable/lib/apps_tab/posture_tracker/assets/Head_Side.png diff --git a/open_earable/lib/apps/posture_tracker/assets/Neck_Front.png b/open_earable/lib/apps_tab/posture_tracker/assets/Neck_Front.png similarity index 100% rename from open_earable/lib/apps/posture_tracker/assets/Neck_Front.png rename to open_earable/lib/apps_tab/posture_tracker/assets/Neck_Front.png diff --git a/open_earable/lib/apps/posture_tracker/assets/Neck_Side.png b/open_earable/lib/apps_tab/posture_tracker/assets/Neck_Side.png similarity index 100% rename from open_earable/lib/apps/posture_tracker/assets/Neck_Side.png rename to open_earable/lib/apps_tab/posture_tracker/assets/Neck_Side.png diff --git a/open_earable/lib/apps/posture_tracker/assets/logo.png b/open_earable/lib/apps_tab/posture_tracker/assets/logo.png similarity index 100% rename from open_earable/lib/apps/posture_tracker/assets/logo.png rename to open_earable/lib/apps_tab/posture_tracker/assets/logo.png diff --git a/open_earable/lib/apps/posture_tracker/model/attitude.dart b/open_earable/lib/apps_tab/posture_tracker/model/attitude.dart similarity index 57% rename from open_earable/lib/apps/posture_tracker/model/attitude.dart rename to open_earable/lib/apps_tab/posture_tracker/model/attitude.dart index 911bdfd..68490a7 100644 --- a/open_earable/lib/apps/posture_tracker/model/attitude.dart +++ b/open_earable/lib/apps_tab/posture_tracker/model/attitude.dart @@ -1,8 +1,10 @@ class Attitude { /// the roll axis attitude in radians double roll; + /// the pitch axis attitude in radians double pitch; + /// the yaw axis attitude in radians double yaw; @@ -10,33 +12,25 @@ class Attitude { Attitude operator +(Attitude other) { return Attitude( - roll: roll + other.roll, - pitch: pitch + other.pitch, - yaw: yaw + other.yaw - ); + roll: roll + other.roll, + pitch: pitch + other.pitch, + yaw: yaw + other.yaw); } Attitude operator -(Attitude other) { return Attitude( - roll: roll - other.roll, - pitch: pitch - other.pitch, - yaw: yaw - other.yaw - ); + roll: roll - other.roll, + pitch: pitch - other.pitch, + yaw: yaw - other.yaw); } Attitude operator *(double scalar) { return Attitude( - roll: roll * scalar, - pitch: pitch * scalar, - yaw: yaw * scalar - ); + roll: roll * scalar, pitch: pitch * scalar, yaw: yaw * scalar); } Attitude operator /(double scalar) { return Attitude( - roll: roll / scalar, - pitch: pitch / scalar, - yaw: yaw / scalar - ); + roll: roll / scalar, pitch: pitch / scalar, yaw: yaw / scalar); } -} \ No newline at end of file +} diff --git a/open_earable/lib/apps/posture_tracker/model/attitude_tracker.dart b/open_earable/lib/apps_tab/posture_tracker/model/attitude_tracker.dart similarity index 100% rename from open_earable/lib/apps/posture_tracker/model/attitude_tracker.dart rename to open_earable/lib/apps_tab/posture_tracker/model/attitude_tracker.dart diff --git a/open_earable/lib/apps/posture_tracker/model/bad_posture_reminder.dart b/open_earable/lib/apps_tab/posture_tracker/model/bad_posture_reminder.dart similarity index 96% rename from open_earable/lib/apps/posture_tracker/model/bad_posture_reminder.dart rename to open_earable/lib/apps_tab/posture_tracker/model/bad_posture_reminder.dart index 72ccdf3..6ef0d5b 100644 --- a/open_earable/lib/apps/posture_tracker/model/bad_posture_reminder.dart +++ b/open_earable/lib/apps_tab/posture_tracker/model/bad_posture_reminder.dart @@ -1,7 +1,7 @@ import 'dart:math'; -import 'package:open_earable/apps/posture_tracker/model/attitude.dart'; -import 'package:open_earable/apps/posture_tracker/model/attitude_tracker.dart'; +import 'package:open_earable/apps_tab/posture_tracker/model/attitude.dart'; +import 'package:open_earable/apps_tab/posture_tracker/model/attitude_tracker.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; class BadPostureSettings { diff --git a/open_earable/lib/apps/posture_tracker/model/earable_attitude_tracker.dart b/open_earable/lib/apps_tab/posture_tracker/model/earable_attitude_tracker.dart similarity index 90% rename from open_earable/lib/apps/posture_tracker/model/earable_attitude_tracker.dart rename to open_earable/lib/apps_tab/posture_tracker/model/earable_attitude_tracker.dart index bc84324..8fd8627 100644 --- a/open_earable/lib/apps/posture_tracker/model/earable_attitude_tracker.dart +++ b/open_earable/lib/apps_tab/posture_tracker/model/earable_attitude_tracker.dart @@ -1,7 +1,7 @@ import 'dart:async'; -import 'package:open_earable/apps/posture_tracker/model/attitude_tracker.dart'; -import 'package:open_earable/apps/posture_tracker/model/ewma.dart'; +import 'package:open_earable/apps_tab/posture_tracker/model/attitude_tracker.dart'; +import 'package:open_earable/apps_tab/posture_tracker/model/ewma.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; class EarableAttitudeTracker extends AttitudeTracker { diff --git a/open_earable/lib/apps/posture_tracker/model/ewma.dart b/open_earable/lib/apps_tab/posture_tracker/model/ewma.dart similarity index 99% rename from open_earable/lib/apps/posture_tracker/model/ewma.dart rename to open_earable/lib/apps_tab/posture_tracker/model/ewma.dart index da2d62f..d013478 100644 --- a/open_earable/lib/apps/posture_tracker/model/ewma.dart +++ b/open_earable/lib/apps_tab/posture_tracker/model/ewma.dart @@ -8,4 +8,4 @@ class EWMA { _oldValue = _alpha * newValue + (1 - _alpha) * _oldValue; return _oldValue; } -} \ No newline at end of file +} diff --git a/open_earable/lib/apps/posture_tracker/model/mock_attitude_tracker.dart b/open_earable/lib/apps_tab/posture_tracker/model/mock_attitude_tracker.dart similarity index 90% rename from open_earable/lib/apps/posture_tracker/model/mock_attitude_tracker.dart rename to open_earable/lib/apps_tab/posture_tracker/model/mock_attitude_tracker.dart index 1f8359c..6b0600e 100644 --- a/open_earable/lib/apps/posture_tracker/model/mock_attitude_tracker.dart +++ b/open_earable/lib/apps_tab/posture_tracker/model/mock_attitude_tracker.dart @@ -1,8 +1,8 @@ import 'dart:async'; import 'dart:math'; -import 'package:open_earable/apps/posture_tracker/model/attitude.dart'; -import 'package:open_earable/apps/posture_tracker/model/attitude_tracker.dart'; +import 'package:open_earable/apps_tab/posture_tracker/model/attitude.dart'; +import 'package:open_earable/apps_tab/posture_tracker/model/attitude_tracker.dart'; class MockAttitudeTracker extends AttitudeTracker { Stream _attitudeStream = Stream.empty(); diff --git a/open_earable/lib/apps/posture_tracker/view/arc_painter.dart b/open_earable/lib/apps_tab/posture_tracker/view/arc_painter.dart similarity index 100% rename from open_earable/lib/apps/posture_tracker/view/arc_painter.dart rename to open_earable/lib/apps_tab/posture_tracker/view/arc_painter.dart diff --git a/open_earable/lib/apps/posture_tracker/view/posture_roll_view.dart b/open_earable/lib/apps_tab/posture_tracker/view/posture_roll_view.dart similarity index 85% rename from open_earable/lib/apps/posture_tracker/view/posture_roll_view.dart rename to open_earable/lib/apps_tab/posture_tracker/view/posture_roll_view.dart index 219f8b1..51d77ec 100644 --- a/open_earable/lib/apps/posture_tracker/view/posture_roll_view.dart +++ b/open_earable/lib/apps_tab/posture_tracker/view/posture_roll_view.dart @@ -3,7 +3,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; -import 'package:open_earable/apps/posture_tracker/view/arc_painter.dart'; +import 'package:open_earable/apps_tab/posture_tracker/view/arc_painter.dart'; /// A widget that displays the roll of the head and neck. class PostureRollView extends StatelessWidget { @@ -17,12 +17,14 @@ class PostureRollView extends StatelessWidget { final String neckAssetPath; final AlignmentGeometry headAlignment; - const PostureRollView({Key? key, - required this.roll, - this.angleThreshold = 0, - required this.headAssetPath, - required this.neckAssetPath, - this.headAlignment = Alignment.center}) : super(key: key); + const PostureRollView( + {Key? key, + required this.roll, + this.angleThreshold = 0, + required this.headAssetPath, + required this.neckAssetPath, + this.headAlignment = Alignment.center}) + : super(key: key); @override Widget build(BuildContext context) { diff --git a/open_earable/lib/apps/posture_tracker/view/posture_tracker_view.dart b/open_earable/lib/apps_tab/posture_tracker/view/posture_tracker_view.dart similarity index 85% rename from open_earable/lib/apps/posture_tracker/view/posture_tracker_view.dart rename to open_earable/lib/apps_tab/posture_tracker/view/posture_tracker_view.dart index 088a2ff..18e5e0b 100644 --- a/open_earable/lib/apps/posture_tracker/view/posture_tracker_view.dart +++ b/open_earable/lib/apps_tab/posture_tracker/view/posture_tracker_view.dart @@ -1,11 +1,11 @@ // ignore_for_file: unnecessary_this import 'package:flutter/material.dart'; -import 'package:open_earable/apps/posture_tracker/model/attitude_tracker.dart'; -import 'package:open_earable/apps/posture_tracker/model/bad_posture_reminder.dart'; -import 'package:open_earable/apps/posture_tracker/view/posture_roll_view.dart'; -import 'package:open_earable/apps/posture_tracker/view/settings_view.dart'; -import 'package:open_earable/apps/posture_tracker/view_model/posture_tracker_view_model.dart'; +import 'package:open_earable/apps_tab/posture_tracker/model/attitude_tracker.dart'; +import 'package:open_earable/apps_tab/posture_tracker/model/bad_posture_reminder.dart'; +import 'package:open_earable/apps_tab/posture_tracker/view/posture_roll_view.dart'; +import 'package:open_earable/apps_tab/posture_tracker/view/settings_view.dart'; +import 'package:open_earable/apps_tab/posture_tracker/view_model/posture_tracker_view_model.dart'; import 'package:provider/provider.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; @@ -74,15 +74,15 @@ class _PostureTrackerViewState extends State { List _createHeadViews(postureTrackerViewModel) { return [ this._buildHeadView( - "lib/apps/posture_tracker/assets/Head_Front.png", - "lib/apps/posture_tracker/assets/Neck_Front.png", + "lib/apps_tab/posture_tracker/assets/Head_Front.png", + "lib/apps_tab/posture_tracker/assets/Neck_Front.png", Alignment.center.add(Alignment(0, 0.3)), postureTrackerViewModel.attitude.roll, postureTrackerViewModel.badPostureSettings.rollAngleThreshold .toDouble()), this._buildHeadView( - "lib/apps/posture_tracker/assets/Head_Side.png", - "lib/apps/posture_tracker/assets/Neck_Side.png", + "lib/apps_tab/posture_tracker/assets/Head_Side.png", + "lib/apps_tab/posture_tracker/assets/Neck_Side.png", Alignment.center.add(Alignment(0, 0.3)), -postureTrackerViewModel.attitude.pitch, postureTrackerViewModel.badPostureSettings.pitchAngleThreshold diff --git a/open_earable/lib/apps/posture_tracker/view/settings_view.dart b/open_earable/lib/apps_tab/posture_tracker/view/settings_view.dart similarity index 98% rename from open_earable/lib/apps/posture_tracker/view/settings_view.dart rename to open_earable/lib/apps_tab/posture_tracker/view/settings_view.dart index 9076399..53993bb 100644 --- a/open_earable/lib/apps/posture_tracker/view/settings_view.dart +++ b/open_earable/lib/apps_tab/posture_tracker/view/settings_view.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:open_earable/apps/posture_tracker/model/bad_posture_reminder.dart'; -import 'package:open_earable/apps/posture_tracker/view_model/posture_tracker_view_model.dart'; +import 'package:open_earable/apps_tab/posture_tracker/model/bad_posture_reminder.dart'; +import 'package:open_earable/apps_tab/posture_tracker/view_model/posture_tracker_view_model.dart'; import 'package:provider/provider.dart'; class SettingsView extends StatefulWidget { diff --git a/open_earable/lib/apps/posture_tracker/view_model/posture_tracker_view_model.dart b/open_earable/lib/apps_tab/posture_tracker/view_model/posture_tracker_view_model.dart similarity index 72% rename from open_earable/lib/apps/posture_tracker/view_model/posture_tracker_view_model.dart rename to open_earable/lib/apps_tab/posture_tracker/view_model/posture_tracker_view_model.dart index b863bf9..f03a927 100644 --- a/open_earable/lib/apps/posture_tracker/view_model/posture_tracker_view_model.dart +++ b/open_earable/lib/apps_tab/posture_tracker/view_model/posture_tracker_view_model.dart @@ -1,7 +1,7 @@ import "package:flutter/material.dart"; -import "package:open_earable/apps/posture_tracker/model/attitude.dart"; -import 'package:open_earable/apps/posture_tracker/model/attitude_tracker.dart'; -import "package:open_earable/apps/posture_tracker/model/bad_posture_reminder.dart"; +import 'package:open_earable/apps_tab/posture_tracker/model/attitude.dart'; +import 'package:open_earable/apps_tab/posture_tracker/model/attitude_tracker.dart'; +import 'package:open_earable/apps_tab/posture_tracker/model/bad_posture_reminder.dart'; class PostureTrackerViewModel extends ChangeNotifier { Attitude _attitude = Attitude(); @@ -14,29 +14,37 @@ class PostureTrackerViewModel extends ChangeNotifier { AttitudeTracker _attitudeTracker; BadPostureReminder _badPostureReminder; - + bool _isDisposed = false; PostureTrackerViewModel(this._attitudeTracker, this._badPostureReminder) { _attitudeTracker.didChangeAvailability = (_) { - notifyListeners(); + if (!_isDisposed) { + notifyListeners(); + } }; _attitudeTracker.listen((attitude) { _attitude = Attitude( roll: attitude.roll, pitch: attitude.pitch, yaw: attitude.yaw); - notifyListeners(); + if (!_isDisposed) { + notifyListeners(); + } }); } void startTracking() { _attitudeTracker.start(); _badPostureReminder.start(); - notifyListeners(); + if (!_isDisposed) { + notifyListeners(); + } } void stopTracking() { _attitudeTracker.stop(); _badPostureReminder.stop(); - notifyListeners(); + if (!_isDisposed) { + notifyListeners(); + } } void calibrate() { @@ -51,6 +59,7 @@ class PostureTrackerViewModel extends ChangeNotifier { void dispose() { stopTracking(); _attitudeTracker.cancel(); + _isDisposed = true; super.dispose(); } } diff --git a/open_earable/lib/apps/powernapper/assets/logo.png b/open_earable/lib/apps_tab/powernapper/assets/logo.png similarity index 100% rename from open_earable/lib/apps/powernapper/assets/logo.png rename to open_earable/lib/apps_tab/powernapper/assets/logo.png diff --git a/open_earable/assets/powernapping_timer/198155.png b/open_earable/lib/apps_tab/powernapper/assets/powernapping.png similarity index 100% rename from open_earable/assets/powernapping_timer/198155.png rename to open_earable/lib/apps_tab/powernapper/assets/powernapping.png diff --git a/open_earable/lib/apps/powernapper/home_screen.dart b/open_earable/lib/apps_tab/powernapper/home_screen.dart similarity index 97% rename from open_earable/lib/apps/powernapper/home_screen.dart rename to open_earable/lib/apps_tab/powernapper/home_screen.dart index f5f40c7..8760d41 100644 --- a/open_earable/lib/apps/powernapper/home_screen.dart +++ b/open_earable/lib/apps_tab/powernapper/home_screen.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:open_earable/apps/powernapper/timerscreen.dart'; +import 'package:open_earable/apps_tab/powernapper/timerscreen.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; import 'interact.dart'; diff --git a/open_earable/lib/apps/powernapper/interact.dart b/open_earable/lib/apps_tab/powernapper/interact.dart similarity index 100% rename from open_earable/lib/apps/powernapper/interact.dart rename to open_earable/lib/apps_tab/powernapper/interact.dart diff --git a/open_earable/lib/apps/powernapper/movementTracker.dart b/open_earable/lib/apps_tab/powernapper/movementTracker.dart similarity index 94% rename from open_earable/lib/apps/powernapper/movementTracker.dart rename to open_earable/lib/apps_tab/powernapper/movementTracker.dart index 96103b8..023d2c4 100644 --- a/open_earable/lib/apps/powernapper/movementTracker.dart +++ b/open_earable/lib/apps_tab/powernapper/movementTracker.dart @@ -1,7 +1,7 @@ import 'dart:async'; -import 'package:open_earable/apps/powernapper/interact.dart'; -import 'package:open_earable/apps/powernapper/sensor_datatypes.dart'; +import 'package:open_earable/apps_tab/powernapper/interact.dart'; +import 'package:open_earable/apps_tab/powernapper/sensor_datatypes.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; /// Movement Tracker has lgoic for timer & movement validation. diff --git a/open_earable/lib/apps/powernapper/sensor_datatypes.dart b/open_earable/lib/apps_tab/powernapper/sensor_datatypes.dart similarity index 100% rename from open_earable/lib/apps/powernapper/sensor_datatypes.dart rename to open_earable/lib/apps_tab/powernapper/sensor_datatypes.dart diff --git a/open_earable/lib/apps/powernapper/timerscreen.dart b/open_earable/lib/apps_tab/powernapper/timerscreen.dart similarity index 92% rename from open_earable/lib/apps/powernapper/timerscreen.dart rename to open_earable/lib/apps_tab/powernapper/timerscreen.dart index a6b4373..fb4296c 100644 --- a/open_earable/lib/apps/powernapper/timerscreen.dart +++ b/open_earable/lib/apps_tab/powernapper/timerscreen.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; -import 'package:open_earable/apps/powernapper/movementTracker.dart'; -import 'package:open_earable/apps/powernapper/sensor_datatypes.dart'; -import 'package:open_earable/ble_controller.dart'; -import 'package:open_earable/widgets/earable_not_connected_warning.dart'; +import 'package:open_earable/apps_tab/powernapper/movementTracker.dart'; +import 'package:open_earable/apps_tab/powernapper/sensor_datatypes.dart'; +import 'package:open_earable/ble/ble_controller.dart'; +import 'package:open_earable/shared/earable_not_connected_warning.dart'; import 'package:provider/provider.dart'; import 'interact.dart'; @@ -61,7 +61,7 @@ class TimerScreenState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Image.asset( - 'assets/powernapping_timer/198155.png', + 'lib/apps_tab/powernapper/assets/powernapping.png', width: 150, height: 150, color: Colors.grey, diff --git a/open_earable/lib/apps/recorder/assets/logo.png b/open_earable/lib/apps_tab/recorder/assets/logo.png similarity index 100% rename from open_earable/lib/apps/recorder/assets/logo.png rename to open_earable/lib/apps_tab/recorder/assets/logo.png diff --git a/open_earable/lib/apps/recorder/assets/logo_old.png b/open_earable/lib/apps_tab/recorder/assets/logo_old.png similarity index 100% rename from open_earable/lib/apps/recorder/assets/logo_old.png rename to open_earable/lib/apps_tab/recorder/assets/logo_old.png diff --git a/open_earable/lib/apps/recorder/lib/recorder.dart b/open_earable/lib/apps_tab/recorder/lib/recorder.dart similarity index 99% rename from open_earable/lib/apps/recorder/lib/recorder.dart rename to open_earable/lib/apps_tab/recorder/lib/recorder.dart index 788fcba..eef4b66 100644 --- a/open_earable/lib/apps/recorder/lib/recorder.dart +++ b/open_earable/lib/apps_tab/recorder/lib/recorder.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:open_earable/widgets/earable_not_connected_warning.dart'; +import 'package:open_earable/shared/earable_not_connected_warning.dart'; import 'dart:async'; import 'dart:io'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; diff --git a/open_earable/lib/apps/step_counter.dart b/open_earable/lib/apps_tab/step_counter.dart similarity index 100% rename from open_earable/lib/apps/step_counter.dart rename to open_earable/lib/apps_tab/step_counter.dart diff --git a/open_earable/lib/apps/tightness/assets/logo.png b/open_earable/lib/apps_tab/tightness/assets/logo.png similarity index 100% rename from open_earable/lib/apps/tightness/assets/logo.png rename to open_earable/lib/apps_tab/tightness/assets/logo.png diff --git a/open_earable/lib/apps/tightness/tightness.dart b/open_earable/lib/apps_tab/tightness/tightness.dart similarity index 96% rename from open_earable/lib/apps/tightness/tightness.dart rename to open_earable/lib/apps_tab/tightness/tightness.dart index 8496c39..279d05a 100644 --- a/open_earable/lib/apps/tightness/tightness.dart +++ b/open_earable/lib/apps_tab/tightness/tightness.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:open_earable/ble_controller.dart'; -import 'package:open_earable/widgets/earable_not_connected_warning.dart'; +import 'package:open_earable/ble/ble_controller.dart'; +import 'package:open_earable/shared/earable_not_connected_warning.dart'; import 'dart:async'; import 'dart:math' as math; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; diff --git a/open_earable/lib/ble.dart b/open_earable/lib/ble/ble_connect_view.dart similarity index 99% rename from open_earable/lib/ble.dart rename to open_earable/lib/ble/ble_connect_view.dart index aac5c6a..352c91c 100644 --- a/open_earable/lib/ble.dart +++ b/open_earable/lib/ble/ble_connect_view.dart @@ -1,7 +1,7 @@ import 'dart:io'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:open_earable/ble_controller.dart'; +import 'package:open_earable/ble/ble_controller.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; import 'package:provider/provider.dart'; diff --git a/open_earable/lib/ble_controller.dart b/open_earable/lib/ble/ble_controller.dart similarity index 100% rename from open_earable/lib/ble_controller.dart rename to open_earable/lib/ble/ble_controller.dart diff --git a/open_earable/lib/controls_tab/views/audio_player.dart b/open_earable/lib/controls_tab/views/audio_player.dart index 0d9c9f5..cc295fe 100644 --- a/open_earable/lib/controls_tab/views/audio_player.dart +++ b/open_earable/lib/controls_tab/views/audio_player.dart @@ -1,11 +1,11 @@ import 'dart:io'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:open_earable/ble_controller.dart'; +import 'package:open_earable/ble/ble_controller.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; import 'package:provider/provider.dart'; import '../models/open_earable_settings.dart'; -import '../../widgets/dynamic_value_picker.dart'; +import '../../shared/dynamic_value_picker.dart'; class AudioPlayerCard extends StatefulWidget { final OpenEarable _openEarable; @@ -492,7 +492,8 @@ class _AudioPlayerCardState extends State { color: Color(0xff53515b), child: Text( 'Set\nSource', - style: TextStyle(color: Colors.white, fontSize: 15), + style: TextStyle( + color: _connected ? Colors.white : null, fontSize: 15), ), ), ), diff --git a/open_earable/lib/controls_tab/views/connect.dart b/open_earable/lib/controls_tab/views/connect.dart index 8eb110f..393158e 100644 --- a/open_earable/lib/controls_tab/views/connect.dart +++ b/open_earable/lib/controls_tab/views/connect.dart @@ -2,11 +2,11 @@ import 'dart:io'; import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_reactive_ble/flutter_reactive_ble.dart'; -import 'package:open_earable/ble_controller.dart'; +import 'package:open_earable/ble/ble_controller.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:provider/provider.dart'; -import '../../ble.dart'; +import 'package:open_earable/ble/ble_connect_view.dart'; import 'package:shared_preferences/shared_preferences.dart'; class ConnectCard extends StatefulWidget { diff --git a/open_earable/lib/controls_tab/views/led_color.dart b/open_earable/lib/controls_tab/views/led_color.dart index 87923a6..c97cf84 100644 --- a/open_earable/lib/controls_tab/views/led_color.dart +++ b/open_earable/lib/controls_tab/views/led_color.dart @@ -6,9 +6,9 @@ import 'dart:async'; import 'package:flutter_colorpicker/flutter_colorpicker.dart'; import 'dart:io'; import 'package:provider/provider.dart'; -import '../../ble_controller.dart'; +import 'package:open_earable/ble/ble_controller.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; -import '../../global_theme.dart'; +import 'package:open_earable/shared/global_theme.dart'; class LEDColorCard extends StatefulWidget { final OpenEarable _openEarable; @@ -246,7 +246,10 @@ class _LEDColorCardState extends State { ? CupertinoButton( padding: EdgeInsets.zero, child: Text('Set', - style: TextStyle(color: Colors.white)), + style: TextStyle( + color: connected + ? Colors.white + : null)), onPressed: _openEarable.bleManager.connected ? _setLEDColor : null, diff --git a/open_earable/lib/controls_tab/views/sensor_configuration.dart b/open_earable/lib/controls_tab/views/sensor_configuration.dart index a9629f2..88f10ec 100644 --- a/open_earable/lib/controls_tab/views/sensor_configuration.dart +++ b/open_earable/lib/controls_tab/views/sensor_configuration.dart @@ -1,8 +1,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:open_earable/widgets/dynamic_value_picker.dart'; +import 'package:open_earable/shared/dynamic_value_picker.dart'; import 'dart:io'; -import 'package:open_earable/ble_controller.dart'; +import 'package:open_earable/ble/ble_controller.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; import 'package:provider/provider.dart'; import '../models/open_earable_settings.dart'; diff --git a/open_earable/lib/main.dart b/open_earable/lib/main.dart index ef30d11..d229b60 100644 --- a/open_earable/lib/main.dart +++ b/open_earable/lib/main.dart @@ -3,18 +3,18 @@ import 'dart:async'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:open_earable/open_earable_icon_icons.dart'; +import 'package:open_earable/shared/open_earable_icon_icons.dart'; import 'package:provider/provider.dart'; import 'controls_tab/controls_tab.dart'; import 'sensor_data_tab/sensor_data_tab.dart'; -import 'ble.dart'; -import 'apps_tab.dart'; +import 'package:open_earable/ble/ble_connect_view.dart'; +import 'package:open_earable/ble/ble_controller.dart'; +import 'apps_tab/apps_tab.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:flutter_reactive_ble/flutter_reactive_ble.dart'; import 'package:app_settings/app_settings.dart'; -import 'ble_controller.dart'; -import 'global_theme.dart'; +import 'shared/global_theme.dart'; void main() => runApp(ChangeNotifierProvider( create: (context) => BluetoothController(), child: MyApp())); diff --git a/open_earable/lib/sensor_data_tab/earable_3d_model.dart b/open_earable/lib/sensor_data_tab/earable_3d_model.dart index f45e3e6..3ad4dc0 100644 --- a/open_earable/lib/sensor_data_tab/earable_3d_model.dart +++ b/open_earable/lib/sensor_data_tab/earable_3d_model.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:open_earable/ble_controller.dart'; -import 'package:open_earable/widgets/earable_not_connected_warning.dart'; +import 'package:open_earable/shared/earable_not_connected_warning.dart'; import 'package:provider/provider.dart'; import 'dart:async'; import 'package:three_dart/three_dart.dart' as three; @@ -9,6 +8,7 @@ import 'package:flutter_gl/flutter_gl.dart'; import 'package:three_dart/three3d/math/euler.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; import 'dart:math'; +import 'package:open_earable/ble/ble_controller.dart'; class Earable3DModel extends StatefulWidget { final OpenEarable _openEarable; diff --git a/open_earable/lib/sensor_data_tab/sensor_chart.dart b/open_earable/lib/sensor_data_tab/sensor_chart.dart index ed34a10..3f0c331 100644 --- a/open_earable/lib/sensor_data_tab/sensor_chart.dart +++ b/open_earable/lib/sensor_data_tab/sensor_chart.dart @@ -1,8 +1,7 @@ import 'dart:async'; -import 'package:flutter/scheduler.dart'; -import 'package:open_earable/ble_controller.dart'; -import 'package:open_earable/widgets/earable_not_connected_warning.dart'; +import 'package:open_earable/ble/ble_controller.dart'; +import 'package:open_earable/shared/earable_not_connected_warning.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; diff --git a/open_earable/lib/sensor_data_tab/sensor_data_tab.dart b/open_earable/lib/sensor_data_tab/sensor_data_tab.dart index 4761569..83f08c5 100644 --- a/open_earable/lib/sensor_data_tab/sensor_data_tab.dart +++ b/open_earable/lib/sensor_data_tab/sensor_data_tab.dart @@ -1,12 +1,9 @@ import 'dart:async'; import 'package:flutter/material.dart'; -import 'package:open_earable/ble_controller.dart'; import 'package:open_earable/sensor_data_tab/earable_3d_model.dart'; -import 'package:open_earable/widgets/earable_not_connected_warning.dart'; import 'package:open_earable_flutter/src/open_earable_flutter.dart'; import 'package:open_earable/sensor_data_tab/sensor_chart.dart'; -import 'package:provider/provider.dart'; class SensorDataTab extends StatefulWidget { final OpenEarable _openEarable; diff --git a/open_earable/lib/widgets/dynamic_value_picker.dart b/open_earable/lib/shared/dynamic_value_picker.dart similarity index 100% rename from open_earable/lib/widgets/dynamic_value_picker.dart rename to open_earable/lib/shared/dynamic_value_picker.dart diff --git a/open_earable/lib/widgets/earable_not_connected_warning.dart b/open_earable/lib/shared/earable_not_connected_warning.dart similarity index 100% rename from open_earable/lib/widgets/earable_not_connected_warning.dart rename to open_earable/lib/shared/earable_not_connected_warning.dart diff --git a/open_earable/lib/global_theme.dart b/open_earable/lib/shared/global_theme.dart similarity index 100% rename from open_earable/lib/global_theme.dart rename to open_earable/lib/shared/global_theme.dart diff --git a/open_earable/lib/open_earable_icon_icons.dart b/open_earable/lib/shared/open_earable_icon_icons.dart similarity index 100% rename from open_earable/lib/open_earable_icon_icons.dart rename to open_earable/lib/shared/open_earable_icon_icons.dart diff --git a/open_earable/pubspec.yaml b/open_earable/pubspec.yaml index 9916c2c..187ffb0 100644 --- a/open_earable/pubspec.yaml +++ b/open_earable/pubspec.yaml @@ -131,13 +131,13 @@ flutter: # - images/a_dot_ham.jpeg assets: - assets/ - - lib/apps/powernapper/assets/ - - lib/apps/recorder/assets/ - - lib/apps/posture_tracker/assets/ - - lib/apps/neck_stretch/assets/ - - lib/apps/jump_height_test/assets/ - - lib/apps/tightness/assets/ - - lib/apps/jump_rope_counter/assets/ + - lib/apps_tab/powernapper/assets/ + - lib/apps_tab/recorder/assets/ + - lib/apps_tab/posture_tracker/assets/ + - lib/apps_tab/neck_stretch/assets/ + - lib/apps_tab/jump_height_test/assets/ + - lib/apps_tab/tightness/assets/ + - lib/apps_tab/jump_rope_counter/assets/ fonts: - family: OpenEarableIcon