From f4022dd2493e48583450c465ffacdbe09d3bbd38 Mon Sep 17 00:00:00 2001 From: Yandrik Date: Wed, 26 Mar 2025 21:01:42 +0100 Subject: [PATCH] feat: everything up to bluetooth scanning --- DesignRequirements.md | 43 + analysis_options.yaml | 6 + android/app/src/main/AndroidManifest.xml | 42 +- lib/controller/bluetooth.dart | 131 +++ lib/controller/bluetooth.g.dart | 27 + lib/main.dart | 164 ++-- lib/model/bluetooth_device_model.dart | 47 ++ lib/model/bluetooth_device_model.freezed.dart | 366 +++++++++ lib/model/bluetooth_device_model.g.dart | 41 + lib/pages/devices_page.dart | 288 +++++++ lib/pages/home_page.dart | 75 ++ lib/pages/settings_page.dart | 50 ++ lib/util/constants.dart | 1 + lib/util/sharedPrefs.dart | 73 ++ lib/util/sharedPrefs.g.dart | 197 +++++ lib/widgets/device_listitem.dart | 117 +++ lib/widgets/scanning_animation.dart | 187 +++++ macos/Flutter/GeneratedPluginRegistrant.swift | 4 + pubspec.lock | 751 +++++++++++++++++- pubspec.yaml | 16 + test/widget_test.dart | 2 +- 21 files changed, 2496 insertions(+), 132 deletions(-) create mode 100644 DesignRequirements.md create mode 100644 lib/controller/bluetooth.dart create mode 100644 lib/controller/bluetooth.g.dart create mode 100644 lib/model/bluetooth_device_model.dart create mode 100644 lib/model/bluetooth_device_model.freezed.dart create mode 100644 lib/model/bluetooth_device_model.g.dart create mode 100644 lib/pages/devices_page.dart create mode 100644 lib/pages/home_page.dart create mode 100644 lib/pages/settings_page.dart create mode 100644 lib/util/constants.dart create mode 100644 lib/util/sharedPrefs.dart create mode 100644 lib/util/sharedPrefs.g.dart create mode 100644 lib/widgets/device_listitem.dart create mode 100644 lib/widgets/scanning_animation.dart diff --git a/DesignRequirements.md b/DesignRequirements.md new file mode 100644 index 0000000..c7a9a20 --- /dev/null +++ b/DesignRequirements.md @@ -0,0 +1,43 @@ +# abawo Bluetooth Device App + +This app is used for connecting to, configuring, and interacting with +abawo Bluetooth devices, such as the abawo Universal Shifters. + +## Features + +- See all connected devices +- Add devices (connect) +- Remove devices +- Configure devices + + +### Supported Devices + +- abawo Universal Shifters (only one for now) + - Description: Universal Shifter Device for Smart Trainers. Basically a proxy between + smart trainer and fitness app, that allows the smart trainer to connect to the fitness app, intercept simulation packets, and modify them to allow gear shifting. + + - Functions (app): Connect to device, scan other BT devices and send ID to device to establish + connection with smart trainer, send configuration to device (such as resistance calc + variant, and gears and such). + + + + +## Tech Stack + +- Flutter +- Riverpod +- GoRouter +- flutter_blue_plus +- shared_preferences + + +## Visual Design + +Sleek, modern. Dark and light theme supported. Rounded containers, somewhat glass-like. +Still mostly material design. + +### Company Color Theme +todo + diff --git a/analysis_options.yaml b/analysis_options.yaml index 0d29021..baf162b 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -24,5 +24,11 @@ linter: # avoid_print: false # Uncomment to disable the `avoid_print` rule # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + errors: + invalid_annotation_target: ignore + + + plugins: + - custom_lint # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index be97ff1..f85d710 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,25 +1,29 @@ - - + + + + + + + + + + + + + + + + + + - + @@ -27,9 +31,7 @@ - +