Commit c0eb98c

derdilla <82763757+NobodyForNothing@users.noreply.github.com>
2024-06-23 12:04:31
review modified files
Signed-off-by: derdilla <82763757+NobodyForNothing@users.noreply.github.com>
1 parent 868b37e
app/lib/components/dialoges/add_measurement_dialoge.dart
@@ -285,7 +285,6 @@ class _AddEntryDialogeState extends State<AddEntryDialoge> {
             if (widget.settings.bleInput)
               BluetoothInput(
                 settings: widget.settings,
-                /* flutterBluePlus: FakeFlutterBluePlus(), */
                 onMeasurement: (record) => setState(() => _loadFields(record)),
               ),
             if (widget.settings.allowManualTimeInput)
app/lib/screens/home_screen.dart
@@ -1,6 +1,5 @@
 import 'package:blood_pressure_app/components/dialoges/add_measurement_dialoge.dart';
 import 'package:blood_pressure_app/components/measurement_list/measurement_list.dart';
-import 'package:blood_pressure_app/logging.dart';
 import 'package:blood_pressure_app/model/blood_pressure/medicine/intake_history.dart';
 import 'package:blood_pressure_app/model/blood_pressure/model.dart';
 import 'package:blood_pressure_app/model/storage/intervall_store.dart';
@@ -27,7 +26,6 @@ class AppHome extends StatelessWidget {
 
   @override
   Widget build(BuildContext context) {
-    Log.trace('AppHome build');
     final localizations = AppLocalizations.of(context)!;
     // direct use of settings possible as no listening is required
     if (_appStart) {
@@ -64,24 +62,24 @@ class AppHome extends StatelessWidget {
             child: Padding(
               padding: const EdgeInsets.only(top: 20),
               child: Consumer<IntakeHistory>(builder: (context, intakeHistory, child) =>
-                Consumer<IntervallStoreManager>(builder: (context, intervalls, child) =>
-                Consumer<Settings>(builder: (context, settings, child) =>
-                  Column(children: [
-                    const MeasurementGraph(),
-                    Expanded(
-                      child: (settings.useLegacyList) ?
-                        LegacyMeasurementsList(context) :
-                        BloodPressureBuilder(
-                          rangeType: IntervallStoreManagerLocation.mainPage,
-                          onData: (context, records) => MeasurementList(
-                            settings: settings,
-                            records: records,
-                            intakes: intakeHistory.getIntakes(intervalls.mainPage.currentRange),
-                          ),
-                        ),
-                    ),
-                  ],),
-                ),),
+                  Consumer<IntervallStoreManager>(builder: (context, intervalls, child) =>
+                      Consumer<Settings>(builder: (context, settings, child) =>
+                          Column(children: [
+                            const MeasurementGraph(),
+                            Expanded(
+                              child: (settings.useLegacyList) ?
+                              LegacyMeasurementsList(context) :
+                              BloodPressureBuilder(
+                                rangeType: IntervallStoreManagerLocation.mainPage,
+                                onData: (context, records) => MeasurementList(
+                                  settings: settings,
+                                  records: records,
+                                  intakes: intakeHistory.getIntakes(intervalls.mainPage.currentRange),
+                                ),
+                              ),
+                            ),
+                          ],),
+                      ),),
               ),
             ),
           );
@@ -95,61 +93,61 @@ class AppHome extends StatelessWidget {
           }
           SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: SystemUiOverlay.values);
           return Consumer<Settings>(builder: (context, settings, child) => Column(
-              verticalDirection: VerticalDirection.up,
-              children: [
-                SizedBox.square(
-                  dimension: 75,
-                  child: FittedBox(
-                    child: FloatingActionButton(
-                      heroTag: 'floatingActionAdd',
-                      tooltip: localizations.addMeasurement,
-                      autofocus: true,
-                      onPressed: () async {
-                        final model = Provider.of<BloodPressureModel>(context, listen: false);
-                        final intakes = Provider.of<IntakeHistory>(context, listen: false);
-                        final measurement = await showAddEntryDialoge(context, Provider.of<Settings>(context, listen: false));
-                        if (measurement == null) return;
-                        if (measurement.$1 != null) {
-                          if (context.mounted) {
-                            model.addAndExport(context, measurement.$1!);
-                          } else {
-                            model.add(measurement.$1!);
-                          }
+            verticalDirection: VerticalDirection.up,
+            children: [
+              SizedBox.square(
+                dimension: 75,
+                child: FittedBox(
+                  child: FloatingActionButton(
+                    heroTag: 'floatingActionAdd',
+                    tooltip: localizations.addMeasurement,
+                    autofocus: true,
+                    onPressed: () async {
+                      final model = Provider.of<BloodPressureModel>(context, listen: false);
+                      final intakes = Provider.of<IntakeHistory>(context, listen: false);
+                      final measurement = await showAddEntryDialoge(context, Provider.of<Settings>(context, listen: false));
+                      if (measurement == null) return;
+                      if (measurement.$1 != null) {
+                        if (context.mounted) {
+                          model.addAndExport(context, measurement.$1!);
+                        } else {
+                          model.add(measurement.$1!);
                         }
-                        if (measurement.$2 != null) {
-                          intakes.addIntake(measurement.$2!);
-                        }
-                      },
-                      child: const Icon(Icons.add,),
-                    ),
+                      }
+                      if (measurement.$2 != null) {
+                        intakes.addIntake(measurement.$2!);
+                      }
+                    },
+                    child: const Icon(Icons.add,),
                   ),
                 ),
-                const SizedBox(
-                  height: 10,
-                ),
-                FloatingActionButton(
-                  heroTag: 'floatingActionStatistics',
-                  tooltip: localizations.statistics,
-                  backgroundColor: const Color(0xFF6F6F6F),
-                  onPressed: () {
-                    _buildTransition(context, const StatisticsScreen(), settings.animationSpeed);
-                  },
-                  child: const Icon(Icons.insights, color: Colors.black),
-                ),
-                const SizedBox(
-                  height: 10,
-                ),
-                FloatingActionButton(
-                  heroTag: 'floatingActionSettings',
-                  tooltip: localizations.settings,
-                  backgroundColor: const Color(0xFF6F6F6F),
-                  child: const Icon(Icons.settings, color: Colors.black),
-                  onPressed: () {
-                    _buildTransition(context, const SettingsPage(), settings.animationSpeed);
-                  },
-                ),
-              ],
-            ),);
+              ),
+              const SizedBox(
+                height: 10,
+              ),
+              FloatingActionButton(
+                heroTag: 'floatingActionStatistics',
+                tooltip: localizations.statistics,
+                backgroundColor: const Color(0xFF6F6F6F),
+                onPressed: () {
+                  _buildTransition(context, const StatisticsScreen(), settings.animationSpeed);
+                },
+                child: const Icon(Icons.insights, color: Colors.black),
+              ),
+              const SizedBox(
+                height: 10,
+              ),
+              FloatingActionButton(
+                heroTag: 'floatingActionSettings',
+                tooltip: localizations.settings,
+                backgroundColor: const Color(0xFF6F6F6F),
+                child: const Icon(Icons.settings, color: Colors.black),
+                onPressed: () {
+                  _buildTransition(context, const SettingsPage(), settings.animationSpeed);
+                },
+              ),
+            ],
+          ),);
         },),
     );
   }
@@ -172,4 +170,4 @@ class TimedMaterialPageRouter extends MaterialPageRoute {
 
   @override
   final Duration transitionDuration;
-}
+}
\ No newline at end of file
app/lib/screens/settings_screen.dart
@@ -151,6 +151,13 @@ class SettingsPage extends StatelessWidget {
                 title: Text(localizations.medications),
                 trailing: const Icon(Icons.arrow_forward_ios),
               ),
+              SwitchListTile(
+                value: settings.bleInput,
+                onChanged: (value) {
+                  settings.bleInput = value;
+                },
+                secondary: const Icon(Icons.bluetooth),
+                title: Text(localizations.bluetoothInput),),
               SwitchListTile(
                 value: settings.allowManualTimeInput,
                 onChanged: (value) {
app/lib/main.dart
@@ -22,7 +22,6 @@ import 'package:sqflite/sqflite.dart';
 late final ConfigDB _database;
 late final BloodPressureModel _bloodPressureModel;
 
-
 void main() async {
   runApp(ConsistentFutureBuilder(
       future: _loadApp(),
app/test/ui/components/bluetooth_input_test.dart
@@ -51,7 +51,7 @@ void main() {
       onMeasurement: reads.add,
       bluetoothCubit: () => bluetoothCubit,
       deviceScanCubit: () => deviceScanCubit,
-      bleReadCubit: () => bleReadCubit,
+      bleReadCubit: (device) => bleReadCubit,
     )));
 
     await tester.tap(find.byType(ClosedBluetoothInput));
@@ -95,7 +95,7 @@ void main() {
       onMeasurement: reads.add,
       bluetoothCubit: () => bluetoothCubit,
       deviceScanCubit: () => deviceScanCubit,
-      bleReadCubit: () => bleReadCubit,
+      bleReadCubit: (device) => bleReadCubit,
     )));
 
     await tester.tap(find.byType(ClosedBluetoothInput));
app/pubspec.lock
@@ -5,23 +5,18 @@ packages:
     dependency: transitive
     description:
       name: _fe_analyzer_shared
-      sha256: "5aaf60d96c4cd00fe7f21594b5ad6a1b699c80a27420f8a837f4d68473ef09e3"
+      sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7"
       url: "https://pub.dev"
     source: hosted
-    version: "68.0.0"
-  _macros:
-    dependency: transitive
-    description: dart
-    source: sdk
-    version: "0.1.5"
+    version: "67.0.0"
   analyzer:
     dependency: transitive
     description:
       name: analyzer
-      sha256: "21f1d3720fd1c70316399d5e2bccaebb415c434592d778cce8acb967b8578808"
+      sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d"
       url: "https://pub.dev"
     source: hosted
-    version: "6.5.0"
+    version: "6.4.1"
   app_settings:
     dependency: "direct main"
     description:
@@ -34,10 +29,10 @@ packages:
     dependency: transitive
     description:
       name: archive
-      sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d
+      sha256: "0763b45fa9294197a2885c8567927e2830ade852e5c896fd4ab7e0e348d0f373"
       url: "https://pub.dev"
     source: hosted
-    version: "3.6.1"
+    version: "3.5.0"
   args:
     dependency: transitive
     description:
@@ -298,10 +293,10 @@ packages:
     dependency: "direct main"
     description:
       name: file_picker
-      sha256: "2ca051989f69d1b2ca012b2cf3ccf78c70d40144f0861ff2c063493f7c8c3d45"
+      sha256: "29c90806ac5f5fb896547720b73b17ee9aed9bba540dc5d91fe29f8c5745b10a"
       url: "https://pub.dev"
     source: hosted
-    version: "8.0.5"
+    version: "8.0.3"
   fixnum:
     dependency: transitive
     description:
@@ -356,18 +351,18 @@ packages:
     dependency: "direct main"
     description:
       name: flutter_markdown
-      sha256: ff76a9300a06ad1f2b394e54c0b4beaaf6a95f95c98540c918b870221499bb10
+      sha256: "9921f9deda326f8a885e202b1e35237eadfc1345239a0f6f0f1ff287e047547f"
       url: "https://pub.dev"
     source: hosted
-    version: "0.7.2"
+    version: "0.7.1"
   flutter_plugin_android_lifecycle:
     dependency: transitive
     description:
       name: flutter_plugin_android_lifecycle
-      sha256: c6b0b4c05c458e1c01ad9bcc14041dd7b1f6783d487be4386f793f47a8a4d03e
+      sha256: "8cf40eebf5dec866a6d1956ad7b4f7016e6c0cc69847ab946833b7d43743809f"
       url: "https://pub.dev"
     source: hosted
-    version: "2.0.20"
+    version: "2.0.19"
   flutter_test:
     dependency: "direct dev"
     description: flutter
@@ -382,10 +377,10 @@ packages:
     dependency: "direct main"
     description:
       name: fluttertoast
-      sha256: "7eae679e596a44fdf761853a706f74979f8dd3cd92cf4e23cae161fda091b847"
+      sha256: "81b68579e23fcbcada2db3d50302813d2371664afe6165bc78148050ab94bf66"
       url: "https://pub.dev"
     source: hosted
-    version: "8.2.6"
+    version: "8.2.5"
   freezed_annotation:
     dependency: transitive
     description:
@@ -461,10 +456,10 @@ packages:
     dependency: transitive
     description:
       name: image
-      sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8"
+      sha256: "4c68bfd5ae83e700b5204c1e74451e7bf3cf750e6843c6e158289cf56bda018e"
       url: "https://pub.dev"
     source: hosted
-    version: "4.2.0"
+    version: "4.1.7"
   intl:
     dependency: "direct main"
     description:
@@ -545,14 +540,6 @@ packages:
       url: "https://pub.dev"
     source: hosted
     version: "1.2.0"
-  macros:
-    dependency: transitive
-    description:
-      name: macros
-      sha256: a8403c89b36483b4cbf9f1fcd24562f483cb34a5c9bf101cf2b0d8a083cf1239
-      url: "https://pub.dev"
-    source: hosted
-    version: "0.1.0-main.5"
   markdown:
     dependency: transitive
     description:
@@ -709,10 +696,10 @@ packages:
     dependency: transitive
     description:
       name: platform
-      sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65"
+      sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec"
       url: "https://pub.dev"
     source: hosted
-    version: "3.1.5"
+    version: "3.1.4"
   plugin_platform_interface:
     dependency: transitive
     description:
@@ -781,18 +768,18 @@ packages:
     dependency: transitive
     description:
       name: shared_preferences_android
-      sha256: "93d0ec9dd902d85f326068e6a899487d1f65ffcd5798721a95330b26c8131577"
+      sha256: "1ee8bf911094a1b592de7ab29add6f826a7331fb854273d55918693d5364a1f2"
       url: "https://pub.dev"
     source: hosted
-    version: "2.2.3"
+    version: "2.2.2"
   shared_preferences_foundation:
     dependency: transitive
     description:
       name: shared_preferences_foundation
-      sha256: "0a8a893bf4fd1152f93fec03a415d11c27c74454d96e2318a7ac38dd18683ab7"
+      sha256: "7708d83064f38060c7b39db12aefe449cb8cdc031d6062280087bc4cdb988f5c"
       url: "https://pub.dev"
     source: hosted
-    version: "2.4.0"
+    version: "2.3.5"
   shared_preferences_linux:
     dependency: transitive
     description:
@@ -898,10 +885,10 @@ packages:
     dependency: "direct main"
     description:
       name: sqflite
-      sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d
+      sha256: "5ce2e1a15e822c3b4bfb5400455775e421da7098eed8adc8f26298ada7c9308c"
       url: "https://pub.dev"
     source: hosted
-    version: "2.3.3+1"
+    version: "2.3.3"
   sqflite_common:
     dependency: transitive
     description:
@@ -922,10 +909,10 @@ packages:
     dependency: transitive
     description:
       name: sqlite3
-      sha256: b384f598b813b347c5a7e5ffad82cbaff1bec3d1561af267041e66f6f0899295
+      sha256: "1abbeb84bf2b1a10e5e1138c913123c8aa9d83cd64e5f9a0dd847b3c83063202"
       url: "https://pub.dev"
     source: hosted
-    version: "2.4.3"
+    version: "2.4.2"
   sqlparser:
     dependency: "direct main"
     description:
@@ -1034,26 +1021,26 @@ packages:
     dependency: "direct main"
     description:
       name: url_launcher
-      sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3"
+      sha256: "6ce1e04375be4eed30548f10a315826fd933c1e493206eab82eed01f438c8d2e"
       url: "https://pub.dev"
     source: hosted
-    version: "6.3.0"
+    version: "6.2.6"
   url_launcher_android:
     dependency: transitive
     description:
       name: url_launcher_android
-      sha256: ceb2625f0c24ade6ef6778d1de0b2e44f2db71fded235eb52295247feba8c5cf
+      sha256: "360a6ed2027f18b73c8d98e159dda67a61b7f2e0f6ec26e86c3ada33b0621775"
       url: "https://pub.dev"
     source: hosted
-    version: "6.3.3"
+    version: "6.3.1"
   url_launcher_ios:
     dependency: transitive
     description:
       name: url_launcher_ios
-      sha256: "7068716403343f6ba4969b4173cbf3b84fc768042124bc2c011e5d782b24fe89"
+      sha256: "9149d493b075ed740901f3ee844a38a00b33116c7c5c10d7fb27df8987fb51d5"
       url: "https://pub.dev"
     source: hosted
-    version: "6.3.0"
+    version: "6.2.5"
   url_launcher_linux:
     dependency: transitive
     description:
@@ -1066,10 +1053,10 @@ packages:
     dependency: transitive
     description:
       name: url_launcher_macos
-      sha256: "9a1a42d5d2d95400c795b2914c36fdcb525870c752569438e4ebb09a2b5d90de"
+      sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234
       url: "https://pub.dev"
     source: hosted
-    version: "3.2.0"
+    version: "3.1.0"
   url_launcher_platform_interface:
     dependency: transitive
     description:
@@ -1154,10 +1141,10 @@ packages:
     dependency: transitive
     description:
       name: win32
-      sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4
+      sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb"
       url: "https://pub.dev"
     source: hosted
-    version: "5.5.1"
+    version: "5.5.0"
   xdg_directories:
     dependency: transitive
     description:
@@ -1184,4 +1171,4 @@ packages:
     version: "3.1.2"
 sdks:
   dart: ">=3.4.0 <4.0.0"
-  flutter: ">=3.22.0"
+  flutter: ">=3.19.0"