diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12f7315..6683c7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ on: env: SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }} - FLUTTER_VERSION: 3.35.5 + FLUTTER_VERSION: 3.38.5 jobs: build: @@ -324,7 +324,7 @@ jobs: Write-Warning "$dll not found in $source" } } - Compress-Archive -Path "build/windows/x64/runner/Release/*" -DestinationPath "build/windows/x64/runner/Release/BikeControl.windows.zip" + Compress-Archive -Path "build/windows/x64/runner/Release/*" -DestinationPath "build/windows/x64/runner/Release/bike_control.windows.zip" - uses: microsoft/setup-msstore-cli@v1 if: false @@ -340,25 +340,20 @@ jobs: if: false run: msstore publish -v "build/windows/x64/runner/Release/" - - name: Rename swift_control.msix to BikeControl.windows.msix - shell: pwsh - run: | - Rename-Item -Path "build/windows/x64/runner/Release/swift_control.msix" -NewName "BikeControl.windows.msix" - - name: Upload Artifacts uses: actions/upload-artifact@v4 with: overwrite: true name: Releases path: | - build/windows/x64/runner/Release/BikeControl.windows.zip - build/windows/x64/runner/Release/BikeControl.windows.msix + build/windows/x64/runner/Release/bike_control.windows.zip + build/windows/x64/runner/Release/bike_control.windows.msix - name: Update Release uses: ncipollo/release-action@v1 with: allowUpdates: true - artifacts: "build/windows/x64/runner/Release/BikeControl.windows.msix" + artifacts: "build/windows/x64/runner/Release/bike_control.windows.msix" prerelease: true tag: v${{ env.VERSION }} token: ${{ secrets.TOKEN }} diff --git a/.github/workflows/patch.yml b/.github/workflows/patch.yml index 64be72a..d93dd7b 100644 --- a/.github/workflows/patch.yml +++ b/.github/workflows/patch.yml @@ -5,7 +5,7 @@ on: env: SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }} - FLUTTER_VERSION: 3.35.5 + FLUTTER_VERSION: 3.38.5 jobs: build: diff --git a/.gitignore b/.gitignore index 613f179..75db0a9 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,4 @@ lib/gen/ service-account.json .env +lib/generated diff --git a/README.md b/README.md index d8ae298..bc04762 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,9 @@ Best follow our landing page and the "Get Started" button: [bikecontrol.app](htt - Elite Sterzo Smart (for steering support) - Elite Square Smart Frame (beta) - Gamepads +- Keyboard input + - some trainers do not support keyboard input for all functions - now they do! + - useful when remapping keys from other devices using e.g. AutoHotkey - Cheap Bluetooth buttons such as [these](https://www.amazon.com/s?k=bluetooth+remote) (beta) - BLE HID devices and classic Bluetooth HID devices are supported - works out of the box on Android diff --git a/lib/bluetooth/connection.dart b/lib/bluetooth/connection.dart index 4ef5af6..66cd5da 100644 --- a/lib/bluetooth/connection.dart +++ b/lib/bluetooth/connection.dart @@ -6,17 +6,17 @@ import 'package:flutter/foundation.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:gamepads/gamepads.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/bluetooth/devices/bluetooth_device.dart'; -import 'package:swift_control/bluetooth/devices/gamepad/gamepad_device.dart'; -import 'package:swift_control/bluetooth/devices/hid/hid_device.dart'; -import 'package:swift_control/bluetooth/devices/wahoo/wahoo_kickr_headwind.dart'; -import 'package:swift_control/bluetooth/devices/zwift/ftms_mdns_emulator.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; -import 'package:swift_control/main.dart'; -import 'package:swift_control/utils/actions/android.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/keymap.dart'; -import 'package:swift_control/utils/requirements/android.dart'; +import 'package:bike_control/bluetooth/devices/bluetooth_device.dart'; +import 'package:bike_control/bluetooth/devices/gamepad/gamepad_device.dart'; +import 'package:bike_control/bluetooth/devices/hid/hid_device.dart'; +import 'package:bike_control/bluetooth/devices/wahoo/wahoo_kickr_headwind.dart'; +import 'package:bike_control/bluetooth/devices/zwift/ftms_mdns_emulator.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/main.dart'; +import 'package:bike_control/utils/actions/android.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/keymap.dart'; +import 'package:bike_control/utils/requirements/android.dart'; import 'package:universal_ble/universal_ble.dart'; import 'devices/base_device.dart'; diff --git a/lib/bluetooth/devices/base_device.dart b/lib/bluetooth/devices/base_device.dart index bbb38d1..8e55d5a 100644 --- a/lib/bluetooth/devices/base_device.dart +++ b/lib/bluetooth/devices/base_device.dart @@ -1,13 +1,13 @@ import 'dart:async'; +import 'package:bike_control/bluetooth/devices/zwift/constants.dart'; +import 'package:bike_control/utils/actions/desktop.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/iap/iap_manager.dart'; +import 'package:bike_control/utils/keymap/apps/custom_app.dart'; +import 'package:bike_control/utils/keymap/manager.dart'; import 'package:dartx/dartx.dart'; import 'package:flutter/material.dart'; -import 'package:swift_control/bluetooth/devices/zwift/constants.dart'; -import 'package:swift_control/utils/actions/desktop.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/iap/iap_manager.dart'; -import 'package:swift_control/utils/keymap/apps/custom_app.dart'; -import 'package:swift_control/utils/keymap/manager.dart'; import '../../utils/keymap/buttons.dart'; import '../messages/notification.dart'; @@ -113,9 +113,9 @@ abstract class BaseDevice { String _getCommandLimitMessage() { final remaining = IAPManager.instance.commandsRemainingToday; const dailyLimit = 15; // Should match IAPService.dailyCommandLimit - return remaining > 0 - ? 'Command limit: $remaining commands remaining today. Upgrade to unlock unlimited commands.' - : 'Daily command limit reached (0/$dailyLimit). Upgrade to unlock unlimited commands or try again tomorrow.'; + return remaining > 0 + ? 'Command limit: $remaining commands remaining today. Upgrade to unlock unlimited commands.' + : 'Daily command limit reached (0/$dailyLimit). Upgrade to unlock unlimited commands or try again tomorrow.'; } Future performDown(List buttonsClicked) async { @@ -125,11 +125,11 @@ abstract class BaseDevice { actionStreamInternal.add(LogNotification(_getCommandLimitMessage())); continue; } - + // For repeated actions, don't trigger key down/up events (useful for long press) final result = await core.actionHandler.performAction(action, isKeyDown: true, isKeyUp: false); actionStreamInternal.add(LogNotification(result.message)); - + // Increment command count after successful execution await IAPManager.instance.incrementCommandCount(); } @@ -142,10 +142,10 @@ abstract class BaseDevice { actionStreamInternal.add(LogNotification(_getCommandLimitMessage())); continue; } - + final result = await core.actionHandler.performAction(action, isKeyDown: true, isKeyUp: true); actionStreamInternal.add(ActionNotification(result)); - + // Increment command count after successful execution await IAPManager.instance.incrementCommandCount(); } @@ -158,10 +158,10 @@ abstract class BaseDevice { actionStreamInternal.add(LogNotification(_getCommandLimitMessage())); continue; } - + final result = await core.actionHandler.performAction(action, isKeyDown: false, isKeyUp: true); actionStreamInternal.add(ActionNotification(result)); - + // Increment command count after successful execution await IAPManager.instance.incrementCommandCount(); } diff --git a/lib/bluetooth/devices/bluetooth_device.dart b/lib/bluetooth/devices/bluetooth_device.dart index 4abe5c0..13fefc2 100644 --- a/lib/bluetooth/devices/bluetooth_device.dart +++ b/lib/bluetooth/devices/bluetooth_device.dart @@ -3,26 +3,26 @@ import 'dart:async'; import 'package:dartx/dartx.dart'; import 'package:flutter/foundation.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/bluetooth/ble.dart'; -import 'package:swift_control/bluetooth/devices/base_device.dart'; -import 'package:swift_control/bluetooth/devices/openbikecontrol/openbikecontrol_device.dart'; -import 'package:swift_control/bluetooth/devices/shimano/shimano_di2.dart'; -import 'package:swift_control/bluetooth/devices/wahoo/wahoo_kickr_bike_pro.dart'; -import 'package:swift_control/bluetooth/devices/wahoo/wahoo_kickr_bike_shift.dart'; -import 'package:swift_control/bluetooth/devices/wahoo/wahoo_kickr_headwind.dart'; -import 'package:swift_control/bluetooth/devices/zwift/constants.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_click.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_clickv2.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_device.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_play.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_ride.dart'; -import 'package:swift_control/main.dart'; -import 'package:swift_control/pages/device.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/widgets/ui/beta_pill.dart'; -import 'package:swift_control/widgets/ui/loading_widget.dart'; -import 'package:swift_control/widgets/ui/small_progress_indicator.dart'; +import 'package:bike_control/bluetooth/ble.dart'; +import 'package:bike_control/bluetooth/devices/base_device.dart'; +import 'package:bike_control/bluetooth/devices/openbikecontrol/openbikecontrol_device.dart'; +import 'package:bike_control/bluetooth/devices/shimano/shimano_di2.dart'; +import 'package:bike_control/bluetooth/devices/wahoo/wahoo_kickr_bike_pro.dart'; +import 'package:bike_control/bluetooth/devices/wahoo/wahoo_kickr_bike_shift.dart'; +import 'package:bike_control/bluetooth/devices/wahoo/wahoo_kickr_headwind.dart'; +import 'package:bike_control/bluetooth/devices/zwift/constants.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_click.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_clickv2.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_device.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_play.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_ride.dart'; +import 'package:bike_control/main.dart'; +import 'package:bike_control/pages/device.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/widgets/ui/beta_pill.dart'; +import 'package:bike_control/widgets/ui/loading_widget.dart'; +import 'package:bike_control/widgets/ui/small_progress_indicator.dart'; import 'package:universal_ble/universal_ble.dart'; import 'cycplus/cycplus_bc2.dart'; diff --git a/lib/bluetooth/devices/cycplus/cycplus_bc2.dart b/lib/bluetooth/devices/cycplus/cycplus_bc2.dart index ceb67a3..84619de 100644 --- a/lib/bluetooth/devices/cycplus/cycplus_bc2.dart +++ b/lib/bluetooth/devices/cycplus/cycplus_bc2.dart @@ -1,8 +1,8 @@ import 'dart:typed_data'; import 'package:flutter/material.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; import 'package:universal_ble/universal_ble.dart'; import '../bluetooth_device.dart'; diff --git a/lib/bluetooth/devices/elite/elite_square.dart b/lib/bluetooth/devices/elite/elite_square.dart index e4d1f34..b4f537e 100644 --- a/lib/bluetooth/devices/elite/elite_square.dart +++ b/lib/bluetooth/devices/elite/elite_square.dart @@ -1,6 +1,6 @@ import 'package:dartx/dartx.dart'; import 'package:flutter/foundation.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; import 'package:universal_ble/universal_ble.dart'; import '../../messages/notification.dart'; diff --git a/lib/bluetooth/devices/elite/elite_sterzo.dart b/lib/bluetooth/devices/elite/elite_sterzo.dart index 8d738aa..57d19cd 100644 --- a/lib/bluetooth/devices/elite/elite_sterzo.dart +++ b/lib/bluetooth/devices/elite/elite_sterzo.dart @@ -5,8 +5,8 @@ import 'package:dartx/dartx.dart'; import 'package:flutter/foundation.dart'; import 'package:http/http.dart' as http; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:swift_control/bluetooth/devices/bluetooth_device.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; +import 'package:bike_control/bluetooth/devices/bluetooth_device.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; import 'package:universal_ble/universal_ble.dart'; import '../../messages/notification.dart'; diff --git a/lib/bluetooth/devices/gamepad/gamepad_device.dart b/lib/bluetooth/devices/gamepad/gamepad_device.dart index be804b8..09eeb84 100644 --- a/lib/bluetooth/devices/gamepad/gamepad_device.dart +++ b/lib/bluetooth/devices/gamepad/gamepad_device.dart @@ -3,11 +3,11 @@ import 'dart:io'; import 'package:dartx/dartx.dart'; import 'package:flutter/material.dart'; import 'package:gamepads/gamepads.dart'; -import 'package:swift_control/bluetooth/devices/base_device.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/pages/device.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/widgets/ui/beta_pill.dart'; +import 'package:bike_control/bluetooth/devices/base_device.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/pages/device.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/widgets/ui/beta_pill.dart'; class GamepadDevice extends BaseDevice { final String id; diff --git a/lib/bluetooth/devices/hid/hid_device.dart b/lib/bluetooth/devices/hid/hid_device.dart index e064e1c..140ffad 100644 --- a/lib/bluetooth/devices/hid/hid_device.dart +++ b/lib/bluetooth/devices/hid/hid_device.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:swift_control/bluetooth/devices/base_device.dart'; -import 'package:swift_control/utils/actions/android.dart'; -import 'package:swift_control/utils/core.dart'; +import 'package:bike_control/bluetooth/devices/base_device.dart'; +import 'package:bike_control/utils/actions/android.dart'; +import 'package:bike_control/utils/core.dart'; class HidDevice extends BaseDevice { HidDevice(super.name) : super(availableButtons: []); diff --git a/lib/bluetooth/devices/mywhoosh/link.dart b/lib/bluetooth/devices/mywhoosh/link.dart index 33c87f3..740dd2f 100644 --- a/lib/bluetooth/devices/mywhoosh/link.dart +++ b/lib/bluetooth/devices/mywhoosh/link.dart @@ -2,15 +2,15 @@ import 'dart:convert'; import 'dart:io'; import 'package:flutter/foundation.dart'; -import 'package:swift_control/bluetooth/devices/trainer_connection.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/utils/actions/base_actions.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/keymap/keymap.dart'; -import 'package:swift_control/utils/requirements/multi.dart'; +import 'package:bike_control/bluetooth/devices/trainer_connection.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/utils/actions/base_actions.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/keymap/keymap.dart'; +import 'package:bike_control/utils/requirements/multi.dart'; class WhooshLink extends TrainerConnection { Socket? _socket; diff --git a/lib/bluetooth/devices/openbikecontrol/obc_ble_emulator.dart b/lib/bluetooth/devices/openbikecontrol/obc_ble_emulator.dart index adace26..fc7b13e 100644 --- a/lib/bluetooth/devices/openbikecontrol/obc_ble_emulator.dart +++ b/lib/bluetooth/devices/openbikecontrol/obc_ble_emulator.dart @@ -1,17 +1,17 @@ import 'dart:io'; +import 'package:bike_control/bluetooth/devices/openbikecontrol/openbikecontrol_device.dart'; +import 'package:bike_control/bluetooth/devices/openbikecontrol/protocol_parser.dart'; +import 'package:bike_control/bluetooth/devices/trainer_connection.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pbenum.dart'; +import 'package:bike_control/utils/actions/base_actions.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/keymap/keymap.dart'; +import 'package:bike_control/widgets/title.dart'; import 'package:bluetooth_low_energy/bluetooth_low_energy.dart'; import 'package:dartx/dartx.dart'; import 'package:flutter/foundation.dart'; -import 'package:swift_control/bluetooth/devices/openbikecontrol/openbikecontrol_device.dart'; -import 'package:swift_control/bluetooth/devices/openbikecontrol/protocol_parser.dart'; -import 'package:swift_control/bluetooth/devices/trainer_connection.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pbenum.dart'; -import 'package:swift_control/utils/actions/base_actions.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/keymap/keymap.dart'; -import 'package:swift_control/widgets/title.dart'; import '../../messages/notification.dart' show AlertNotification; @@ -124,37 +124,38 @@ class OpenBikeControlBluetoothEmulator extends TrainerConnection { }); } - // Device Information - await _peripheralManager.addService( - GATTService( - uuid: UUID.fromString('180A'), - isPrimary: true, - characteristics: [ - GATTCharacteristic.immutable( - uuid: UUID.fromString('2A29'), - value: Uint8List.fromList('BikeControl'.codeUnits), - descriptors: [], - ), - GATTCharacteristic.immutable( - uuid: UUID.fromString('2A25'), - value: Uint8List.fromList('1337'.codeUnits), - descriptors: [], - ), - GATTCharacteristic.immutable( - uuid: UUID.fromString('2A27'), - value: Uint8List.fromList('1.0'.codeUnits), - descriptors: [], - ), - GATTCharacteristic.immutable( - uuid: UUID.fromString('2A26'), - value: Uint8List.fromList((packageInfoValue?.version ?? '1.0.0').codeUnits), - descriptors: [], - ), - ], - includedServices: [], - ), - ); - + if (!Platform.isWindows) { + // Device Information + await _peripheralManager.addService( + GATTService( + uuid: UUID.fromString('180A'), + isPrimary: true, + characteristics: [ + GATTCharacteristic.immutable( + uuid: UUID.fromString('2A29'), + value: Uint8List.fromList('BikeControl'.codeUnits), + descriptors: [], + ), + GATTCharacteristic.immutable( + uuid: UUID.fromString('2A25'), + value: Uint8List.fromList('1337'.codeUnits), + descriptors: [], + ), + GATTCharacteristic.immutable( + uuid: UUID.fromString('2A27'), + value: Uint8List.fromList('1.0'.codeUnits), + descriptors: [], + ), + GATTCharacteristic.immutable( + uuid: UUID.fromString('2A26'), + value: Uint8List.fromList((packageInfoValue?.version ?? '1.0.0').codeUnits), + descriptors: [], + ), + ], + includedServices: [], + ), + ); + } // Battery Service await _peripheralManager.addService( GATTService( diff --git a/lib/bluetooth/devices/openbikecontrol/obc_mdns_emulator.dart b/lib/bluetooth/devices/openbikecontrol/obc_mdns_emulator.dart index fb5d833..fffe52d 100644 --- a/lib/bluetooth/devices/openbikecontrol/obc_mdns_emulator.dart +++ b/lib/bluetooth/devices/openbikecontrol/obc_mdns_emulator.dart @@ -3,16 +3,16 @@ import 'dart:io'; import 'package:dartx/dartx.dart'; import 'package:flutter/foundation.dart'; import 'package:nsd/nsd.dart'; -import 'package:swift_control/bluetooth/devices/openbikecontrol/openbikecontrol_device.dart'; -import 'package:swift_control/bluetooth/devices/openbikecontrol/protocol_parser.dart'; -import 'package:swift_control/bluetooth/devices/trainer_connection.dart'; -import 'package:swift_control/bluetooth/devices/zwift/ftms_mdns_emulator.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/utils/actions/base_actions.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/keymap/keymap.dart'; +import 'package:bike_control/bluetooth/devices/openbikecontrol/openbikecontrol_device.dart'; +import 'package:bike_control/bluetooth/devices/openbikecontrol/protocol_parser.dart'; +import 'package:bike_control/bluetooth/devices/trainer_connection.dart'; +import 'package:bike_control/bluetooth/devices/zwift/ftms_mdns_emulator.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/utils/actions/base_actions.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/keymap/keymap.dart'; class OpenBikeControlMdnsEmulator extends TrainerConnection { ServerSocket? _server; diff --git a/lib/bluetooth/devices/openbikecontrol/openbikecontrol_device.dart b/lib/bluetooth/devices/openbikecontrol/openbikecontrol_device.dart index e3e7d11..5c1fcda 100644 --- a/lib/bluetooth/devices/openbikecontrol/openbikecontrol_device.dart +++ b/lib/bluetooth/devices/openbikecontrol/openbikecontrol_device.dart @@ -1,8 +1,8 @@ import 'dart:typed_data'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/widgets/title.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/widgets/title.dart'; import 'package:universal_ble/universal_ble.dart'; import '../bluetooth_device.dart'; diff --git a/lib/bluetooth/devices/openbikecontrol/protocol_parser.dart b/lib/bluetooth/devices/openbikecontrol/protocol_parser.dart index 1b28943..09f0876 100644 --- a/lib/bluetooth/devices/openbikecontrol/protocol_parser.dart +++ b/lib/bluetooth/devices/openbikecontrol/protocol_parser.dart @@ -9,7 +9,7 @@ import 'dart:convert'; import 'dart:typed_data'; import 'package:dartx/dartx.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; class ProtocolParseException implements Exception { final String message; diff --git a/lib/bluetooth/devices/shimano/shimano_di2.dart b/lib/bluetooth/devices/shimano/shimano_di2.dart index 6c8686c..523e4a9 100644 --- a/lib/bluetooth/devices/shimano/shimano_di2.dart +++ b/lib/bluetooth/devices/shimano/shimano_di2.dart @@ -2,9 +2,9 @@ import 'dart:typed_data'; import 'package:dartx/dartx.dart'; import 'package:flutter/material.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/apps/custom_app.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/apps/custom_app.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; import 'package:universal_ble/universal_ble.dart'; import '../bluetooth_device.dart'; diff --git a/lib/bluetooth/devices/trainer_connection.dart b/lib/bluetooth/devices/trainer_connection.dart index e4a2a44..3ed881c 100644 --- a/lib/bluetooth/devices/trainer_connection.dart +++ b/lib/bluetooth/devices/trainer_connection.dart @@ -1,7 +1,7 @@ import 'package:flutter/foundation.dart'; -import 'package:swift_control/utils/actions/base_actions.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/keymap/keymap.dart'; +import 'package:bike_control/utils/actions/base_actions.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/keymap/keymap.dart'; abstract class TrainerConnection { final String title; diff --git a/lib/bluetooth/devices/wahoo/wahoo_kickr_bike_pro.dart b/lib/bluetooth/devices/wahoo/wahoo_kickr_bike_pro.dart index 21f5f5a..7bdab35 100644 --- a/lib/bluetooth/devices/wahoo/wahoo_kickr_bike_pro.dart +++ b/lib/bluetooth/devices/wahoo/wahoo_kickr_bike_pro.dart @@ -1,4 +1,4 @@ -import 'package:swift_control/bluetooth/devices/zwift/zwift_ride.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_ride.dart'; import '../zwift/constants.dart'; diff --git a/lib/bluetooth/devices/wahoo/wahoo_kickr_bike_shift.dart b/lib/bluetooth/devices/wahoo/wahoo_kickr_bike_shift.dart index 2c9121b..cdc5156 100644 --- a/lib/bluetooth/devices/wahoo/wahoo_kickr_bike_shift.dart +++ b/lib/bluetooth/devices/wahoo/wahoo_kickr_bike_shift.dart @@ -2,7 +2,7 @@ import 'dart:collection'; import 'dart:typed_data'; import 'package:flutter/material.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; import 'package:universal_ble/universal_ble.dart'; import '../bluetooth_device.dart'; diff --git a/lib/bluetooth/devices/wahoo/wahoo_kickr_headwind.dart b/lib/bluetooth/devices/wahoo/wahoo_kickr_headwind.dart index 40143d2..2eca4fb 100644 --- a/lib/bluetooth/devices/wahoo/wahoo_kickr_headwind.dart +++ b/lib/bluetooth/devices/wahoo/wahoo_kickr_headwind.dart @@ -1,10 +1,10 @@ import 'dart:typed_data'; -import 'package:swift_control/bluetooth/devices/zwift/ftms_mdns_emulator.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/utils/actions/base_actions.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/keymap/keymap.dart'; +import 'package:bike_control/bluetooth/devices/zwift/ftms_mdns_emulator.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/utils/actions/base_actions.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/keymap/keymap.dart'; import 'package:universal_ble/universal_ble.dart'; import '../bluetooth_device.dart'; diff --git a/lib/bluetooth/devices/zwift/constants.dart b/lib/bluetooth/devices/zwift/constants.dart index 73a6072..c88f813 100644 --- a/lib/bluetooth/devices/zwift/constants.dart +++ b/lib/bluetooth/devices/zwift/constants.dart @@ -1,7 +1,7 @@ import 'dart:typed_data'; import 'package:flutter/material.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; class ZwiftConstants { static const ZWIFT_CUSTOM_SERVICE_UUID = "00000001-19CA-4651-86E5-FA29DCDD09D1"; diff --git a/lib/bluetooth/devices/zwift/ftms_mdns_emulator.dart b/lib/bluetooth/devices/zwift/ftms_mdns_emulator.dart index 91e2e61..238208b 100644 --- a/lib/bluetooth/devices/zwift/ftms_mdns_emulator.dart +++ b/lib/bluetooth/devices/zwift/ftms_mdns_emulator.dart @@ -3,17 +3,17 @@ import 'dart:io'; import 'package:dartx/dartx.dart'; import 'package:flutter/foundation.dart'; import 'package:nsd/nsd.dart'; -import 'package:swift_control/bluetooth/devices/trainer_connection.dart'; -import 'package:swift_control/bluetooth/devices/zwift/constants.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pbenum.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zwift.pb.dart' show RideKeyPadStatus; -import 'package:swift_control/bluetooth/devices/zwift/zwift_ride.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/utils/actions/base_actions.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/keymap/keymap.dart'; +import 'package:bike_control/bluetooth/devices/trainer_connection.dart'; +import 'package:bike_control/bluetooth/devices/zwift/constants.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pbenum.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zwift.pb.dart' show RideKeyPadStatus; +import 'package:bike_control/bluetooth/devices/zwift/zwift_ride.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/utils/actions/base_actions.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/keymap/keymap.dart'; class FtmsMdnsEmulator extends TrainerConnection { ServerSocket? _tcpServer; diff --git a/lib/bluetooth/devices/zwift/zwift_click.dart b/lib/bluetooth/devices/zwift/zwift_click.dart index 64f4e9a..a85cffe 100644 --- a/lib/bluetooth/devices/zwift/zwift_click.dart +++ b/lib/bluetooth/devices/zwift/zwift_click.dart @@ -1,7 +1,7 @@ import 'package:flutter/foundation.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zwift.pb.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_device.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zwift.pb.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_device.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; import 'constants.dart'; diff --git a/lib/bluetooth/devices/zwift/zwift_clickv2.dart b/lib/bluetooth/devices/zwift/zwift_clickv2.dart index 8795064..d76a8c3 100644 --- a/lib/bluetooth/devices/zwift/zwift_clickv2.dart +++ b/lib/bluetooth/devices/zwift/zwift_clickv2.dart @@ -1,15 +1,14 @@ import 'package:dartx/dartx.dart'; import 'package:flutter/foundation.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/bluetooth/devices/zwift/constants.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pbenum.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_ride.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/pages/markdown.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/widgets/ui/warning.dart'; +import 'package:bike_control/bluetooth/devices/zwift/constants.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pbenum.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_ride.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/pages/markdown.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/widgets/ui/warning.dart'; class ZwiftClickV2 extends ZwiftRide { ZwiftClickV2(super.scanResult) @@ -51,12 +50,6 @@ class ZwiftClickV2 extends ZwiftRide { if (bytes.startsWith(ZwiftConstants.RESPONSE_STOPPED_CLICK_V2_VARIANT_1) || bytes.startsWith(ZwiftConstants.RESPONSE_STOPPED_CLICK_V2_VARIANT_2)) { _noLongerSendsEvents = true; - actionStreamInternal.add( - AlertNotification( - LogLevel.LOGLEVEL_WARNING, - 'Your Zwift Click V2 no longer sends events. Connect it in the Zwift app once each session.', - ), - ); } return super.processData(bytes); } @@ -72,53 +65,74 @@ class ZwiftClickV2 extends ZwiftRide { children: [ super.showInformation(context), - if (isConnected && _noLongerSendsEvents && core.settings.getShowZwiftClickV2ReconnectWarning()) - Warning( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Text( - AppLocalizations.of(context).clickV2Instructions, - ).xSmall, - ), - IconButton.link( - icon: Icon(Icons.close), - onPressed: () { - core.settings.setShowZwiftClickV2ReconnectWarning(false); - setState(() {}); - }, - ), - ], - ), - Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - spacing: 8, - children: [ - GhostButton( - onPressed: () { - sendCommand(Opcode.RESET, null); - }, - child: Text('Reset now'), - ), - OutlineButton( - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (_) => MarkdownPage(assetPath: 'TROUBLESHOOTING.md'), - ), - ); - }, - leading: const Icon(Icons.open_in_new), - child: Text(context.i18n.troubleshootingGuide), - ), - ], - ), - ], - ), + if (isConnected && _noLongerSendsEvents) + if (core.settings.getShowZwiftClickV2ReconnectWarning()) + Warning( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Text( + AppLocalizations.of(context).clickV2Instructions, + ).xSmall, + ), + IconButton.link( + icon: Icon(Icons.close), + onPressed: () { + core.settings.setShowZwiftClickV2ReconnectWarning(false); + setState(() {}); + }, + ), + ], + ), + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 8, + children: [ + GhostButton( + onPressed: () { + sendCommand(Opcode.RESET, null); + }, + child: Text('Reset now'), + ), + OutlineButton( + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => MarkdownPage(assetPath: 'TROUBLESHOOTING.md'), + ), + ); + }, + leading: const Icon(Icons.open_in_new), + child: Text(context.i18n.troubleshootingGuide), + ), + ], + ), + ], + ) + else + Warning( + important: false, + children: [ + Text( + AppLocalizations.of(context).clickV2EventInfo, + ).xSmall, + LinkButton( + child: Text(context.i18n.troubleshootingGuide), + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => MarkdownPage(assetPath: 'TROUBLESHOOTING.md'), + ), + ); + }, + ), + ], + ), ], ); }, diff --git a/lib/bluetooth/devices/zwift/zwift_device.dart b/lib/bluetooth/devices/zwift/zwift_device.dart index 23450e9..459934e 100644 --- a/lib/bluetooth/devices/zwift/zwift_device.dart +++ b/lib/bluetooth/devices/zwift/zwift_device.dart @@ -2,13 +2,13 @@ import 'dart:async'; import 'package:dartx/dartx.dart'; import 'package:flutter/foundation.dart'; -import 'package:swift_control/bluetooth/devices/bluetooth_device.dart'; -import 'package:swift_control/bluetooth/devices/zwift/constants.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pbenum.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/single_line_exception.dart'; +import 'package:bike_control/bluetooth/devices/bluetooth_device.dart'; +import 'package:bike_control/bluetooth/devices/zwift/constants.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pbenum.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/single_line_exception.dart'; import 'package:universal_ble/universal_ble.dart'; abstract class ZwiftDevice extends BluetoothDevice { diff --git a/lib/bluetooth/devices/zwift/zwift_emulator.dart b/lib/bluetooth/devices/zwift/zwift_emulator.dart index c2a0aff..f9cebb2 100644 --- a/lib/bluetooth/devices/zwift/zwift_emulator.dart +++ b/lib/bluetooth/devices/zwift/zwift_emulator.dart @@ -1,23 +1,23 @@ import 'dart:io'; +import 'package:bike_control/bluetooth/ble.dart'; +import 'package:bike_control/bluetooth/devices/trainer_connection.dart'; +import 'package:bike_control/bluetooth/devices/zwift/constants.dart'; +import 'package:bike_control/bluetooth/devices/zwift/ftms_mdns_emulator.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zwift.pbserver.dart' hide RideButtonMask; +import 'package:bike_control/bluetooth/devices/zwift/zwift_ride.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/utils/actions/base_actions.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/keymap/keymap.dart'; +import 'package:bike_control/utils/requirements/multi.dart'; +import 'package:bike_control/widgets/title.dart'; import 'package:bluetooth_low_energy/bluetooth_low_energy.dart'; import 'package:flutter/foundation.dart'; import 'package:permission_handler/permission_handler.dart'; -import 'package:swift_control/bluetooth/ble.dart'; -import 'package:swift_control/bluetooth/devices/trainer_connection.dart'; -import 'package:swift_control/bluetooth/devices/zwift/constants.dart'; -import 'package:swift_control/bluetooth/devices/zwift/ftms_mdns_emulator.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zwift.pbserver.dart' hide RideButtonMask; -import 'package:swift_control/bluetooth/devices/zwift/zwift_ride.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/utils/actions/base_actions.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/keymap/keymap.dart'; -import 'package:swift_control/utils/requirements/multi.dart'; -import 'package:swift_control/widgets/title.dart'; class ZwiftEmulator extends TrainerConnection { bool get isLoading => _isLoading; @@ -178,37 +178,38 @@ class ZwiftEmulator extends TrainerConnection { }); } - // Device Information - await _peripheralManager.addService( - GATTService( - uuid: UUID.fromString('180A'), - isPrimary: true, - characteristics: [ - GATTCharacteristic.immutable( - uuid: UUID.fromString('2A29'), - value: Uint8List.fromList('BikeControl'.codeUnits), - descriptors: [], - ), - GATTCharacteristic.immutable( - uuid: UUID.fromString('2A25'), - value: Uint8List.fromList('09-B48123283828F1337'.codeUnits), - descriptors: [], - ), - GATTCharacteristic.immutable( - uuid: UUID.fromString('2A27'), - value: Uint8List.fromList('A.0'.codeUnits), - descriptors: [], - ), - GATTCharacteristic.immutable( - uuid: UUID.fromString('2A26'), - value: Uint8List.fromList((packageInfoValue?.version ?? '1.0.0').codeUnits), - descriptors: [], - ), - ], - includedServices: [], - ), - ); - + if (!Platform.isWindows) { + // Device Information + await _peripheralManager.addService( + GATTService( + uuid: UUID.fromString('180A'), + isPrimary: true, + characteristics: [ + GATTCharacteristic.immutable( + uuid: UUID.fromString('2A29'), + value: Uint8List.fromList('BikeControl'.codeUnits), + descriptors: [], + ), + GATTCharacteristic.immutable( + uuid: UUID.fromString('2A25'), + value: Uint8List.fromList('09-B48123283828F1337'.codeUnits), + descriptors: [], + ), + GATTCharacteristic.immutable( + uuid: UUID.fromString('2A27'), + value: Uint8List.fromList('A.0'.codeUnits), + descriptors: [], + ), + GATTCharacteristic.immutable( + uuid: UUID.fromString('2A26'), + value: Uint8List.fromList((packageInfoValue?.version ?? '1.0.0').codeUnits), + descriptors: [], + ), + ], + includedServices: [], + ), + ); + } // Battery Service await _peripheralManager.addService( GATTService( diff --git a/lib/bluetooth/devices/zwift/zwift_play.dart b/lib/bluetooth/devices/zwift/zwift_play.dart index 1e13bed..276782b 100644 --- a/lib/bluetooth/devices/zwift/zwift_play.dart +++ b/lib/bluetooth/devices/zwift/zwift_play.dart @@ -1,11 +1,11 @@ import 'package:flutter/foundation.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/bluetooth/devices/zwift/constants.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zwift.pb.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_device.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; +import 'package:bike_control/bluetooth/devices/zwift/constants.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zwift.pb.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_device.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; class ZwiftPlay extends ZwiftDevice { ZwiftPlay(super.scanResult) diff --git a/lib/bluetooth/devices/zwift/zwift_ride.dart b/lib/bluetooth/devices/zwift/zwift_ride.dart index 0d912ec..0c396aa 100644 --- a/lib/bluetooth/devices/zwift/zwift_ride.dart +++ b/lib/bluetooth/devices/zwift/zwift_ride.dart @@ -1,14 +1,14 @@ import 'package:dartx/dartx.dart'; import 'package:flutter/foundation.dart'; import 'package:protobuf/protobuf.dart' as $pb; -import 'package:swift_control/bluetooth/devices/zwift/constants.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp_vendor.pb.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zwift.pb.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_device.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; +import 'package:bike_control/bluetooth/devices/zwift/constants.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp_vendor.pb.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zwift.pb.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_device.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; import 'package:universal_ble/universal_ble.dart'; class ZwiftRide extends ZwiftDevice { diff --git a/lib/bluetooth/messages/notification.dart b/lib/bluetooth/messages/notification.dart index 2752c2a..82f780c 100644 --- a/lib/bluetooth/messages/notification.dart +++ b/lib/bluetooth/messages/notification.dart @@ -1,9 +1,9 @@ import 'package:dartx/dartx.dart'; import 'package:flutter/foundation.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; -import 'package:swift_control/utils/actions/base_actions.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/widgets/keymap_explanation.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/utils/actions/base_actions.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/widgets/keymap_explanation.dart'; class BaseNotification {} diff --git a/lib/bluetooth/remote_pairing.dart b/lib/bluetooth/remote_pairing.dart index f87a9bc..3ca61e2 100644 --- a/lib/bluetooth/remote_pairing.dart +++ b/lib/bluetooth/remote_pairing.dart @@ -3,15 +3,15 @@ import 'dart:io'; import 'package:bluetooth_low_energy/bluetooth_low_energy.dart'; import 'package:flutter/foundation.dart'; import 'package:permission_handler/permission_handler.dart'; -import 'package:swift_control/bluetooth/devices/trainer_connection.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/utils/actions/base_actions.dart'; -import 'package:swift_control/utils/actions/remote.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/requirements/multi.dart'; +import 'package:bike_control/bluetooth/devices/trainer_connection.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/utils/actions/base_actions.dart'; +import 'package:bike_control/utils/actions/remote.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/requirements/multi.dart'; import '../utils/keymap/keymap.dart'; diff --git a/lib/i10n/intl_en.arb b/lib/i10n/intl_en.arb index 3e6e079..a062ffa 100644 --- a/lib/i10n/intl_en.arb +++ b/lib/i10n/intl_en.arb @@ -457,5 +457,6 @@ "noTrainerSelected": "No Trainer selected", "instructions": "Instructions", "mailSupportExplanation": "Providing individual support via email is a lot of work for me.\n\nPlease consider using Reddit, Facebook or GitHub for questions and issues so that the whole community can benefit from it.", - "myWhooshLinkInfo": "Please check the troubleshooting section if you encounter any issues. A much more reliable connection method is coming soon!" + "myWhooshLinkInfo": "Please check the troubleshooting section if you encounter any issues. A much more reliable connection method is coming soon!", + "clickV2EventInfo": "Your Click V2 may no longer send button events. Please check by tapping a few buttons and see if they are visible in BikeControl." } diff --git a/lib/main.dart b/lib/main.dart index 5bd0e64..dc3f56e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,13 +6,13 @@ import 'package:flutter/foundation.dart'; import 'package:flutter_localizations/flutter_localizations.dart' show GlobalMaterialLocalizations, GlobalWidgetsLocalizations; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/utils/actions/android.dart'; -import 'package:swift_control/utils/actions/desktop.dart'; -import 'package:swift_control/utils/actions/remote.dart'; -import 'package:swift_control/widgets/menu.dart'; -import 'package:swift_control/widgets/testbed.dart'; -import 'package:swift_control/widgets/ui/colors.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/utils/actions/android.dart'; +import 'package:bike_control/utils/actions/desktop.dart'; +import 'package:bike_control/utils/actions/remote.dart'; +import 'package:bike_control/widgets/menu.dart'; +import 'package:bike_control/widgets/testbed.dart'; +import 'package:bike_control/widgets/ui/colors.dart'; import 'pages/navigation.dart'; import 'utils/actions/base_actions.dart'; diff --git a/lib/pages/button_edit.dart b/lib/pages/button_edit.dart index 5e69a24..69f16bf 100644 --- a/lib/pages/button_edit.dart +++ b/lib/pages/button_edit.dart @@ -1,19 +1,19 @@ import 'package:dartx/dartx.dart'; import 'package:flutter/services.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/pages/touch_area.dart'; -import 'package:swift_control/utils/actions/base_actions.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/utils/keymap/apps/custom_app.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/keymap/keymap.dart'; -import 'package:swift_control/widgets/custom_keymap_selector.dart'; -import 'package:swift_control/widgets/ui/button_widget.dart'; -import 'package:swift_control/widgets/ui/colored_title.dart'; -import 'package:swift_control/widgets/ui/colors.dart'; -import 'package:swift_control/widgets/ui/warning.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/pages/touch_area.dart'; +import 'package:bike_control/utils/actions/base_actions.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/utils/keymap/apps/custom_app.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/keymap/keymap.dart'; +import 'package:bike_control/widgets/custom_keymap_selector.dart'; +import 'package:bike_control/widgets/ui/button_widget.dart'; +import 'package:bike_control/widgets/ui/colored_title.dart'; +import 'package:bike_control/widgets/ui/colors.dart'; +import 'package:bike_control/widgets/ui/warning.dart'; class ButtonEditPage extends StatefulWidget { final KeyPair keyPair; diff --git a/lib/pages/button_simulator.dart b/lib/pages/button_simulator.dart index 55b1cc9..2bdb85a 100644 --- a/lib/pages/button_simulator.dart +++ b/lib/pages/button_simulator.dart @@ -2,16 +2,16 @@ import 'package:dartx/dartx.dart'; import 'package:flutter/material.dart' show BackButton; import 'package:flutter/services.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/bluetooth/devices/trainer_connection.dart'; -import 'package:swift_control/pages/touch_area.dart'; -import 'package:swift_control/utils/actions/android.dart'; -import 'package:swift_control/utils/actions/desktop.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/keymap/keymap.dart'; -import 'package:swift_control/widgets/ui/gradient_text.dart'; -import 'package:swift_control/widgets/ui/warning.dart'; +import 'package:bike_control/bluetooth/devices/trainer_connection.dart'; +import 'package:bike_control/pages/touch_area.dart'; +import 'package:bike_control/utils/actions/android.dart'; +import 'package:bike_control/utils/actions/desktop.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/keymap/keymap.dart'; +import 'package:bike_control/widgets/ui/gradient_text.dart'; +import 'package:bike_control/widgets/ui/warning.dart'; class ButtonSimulator extends StatefulWidget { const ButtonSimulator({super.key}); diff --git a/lib/pages/configuration.dart b/lib/pages/configuration.dart index 459d2a2..7887415 100644 --- a/lib/pages/configuration.dart +++ b/lib/pages/configuration.dart @@ -1,18 +1,18 @@ import 'dart:io'; +import 'package:bike_control/main.dart'; +import 'package:bike_control/pages/button_edit.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/utils/keymap/apps/custom_app.dart'; +import 'package:bike_control/utils/keymap/apps/my_whoosh.dart'; +import 'package:bike_control/utils/keymap/apps/supported_app.dart'; +import 'package:bike_control/utils/requirements/multi.dart'; +import 'package:bike_control/widgets/iap_status_widget.dart'; +import 'package:bike_control/widgets/ui/colored_title.dart'; +import 'package:bike_control/widgets/ui/warning.dart'; import 'package:flutter/foundation.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/main.dart'; -import 'package:swift_control/pages/button_edit.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/utils/keymap/apps/custom_app.dart'; -import 'package:swift_control/utils/keymap/apps/my_whoosh.dart'; -import 'package:swift_control/utils/keymap/apps/supported_app.dart'; -import 'package:swift_control/utils/requirements/multi.dart'; -import 'package:swift_control/widgets/iap_status_widget.dart'; -import 'package:swift_control/widgets/ui/colored_title.dart'; -import 'package:swift_control/widgets/ui/warning.dart'; class ConfigurationPage extends StatefulWidget { final VoidCallback onUpdate; diff --git a/lib/pages/customize.dart b/lib/pages/customize.dart index 0f9d054..b8b3448 100644 --- a/lib/pages/customize.dart +++ b/lib/pages/customize.dart @@ -1,15 +1,15 @@ import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_device.dart'; -import 'package:swift_control/main.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/utils/keymap/apps/custom_app.dart'; -import 'package:swift_control/utils/keymap/apps/supported_app.dart'; -import 'package:swift_control/utils/keymap/manager.dart'; -import 'package:swift_control/widgets/keymap_explanation.dart'; -import 'package:swift_control/widgets/ui/beta_pill.dart'; -import 'package:swift_control/widgets/ui/colored_title.dart'; -import 'package:swift_control/widgets/ui/warning.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_device.dart'; +import 'package:bike_control/main.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/utils/keymap/apps/custom_app.dart'; +import 'package:bike_control/utils/keymap/apps/supported_app.dart'; +import 'package:bike_control/utils/keymap/manager.dart'; +import 'package:bike_control/widgets/keymap_explanation.dart'; +import 'package:bike_control/widgets/ui/beta_pill.dart'; +import 'package:bike_control/widgets/ui/colored_title.dart'; +import 'package:bike_control/widgets/ui/warning.dart'; class CustomizePage extends StatefulWidget { const CustomizePage({super.key}); diff --git a/lib/pages/device.dart b/lib/pages/device.dart index f503096..43d2377 100644 --- a/lib/pages/device.dart +++ b/lib/pages/device.dart @@ -3,15 +3,15 @@ import 'dart:async'; import 'package:dartx/dartx.dart'; import 'package:flutter/foundation.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; -import 'package:swift_control/main.dart'; -import 'package:swift_control/pages/button_simulator.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/widgets/scan.dart'; -import 'package:swift_control/widgets/ui/colored_title.dart'; -import 'package:swift_control/widgets/ui/toast.dart'; -import 'package:swift_control/widgets/ui/warning.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/main.dart'; +import 'package:bike_control/pages/button_simulator.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/widgets/scan.dart'; +import 'package:bike_control/widgets/ui/colored_title.dart'; +import 'package:bike_control/widgets/ui/toast.dart'; +import 'package:bike_control/widgets/ui/warning.dart'; import 'package:url_launcher/url_launcher_string.dart'; import '../bluetooth/devices/base_device.dart'; diff --git a/lib/pages/markdown.dart b/lib/pages/markdown.dart index b1f615a..579f963 100644 --- a/lib/pages/markdown.dart +++ b/lib/pages/markdown.dart @@ -4,7 +4,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_md/flutter_md.dart'; import 'package:http/http.dart' as http; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/widgets/ui/colored_title.dart'; +import 'package:bike_control/widgets/ui/colored_title.dart'; import 'package:url_launcher/url_launcher_string.dart'; class MarkdownPage extends StatefulWidget { diff --git a/lib/pages/navigation.dart b/lib/pages/navigation.dart index b9ba722..83231a2 100644 --- a/lib/pages/navigation.dart +++ b/lib/pages/navigation.dart @@ -5,17 +5,17 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/main.dart'; -import 'package:swift_control/pages/customize.dart'; -import 'package:swift_control/pages/device.dart'; -import 'package:swift_control/pages/trainer.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/widgets/logviewer.dart'; -import 'package:swift_control/widgets/menu.dart'; -import 'package:swift_control/widgets/title.dart'; -import 'package:swift_control/widgets/ui/colors.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/main.dart'; +import 'package:bike_control/pages/customize.dart'; +import 'package:bike_control/pages/device.dart'; +import 'package:bike_control/pages/trainer.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/widgets/logviewer.dart'; +import 'package:bike_control/widgets/menu.dart'; +import 'package:bike_control/widgets/title.dart'; +import 'package:bike_control/widgets/ui/colors.dart'; import '../widgets/changelog_dialog.dart'; diff --git a/lib/pages/touch_area.dart b/lib/pages/touch_area.dart index 64392f0..03fe416 100644 --- a/lib/pages/touch_area.dart +++ b/lib/pages/touch_area.dart @@ -9,13 +9,13 @@ import 'package:flutter/services.dart'; import 'package:image_picker/image_picker.dart'; import 'package:path_provider/path_provider.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/main.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/widgets/keymap_explanation.dart'; -import 'package:swift_control/widgets/testbed.dart'; -import 'package:swift_control/widgets/ui/button_widget.dart'; -import 'package:swift_control/widgets/ui/colors.dart'; +import 'package:bike_control/main.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/widgets/keymap_explanation.dart'; +import 'package:bike_control/widgets/testbed.dart'; +import 'package:bike_control/widgets/ui/button_widget.dart'; +import 'package:bike_control/widgets/ui/colors.dart'; import 'package:window_manager/window_manager.dart'; import '../utils/actions/base_actions.dart'; diff --git a/lib/pages/trainer.dart b/lib/pages/trainer.dart index d42a14e..161c937 100644 --- a/lib/pages/trainer.dart +++ b/lib/pages/trainer.dart @@ -6,24 +6,24 @@ import 'package:device_auto_rotate_checker/device_auto_rotate_checker.dart'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/foundation.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/main.dart'; -import 'package:swift_control/pages/configuration.dart'; -import 'package:swift_control/utils/actions/android.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/utils/requirements/multi.dart'; -import 'package:swift_control/widgets/apps/mywhoosh_link_tile.dart'; -import 'package:swift_control/widgets/apps/openbikecontrol_ble_tile.dart'; -import 'package:swift_control/widgets/apps/openbikecontrol_mdns_tile.dart'; -import 'package:swift_control/widgets/apps/zwift_mdns_tile.dart'; -import 'package:swift_control/widgets/apps/zwift_tile.dart'; -import 'package:swift_control/widgets/pair_widget.dart'; -import 'package:swift_control/widgets/ui/colored_title.dart'; -import 'package:swift_control/widgets/ui/connection_method.dart'; -import 'package:swift_control/widgets/ui/toast.dart'; -import 'package:swift_control/widgets/ui/warning.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/main.dart'; +import 'package:bike_control/pages/configuration.dart'; +import 'package:bike_control/utils/actions/android.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/utils/requirements/multi.dart'; +import 'package:bike_control/widgets/apps/mywhoosh_link_tile.dart'; +import 'package:bike_control/widgets/apps/openbikecontrol_ble_tile.dart'; +import 'package:bike_control/widgets/apps/openbikecontrol_mdns_tile.dart'; +import 'package:bike_control/widgets/apps/zwift_mdns_tile.dart'; +import 'package:bike_control/widgets/apps/zwift_tile.dart'; +import 'package:bike_control/widgets/pair_widget.dart'; +import 'package:bike_control/widgets/ui/colored_title.dart'; +import 'package:bike_control/widgets/ui/connection_method.dart'; +import 'package:bike_control/widgets/ui/toast.dart'; +import 'package:bike_control/widgets/ui/warning.dart'; import 'package:universal_ble/universal_ble.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher_string.dart' show launchUrlString; diff --git a/lib/utils/actions/android.dart b/lib/utils/actions/android.dart index 47a78c6..834ea79 100644 --- a/lib/utils/actions/android.dart +++ b/lib/utils/actions/android.dart @@ -1,11 +1,11 @@ import 'package:accessibility/accessibility.dart'; import 'package:dartx/dartx.dart'; import 'package:flutter/services.dart'; -import 'package:swift_control/bluetooth/devices/hid/hid_device.dart'; -import 'package:swift_control/utils/actions/base_actions.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/widgets/keymap_explanation.dart'; +import 'package:bike_control/bluetooth/devices/hid/hid_device.dart'; +import 'package:bike_control/utils/actions/base_actions.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/widgets/keymap_explanation.dart'; import '../keymap/apps/supported_app.dart'; import '../single_line_exception.dart'; diff --git a/lib/utils/actions/base_actions.dart b/lib/utils/actions/base_actions.dart index f9d9c16..4473fb1 100644 --- a/lib/utils/actions/base_actions.dart +++ b/lib/utils/actions/base_actions.dart @@ -6,14 +6,14 @@ import 'package:dartx/dartx.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:screen_retriever/screen_retriever.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/utils/actions/android.dart'; -import 'package:swift_control/utils/actions/desktop.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/keymap/keymap.dart'; -import 'package:swift_control/widgets/keymap_explanation.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/utils/actions/android.dart'; +import 'package:bike_control/utils/actions/desktop.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/keymap/keymap.dart'; +import 'package:bike_control/widgets/keymap_explanation.dart'; import '../keymap/apps/supported_app.dart'; diff --git a/lib/utils/actions/desktop.dart b/lib/utils/actions/desktop.dart index bf4abf7..fb1ce4d 100644 --- a/lib/utils/actions/desktop.dart +++ b/lib/utils/actions/desktop.dart @@ -1,9 +1,9 @@ import 'dart:ui'; import 'package:keypress_simulator/keypress_simulator.dart'; -import 'package:swift_control/utils/actions/base_actions.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/actions/base_actions.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; class DesktopActions extends BaseActions { DesktopActions({super.supportedModes = const [SupportedMode.keyboard, SupportedMode.touch, SupportedMode.media]}); diff --git a/lib/utils/actions/remote.dart b/lib/utils/actions/remote.dart index 59bb404..344391c 100644 --- a/lib/utils/actions/remote.dart +++ b/lib/utils/actions/remote.dart @@ -1,10 +1,10 @@ import 'dart:ui'; import 'package:accessibility/accessibility.dart'; -import 'package:swift_control/utils/actions/base_actions.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/keymap/keymap.dart'; +import 'package:bike_control/utils/actions/base_actions.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/keymap/keymap.dart'; class RemoteActions extends BaseActions { RemoteActions({super.supportedModes = const [SupportedMode.touch]}); diff --git a/lib/utils/core.dart b/lib/utils/core.dart index 06b913e..b0f2ba1 100644 --- a/lib/utils/core.dart +++ b/lib/utils/core.dart @@ -5,24 +5,24 @@ import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:media_key_detector/media_key_detector.dart'; -import 'package:swift_control/bluetooth/devices/hid/hid_device.dart'; -import 'package:swift_control/bluetooth/devices/openbikecontrol/obc_ble_emulator.dart'; -import 'package:swift_control/bluetooth/devices/openbikecontrol/obc_mdns_emulator.dart'; -import 'package:swift_control/bluetooth/devices/openbikecontrol/protocol_parser.dart'; -import 'package:swift_control/bluetooth/devices/trainer_connection.dart'; -import 'package:swift_control/bluetooth/devices/zwift/ftms_mdns_emulator.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_emulator.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/bluetooth/remote_pairing.dart'; -import 'package:swift_control/main.dart'; -import 'package:swift_control/utils/actions/android.dart'; -import 'package:swift_control/utils/actions/base_actions.dart'; -import 'package:swift_control/utils/actions/remote.dart'; -import 'package:swift_control/utils/keymap/apps/my_whoosh.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/requirements/android.dart'; -import 'package:swift_control/utils/settings/settings.dart'; +import 'package:bike_control/bluetooth/devices/hid/hid_device.dart'; +import 'package:bike_control/bluetooth/devices/openbikecontrol/obc_ble_emulator.dart'; +import 'package:bike_control/bluetooth/devices/openbikecontrol/obc_mdns_emulator.dart'; +import 'package:bike_control/bluetooth/devices/openbikecontrol/protocol_parser.dart'; +import 'package:bike_control/bluetooth/devices/trainer_connection.dart'; +import 'package:bike_control/bluetooth/devices/zwift/ftms_mdns_emulator.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_emulator.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/bluetooth/remote_pairing.dart'; +import 'package:bike_control/main.dart'; +import 'package:bike_control/utils/actions/android.dart'; +import 'package:bike_control/utils/actions/base_actions.dart'; +import 'package:bike_control/utils/actions/remote.dart'; +import 'package:bike_control/utils/keymap/apps/my_whoosh.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/requirements/android.dart'; +import 'package:bike_control/utils/settings/settings.dart'; import 'package:universal_ble/universal_ble.dart'; import '../bluetooth/connection.dart'; @@ -101,8 +101,7 @@ class Permissions { return [ BluetoothTurnedOn(), if (Platform.isAndroid) ...[ - BluetoothScanRequirement(), - BluetoothConnectRequirement(), + BluetoothAdvertiseRequirement(), ], ]; } diff --git a/lib/utils/i18n_extension.dart b/lib/utils/i18n_extension.dart index 65ba4e7..d08e5b4 100644 --- a/lib/utils/i18n_extension.dart +++ b/lib/utils/i18n_extension.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:swift_control/gen/l10n.dart'; +import 'package:bike_control/gen/l10n.dart'; extension Intl on BuildContext { AppLocalizations get i18n => AppLocalizations.of(this); diff --git a/lib/utils/iap/iap_manager.dart b/lib/utils/iap/iap_manager.dart index b760489..0d9bbe3 100644 --- a/lib/utils/iap/iap_manager.dart +++ b/lib/utils/iap/iap_manager.dart @@ -1,9 +1,9 @@ import 'dart:io'; +import 'package:bike_control/utils/iap/iap_service.dart'; +import 'package:bike_control/utils/iap/windows_iap_service.dart'; import 'package:flutter/foundation.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:swift_control/utils/iap/iap_service.dart'; -import 'package:swift_control/utils/iap/windows_iap_service.dart'; /// Unified IAP manager that handles platform-specific IAP services class IAPManager { @@ -12,22 +12,22 @@ class IAPManager { _instance ??= IAPManager._(); return _instance!; } - + IAPService? _iapService; WindowsIAPService? _windowsIapService; SharedPreferences? _prefs; - + IAPManager._(); - + /// Initialize the IAP manager Future initialize(SharedPreferences prefs) async { _prefs = prefs; - + if (kIsWeb) { // Web doesn't support IAP return; } - + try { if (Platform.isWindows) { _windowsIapService = WindowsIAPService(prefs); @@ -40,7 +40,7 @@ class IAPManager { debugPrint('Error initializing IAP manager: $e'); } } - + /// Check if the user has purchased the full version bool get isPurchased { if (_iapService != null) { @@ -50,7 +50,7 @@ class IAPManager { } return false; } - + /// Check if the trial period has started bool get hasTrialStarted { if (_iapService != null) { @@ -60,7 +60,7 @@ class IAPManager { } return false; } - + /// Start the trial period Future startTrial() async { if (_iapService != null) { @@ -69,7 +69,7 @@ class IAPManager { await _windowsIapService!.startTrial(); } } - + /// Get the number of days remaining in the trial int get trialDaysRemaining { if (_iapService != null) { @@ -79,7 +79,7 @@ class IAPManager { } return 0; } - + /// Check if the trial has expired bool get isTrialExpired { if (_iapService != null) { @@ -89,7 +89,7 @@ class IAPManager { } return false; } - + /// Check if the user has access (purchased or still in trial) bool get hasAccess { if (_iapService != null) { @@ -99,12 +99,12 @@ class IAPManager { } return true; // Default to true for platforms without IAP } - + /// Check if the user can execute a command bool get canExecuteCommand { // If IAP is not initialized or not available, allow commands if (_iapService == null && _windowsIapService == null) return true; - + if (_iapService != null) { return _iapService!.canExecuteCommand; } else if (_windowsIapService != null) { @@ -112,7 +112,7 @@ class IAPManager { } return true; // Default to true for platforms without IAP } - + /// Get the number of commands remaining today (for free tier after trial) int get commandsRemainingToday { if (_iapService != null) { @@ -122,7 +122,7 @@ class IAPManager { } return -1; // Unlimited } - + /// Get the daily command count int get dailyCommandCount { if (_iapService != null) { @@ -132,7 +132,7 @@ class IAPManager { } return 0; } - + /// Increment the daily command count Future incrementCommandCount() async { if (_iapService != null) { @@ -141,7 +141,7 @@ class IAPManager { await _windowsIapService!.incrementCommandCount(); } } - + /// Get a status message for the user String getStatusMessage() { if (_iapService != null) { @@ -151,7 +151,7 @@ class IAPManager { } return 'Full access'; } - + /// Purchase the full version Future purchaseFullVersion() async { if (_iapService != null) { @@ -161,7 +161,7 @@ class IAPManager { } return false; } - + /// Restore previous purchases Future restorePurchases() async { if (_iapService != null) { @@ -169,7 +169,7 @@ class IAPManager { } // Windows doesn't have a separate restore mechanism in the stub } - + /// Dispose the manager void dispose() { _iapService?.dispose(); diff --git a/lib/utils/keymap/apps/biketerra.dart b/lib/utils/keymap/apps/biketerra.dart index bebe0f6..32e34e0 100644 --- a/lib/utils/keymap/apps/biketerra.dart +++ b/lib/utils/keymap/apps/biketerra.dart @@ -1,7 +1,7 @@ import 'package:dartx/dartx.dart'; import 'package:flutter/services.dart'; -import 'package:swift_control/utils/keymap/apps/supported_app.dart'; -import 'package:swift_control/utils/requirements/multi.dart'; +import 'package:bike_control/utils/keymap/apps/supported_app.dart'; +import 'package:bike_control/utils/requirements/multi.dart'; import '../buttons.dart'; import '../keymap.dart'; diff --git a/lib/utils/keymap/apps/custom_app.dart b/lib/utils/keymap/apps/custom_app.dart index a8ad5a7..51c584c 100644 --- a/lib/utils/keymap/apps/custom_app.dart +++ b/lib/utils/keymap/apps/custom_app.dart @@ -3,8 +3,8 @@ import 'dart:io'; import 'package:dartx/dartx.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; -import 'package:swift_control/utils/keymap/apps/supported_app.dart'; -import 'package:swift_control/utils/requirements/multi.dart'; +import 'package:bike_control/utils/keymap/apps/supported_app.dart'; +import 'package:bike_control/utils/requirements/multi.dart'; import '../buttons.dart'; import '../keymap.dart'; diff --git a/lib/utils/keymap/apps/my_whoosh.dart b/lib/utils/keymap/apps/my_whoosh.dart index 4d648e5..c01e99b 100644 --- a/lib/utils/keymap/apps/my_whoosh.dart +++ b/lib/utils/keymap/apps/my_whoosh.dart @@ -1,8 +1,8 @@ import 'package:dartx/dartx.dart'; import 'package:flutter/services.dart'; -import 'package:swift_control/main.dart'; -import 'package:swift_control/utils/keymap/apps/supported_app.dart'; -import 'package:swift_control/utils/requirements/multi.dart'; +import 'package:bike_control/main.dart'; +import 'package:bike_control/utils/keymap/apps/supported_app.dart'; +import 'package:bike_control/utils/requirements/multi.dart'; import '../buttons.dart'; import '../keymap.dart'; diff --git a/lib/utils/keymap/apps/openbikecontrol.dart b/lib/utils/keymap/apps/openbikecontrol.dart index 604045e..ae12e8f 100644 --- a/lib/utils/keymap/apps/openbikecontrol.dart +++ b/lib/utils/keymap/apps/openbikecontrol.dart @@ -1,5 +1,5 @@ -import 'package:swift_control/utils/keymap/apps/supported_app.dart'; -import 'package:swift_control/utils/requirements/multi.dart'; +import 'package:bike_control/utils/keymap/apps/supported_app.dart'; +import 'package:bike_control/utils/requirements/multi.dart'; import '../keymap.dart'; diff --git a/lib/utils/keymap/apps/rouvy.dart b/lib/utils/keymap/apps/rouvy.dart index a462a1a..23b23b1 100644 --- a/lib/utils/keymap/apps/rouvy.dart +++ b/lib/utils/keymap/apps/rouvy.dart @@ -3,10 +3,10 @@ import 'dart:io'; import 'package:dartx/dartx.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; -import 'package:swift_control/bluetooth/devices/zwift/constants.dart'; -import 'package:swift_control/utils/keymap/apps/supported_app.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/requirements/multi.dart'; +import 'package:bike_control/bluetooth/devices/zwift/constants.dart'; +import 'package:bike_control/utils/keymap/apps/supported_app.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/requirements/multi.dart'; import '../keymap.dart'; diff --git a/lib/utils/keymap/apps/supported_app.dart b/lib/utils/keymap/apps/supported_app.dart index b72ddf8..16a36be 100644 --- a/lib/utils/keymap/apps/supported_app.dart +++ b/lib/utils/keymap/apps/supported_app.dart @@ -1,9 +1,9 @@ -import 'package:swift_control/utils/keymap/apps/biketerra.dart'; -import 'package:swift_control/utils/keymap/apps/openbikecontrol.dart'; -import 'package:swift_control/utils/keymap/apps/rouvy.dart'; -import 'package:swift_control/utils/keymap/apps/training_peaks.dart'; -import 'package:swift_control/utils/keymap/apps/zwift.dart'; -import 'package:swift_control/utils/requirements/multi.dart'; +import 'package:bike_control/utils/keymap/apps/biketerra.dart'; +import 'package:bike_control/utils/keymap/apps/openbikecontrol.dart'; +import 'package:bike_control/utils/keymap/apps/rouvy.dart'; +import 'package:bike_control/utils/keymap/apps/training_peaks.dart'; +import 'package:bike_control/utils/keymap/apps/zwift.dart'; +import 'package:bike_control/utils/requirements/multi.dart'; import '../keymap.dart'; import 'custom_app.dart'; diff --git a/lib/utils/keymap/apps/training_peaks.dart b/lib/utils/keymap/apps/training_peaks.dart index a7f9fe9..de9b234 100644 --- a/lib/utils/keymap/apps/training_peaks.dart +++ b/lib/utils/keymap/apps/training_peaks.dart @@ -3,11 +3,11 @@ import 'dart:io'; import 'package:dartx/dartx.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; -import 'package:swift_control/bluetooth/devices/elite/elite_square.dart'; -import 'package:swift_control/bluetooth/devices/zwift/constants.dart'; -import 'package:swift_control/utils/keymap/apps/supported_app.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/requirements/multi.dart'; +import 'package:bike_control/bluetooth/devices/elite/elite_square.dart'; +import 'package:bike_control/bluetooth/devices/zwift/constants.dart'; +import 'package:bike_control/utils/keymap/apps/supported_app.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/requirements/multi.dart'; import '../keymap.dart'; diff --git a/lib/utils/keymap/apps/zwift.dart b/lib/utils/keymap/apps/zwift.dart index dea182f..4d3b798 100644 --- a/lib/utils/keymap/apps/zwift.dart +++ b/lib/utils/keymap/apps/zwift.dart @@ -1,8 +1,8 @@ import 'package:flutter/services.dart'; -import 'package:swift_control/bluetooth/devices/zwift/constants.dart'; -import 'package:swift_control/utils/keymap/apps/supported_app.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/requirements/multi.dart'; +import 'package:bike_control/bluetooth/devices/zwift/constants.dart'; +import 'package:bike_control/utils/keymap/apps/supported_app.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/requirements/multi.dart'; import '../keymap.dart'; diff --git a/lib/utils/keymap/buttons.dart b/lib/utils/keymap/buttons.dart index 07f87ac..98844ca 100644 --- a/lib/utils/keymap/buttons.dart +++ b/lib/utils/keymap/buttons.dart @@ -1,11 +1,11 @@ import 'package:dartx/dartx.dart'; import 'package:flutter/material.dart'; -import 'package:swift_control/bluetooth/devices/cycplus/cycplus_bc2.dart'; -import 'package:swift_control/bluetooth/devices/elite/elite_square.dart'; -import 'package:swift_control/bluetooth/devices/elite/elite_sterzo.dart'; -import 'package:swift_control/bluetooth/devices/openbikecontrol/protocol_parser.dart'; -import 'package:swift_control/bluetooth/devices/wahoo/wahoo_kickr_bike_shift.dart'; -import 'package:swift_control/bluetooth/devices/zwift/constants.dart'; +import 'package:bike_control/bluetooth/devices/cycplus/cycplus_bc2.dart'; +import 'package:bike_control/bluetooth/devices/elite/elite_square.dart'; +import 'package:bike_control/bluetooth/devices/elite/elite_sterzo.dart'; +import 'package:bike_control/bluetooth/devices/openbikecontrol/protocol_parser.dart'; +import 'package:bike_control/bluetooth/devices/wahoo/wahoo_kickr_bike_shift.dart'; +import 'package:bike_control/bluetooth/devices/zwift/constants.dart'; enum InGameAction { shiftUp('Shift Up'), diff --git a/lib/utils/keymap/keymap.dart b/lib/utils/keymap/keymap.dart index 3ede902..b9a38bd 100644 --- a/lib/utils/keymap/keymap.dart +++ b/lib/utils/keymap/keymap.dart @@ -4,8 +4,8 @@ import 'dart:convert'; import 'package:dartx/dartx.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; import '../actions/base_actions.dart'; import 'apps/custom_app.dart'; diff --git a/lib/utils/keymap/manager.dart b/lib/utils/keymap/manager.dart index 9e7ae1f..8c105db 100644 --- a/lib/utils/keymap/manager.dart +++ b/lib/utils/keymap/manager.dart @@ -1,9 +1,9 @@ import 'package:dartx/dartx.dart'; import 'package:flutter/services.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/widgets/ui/toast.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/widgets/ui/toast.dart'; import 'apps/custom_app.dart'; diff --git a/lib/utils/requirements/android.dart b/lib/utils/requirements/android.dart index 0d9c561..f3a8b72 100644 --- a/lib/utils/requirements/android.dart +++ b/lib/utils/requirements/android.dart @@ -4,11 +4,11 @@ import 'dart:ui'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/utils/actions/android.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/requirements/platform.dart'; -import 'package:swift_control/widgets/accessibility_disclosure_dialog.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/utils/actions/android.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/requirements/platform.dart'; +import 'package:bike_control/widgets/accessibility_disclosure_dialog.dart'; import 'package:universal_ble/universal_ble.dart'; class AccessibilityRequirement extends PlatformRequirement { diff --git a/lib/utils/requirements/multi.dart b/lib/utils/requirements/multi.dart index c0c9975..e86439a 100644 --- a/lib/utils/requirements/multi.dart +++ b/lib/utils/requirements/multi.dart @@ -5,15 +5,15 @@ import 'package:flutter/foundation.dart'; import 'package:keypress_simulator/keypress_simulator.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/main.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/utils/keymap/apps/my_whoosh.dart'; -import 'package:swift_control/utils/keymap/apps/supported_app.dart'; -import 'package:swift_control/utils/keymap/apps/zwift.dart'; -import 'package:swift_control/utils/requirements/platform.dart'; -import 'package:swift_control/widgets/ui/toast.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/main.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/utils/keymap/apps/my_whoosh.dart'; +import 'package:bike_control/utils/keymap/apps/supported_app.dart'; +import 'package:bike_control/utils/keymap/apps/zwift.dart'; +import 'package:bike_control/utils/requirements/platform.dart'; +import 'package:bike_control/widgets/ui/toast.dart'; import 'package:universal_ble/universal_ble.dart'; class KeyboardRequirement extends PlatformRequirement { diff --git a/lib/utils/settings/settings.dart b/lib/utils/settings/settings.dart index 267b2d6..c7dff57 100644 --- a/lib/utils/settings/settings.dart +++ b/lib/utils/settings/settings.dart @@ -1,15 +1,15 @@ import 'dart:convert'; import 'dart:io'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/iap/iap_manager.dart'; +import 'package:bike_control/utils/keymap/apps/supported_app.dart'; +import 'package:bike_control/utils/requirements/multi.dart'; import 'package:dartx/dartx.dart'; import 'package:path/path.dart' as path; import 'package:path_provider_windows/path_provider_windows.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences_windows/shared_preferences_windows.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/iap/iap_manager.dart'; -import 'package:swift_control/utils/keymap/apps/supported_app.dart'; -import 'package:swift_control/utils/requirements/multi.dart'; import 'package:window_manager/window_manager.dart'; import '../../main.dart'; @@ -32,15 +32,15 @@ class Settings { final app = getKeyMap(); core.actionHandler.init(app); - + // Initialize IAP manager await IAPManager.instance.initialize(prefs); - + // Start trial if this is the first launch if (!IAPManager.instance.hasTrialStarted && !IAPManager.instance.isPurchased) { await IAPManager.instance.startTrial(); } - + return null; } catch (e, s) { if (!retried) { diff --git a/lib/widgets/accessibility_disclosure_dialog.dart b/lib/widgets/accessibility_disclosure_dialog.dart index 630b54c..08eb896 100644 --- a/lib/widgets/accessibility_disclosure_dialog.dart +++ b/lib/widgets/accessibility_disclosure_dialog.dart @@ -1,5 +1,5 @@ import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; class AccessibilityDisclosureDialog extends StatelessWidget { final VoidCallback onAccept; diff --git a/lib/widgets/apps/mywhoosh_link_tile.dart b/lib/widgets/apps/mywhoosh_link_tile.dart index ddd2e55..fea40db 100644 --- a/lib/widgets/apps/mywhoosh_link_tile.dart +++ b/lib/widgets/apps/mywhoosh_link_tile.dart @@ -1,10 +1,10 @@ import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/widgets/ui/connection_method.dart'; -import 'package:swift_control/widgets/ui/toast.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/widgets/ui/connection_method.dart'; +import 'package:bike_control/widgets/ui/toast.dart'; class MyWhooshLinkTile extends StatefulWidget { const MyWhooshLinkTile({super.key}); diff --git a/lib/widgets/apps/openbikecontrol_ble_tile.dart b/lib/widgets/apps/openbikecontrol_ble_tile.dart index f83991d..43a8e6e 100644 --- a/lib/widgets/apps/openbikecontrol_ble_tile.dart +++ b/lib/widgets/apps/openbikecontrol_ble_tile.dart @@ -1,9 +1,9 @@ import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/widgets/ui/connection_method.dart'; -import 'package:swift_control/widgets/ui/toast.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/widgets/ui/connection_method.dart'; +import 'package:bike_control/widgets/ui/toast.dart'; class OpenBikeControlBluetoothTile extends StatefulWidget { const OpenBikeControlBluetoothTile({super.key}); diff --git a/lib/widgets/apps/openbikecontrol_mdns_tile.dart b/lib/widgets/apps/openbikecontrol_mdns_tile.dart index 2ede371..50a5aea 100644 --- a/lib/widgets/apps/openbikecontrol_mdns_tile.dart +++ b/lib/widgets/apps/openbikecontrol_mdns_tile.dart @@ -1,9 +1,9 @@ import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/widgets/ui/connection_method.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/widgets/ui/connection_method.dart'; class OpenBikeControlMdnsTile extends StatefulWidget { const OpenBikeControlMdnsTile({super.key}); diff --git a/lib/widgets/apps/zwift_mdns_tile.dart b/lib/widgets/apps/zwift_mdns_tile.dart index da86427..7efc708 100644 --- a/lib/widgets/apps/zwift_mdns_tile.dart +++ b/lib/widgets/apps/zwift_mdns_tile.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/widgets/ui/connection_method.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/widgets/ui/connection_method.dart'; class ZwiftMdnsTile extends StatefulWidget { final VoidCallback onUpdate; diff --git a/lib/widgets/apps/zwift_tile.dart b/lib/widgets/apps/zwift_tile.dart index db0eba1..aaffd85 100644 --- a/lib/widgets/apps/zwift_tile.dart +++ b/lib/widgets/apps/zwift_tile.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pbenum.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/widgets/ui/connection_method.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pbenum.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/widgets/ui/connection_method.dart'; class ZwiftTile extends StatefulWidget { final VoidCallback onUpdate; diff --git a/lib/widgets/changelog_dialog.dart b/lib/widgets/changelog_dialog.dart index d48b27f..c896440 100644 --- a/lib/widgets/changelog_dialog.dart +++ b/lib/widgets/changelog_dialog.dart @@ -1,8 +1,8 @@ import 'package:flutter/services.dart'; import 'package:flutter_md/flutter_md.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/main.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; +import 'package:bike_control/main.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; class ChangelogDialog extends StatelessWidget { final Markdown entry; diff --git a/lib/widgets/custom_keymap_selector.dart b/lib/widgets/custom_keymap_selector.dart index d3ed1ff..8bb3022 100644 --- a/lib/widgets/custom_keymap_selector.dart +++ b/lib/widgets/custom_keymap_selector.dart @@ -3,11 +3,11 @@ import 'dart:async'; import 'package:dartx/dartx.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/utils/keymap/keymap.dart'; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/keymap/keymap.dart'; import '../utils/keymap/apps/custom_app.dart'; diff --git a/lib/widgets/iap_status_widget.dart b/lib/widgets/iap_status_widget.dart index 6c8e634..cd73162 100644 --- a/lib/widgets/iap_status_widget.dart +++ b/lib/widgets/iap_status_widget.dart @@ -1,6 +1,5 @@ -import 'package:flutter/material.dart'; +import 'package:bike_control/utils/iap/iap_manager.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/utils/iap/iap_manager.dart'; /// Widget to display IAP status and allow purchases class IAPStatusWidget extends StatefulWidget { @@ -43,8 +42,8 @@ class _IAPStatusWidgetState extends State { Text( 'Full Version Unlocked', style: Theme.of(context).textTheme.titleMedium?.copyWith( - color: Colors.green, - ), + color: Colors.green, + ), ), ], ), @@ -61,8 +60,8 @@ class _IAPStatusWidgetState extends State { Text( 'Trial Period Active', style: Theme.of(context).textTheme.titleMedium?.copyWith( - color: Colors.blue, - ), + color: Colors.blue, + ), ), ], ), @@ -84,8 +83,8 @@ class _IAPStatusWidgetState extends State { Text( 'Free Version', style: Theme.of(context).textTheme.titleMedium?.copyWith( - color: Colors.orange, - ), + color: Colors.orange, + ), ), ], ), @@ -160,7 +159,7 @@ class _IAPStatusWidgetState extends State { try { final success = await IAPManager.instance.purchaseFullVersion(); - + if (mounted) { if (success) { showToast( @@ -199,7 +198,7 @@ class _IAPStatusWidgetState extends State { } } } - + Future _handleRestorePurchases() async { setState(() { _isPurchasing = true; @@ -207,11 +206,11 @@ class _IAPStatusWidgetState extends State { try { await IAPManager.instance.restorePurchases(); - + if (mounted) { // Wait a moment for the purchase stream to process await Future.delayed(Duration(seconds: 1)); - + if (IAPManager.instance.isPurchased) { showToast( context: context, diff --git a/lib/widgets/ignored_devices_dialog.dart b/lib/widgets/ignored_devices_dialog.dart index d48b1b5..a6545c2 100644 --- a/lib/widgets/ignored_devices_dialog.dart +++ b/lib/widgets/ignored_devices_dialog.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; class IgnoredDevicesDialog extends StatefulWidget { const IgnoredDevicesDialog({super.key}); diff --git a/lib/widgets/keymap_explanation.dart b/lib/widgets/keymap_explanation.dart index f080d08..60c9317 100644 --- a/lib/widgets/keymap_explanation.dart +++ b/lib/widgets/keymap_explanation.dart @@ -2,16 +2,16 @@ import 'dart:async'; import 'package:dartx/dartx.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/pages/button_edit.dart'; -import 'package:swift_control/pages/device.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/utils/keymap/apps/custom_app.dart'; -import 'package:swift_control/utils/keymap/keymap.dart'; -import 'package:swift_control/utils/keymap/manager.dart'; -import 'package:swift_control/widgets/ui/button_widget.dart'; -import 'package:swift_control/widgets/ui/toast.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/pages/button_edit.dart'; +import 'package:bike_control/pages/device.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/utils/keymap/apps/custom_app.dart'; +import 'package:bike_control/utils/keymap/keymap.dart'; +import 'package:bike_control/utils/keymap/manager.dart'; +import 'package:bike_control/widgets/ui/button_widget.dart'; +import 'package:bike_control/widgets/ui/toast.dart'; import '../pages/touch_area.dart'; diff --git a/lib/widgets/logviewer.dart b/lib/widgets/logviewer.dart index 29b5489..ea43e4f 100644 --- a/lib/widgets/logviewer.dart +++ b/lib/widgets/logviewer.dart @@ -5,9 +5,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart' show SelectionArea; import 'package:flutter/services.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/widgets/ui/toast.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/widgets/ui/toast.dart'; import '../bluetooth/messages/notification.dart'; diff --git a/lib/widgets/menu.dart b/lib/widgets/menu.dart index cfb6638..fd7b666 100644 --- a/lib/widgets/menu.dart +++ b/lib/widgets/menu.dart @@ -6,12 +6,12 @@ import 'package:flutter/material.dart' show showLicensePage; import 'package:in_app_review/in_app_review.dart'; import 'package:intl/intl.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_clickv2.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/pages/markdown.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/widgets/title.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_clickv2.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/pages/markdown.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/widgets/title.dart'; import 'package:universal_ble/universal_ble.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher_string.dart'; @@ -116,10 +116,7 @@ List buildMenuButtons(BuildContext context, VoidCallback? openLogs) { child: Text('Facebook'), ), MenuButton( - leading: Padding( - padding: const EdgeInsets.symmetric(horizontal: 3.0), - child: Text('G'), - ), + leading: Icon(RadixIcons.githubLogo), onPressed: (c) { launchUrlString('https://github.com/jonasbark/swiftcontrol/issues'); }, @@ -162,10 +159,7 @@ List buildMenuButtons(BuildContext context, VoidCallback? openLogs) { child: const Text('Facebook'), ), OutlineButton( - leading: Padding( - padding: const EdgeInsets.symmetric(horizontal: 3.0), - child: Text('G'), - ), + leading: Icon(RadixIcons.githubLogo), onPressed: () { Navigator.pop(context); launchUrlString('https://github.com/jonasbark/swiftcontrol/issues'); diff --git a/lib/widgets/pair_widget.dart b/lib/widgets/pair_widget.dart index dcfa843..2a1c626 100644 --- a/lib/widgets/pair_widget.dart +++ b/lib/widgets/pair_widget.dart @@ -1,11 +1,11 @@ import 'dart:io'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pbenum.dart' show LogLevel; -import 'package:swift_control/bluetooth/messages/notification.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/widgets/ui/connection_method.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pbenum.dart' show LogLevel; +import 'package:bike_control/bluetooth/messages/notification.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/widgets/ui/connection_method.dart'; import '../utils/requirements/multi.dart'; diff --git a/lib/widgets/scan.dart b/lib/widgets/scan.dart index c228f36..9725add 100644 --- a/lib/widgets/scan.dart +++ b/lib/widgets/scan.dart @@ -2,12 +2,12 @@ import 'dart:io'; import 'package:flutter/foundation.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/pages/markdown.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/utils/requirements/platform.dart'; -import 'package:swift_control/widgets/ui/connection_method.dart'; -import 'package:swift_control/widgets/ui/wifi_animation.dart'; +import 'package:bike_control/pages/markdown.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/utils/requirements/platform.dart'; +import 'package:bike_control/widgets/ui/connection_method.dart'; +import 'package:bike_control/widgets/ui/wifi_animation.dart'; import 'package:url_launcher/url_launcher_string.dart'; class ScanWidget extends StatefulWidget { diff --git a/lib/widgets/testbed.dart b/lib/widgets/testbed.dart index 40f3b5e..2c06c2c 100644 --- a/lib/widgets/testbed.dart +++ b/lib/widgets/testbed.dart @@ -5,14 +5,14 @@ import 'dart:ui'; import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; -import 'package:swift_control/utils/actions/base_actions.dart' as actions; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/utils/keymap/apps/custom_app.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/widgets/ui/button_widget.dart'; -import 'package:swift_control/widgets/ui/toast.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/utils/actions/base_actions.dart' as actions; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/utils/keymap/apps/custom_app.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/widgets/ui/button_widget.dart'; +import 'package:bike_control/widgets/ui/toast.dart'; import '../bluetooth/messages/notification.dart'; diff --git a/lib/widgets/title.dart b/lib/widgets/title.dart index f5436e9..6cca70c 100755 --- a/lib/widgets/title.dart +++ b/lib/widgets/title.dart @@ -8,12 +8,12 @@ import 'package:package_info_plus/package_info_plus.dart'; import 'package:restart_app/restart_app.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; import 'package:shorebird_code_push/shorebird_code_push.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/main.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/widgets/ui/gradient_text.dart'; -import 'package:swift_control/widgets/ui/small_progress_indicator.dart'; -import 'package:swift_control/widgets/ui/toast.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/main.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/widgets/ui/gradient_text.dart'; +import 'package:bike_control/widgets/ui/small_progress_indicator.dart'; +import 'package:bike_control/widgets/ui/toast.dart'; import 'package:url_launcher/url_launcher_string.dart'; import 'package:version/version.dart'; diff --git a/lib/widgets/ui/button_widget.dart b/lib/widgets/ui/button_widget.dart index 3fdafab..d42663d 100644 --- a/lib/widgets/ui/button_widget.dart +++ b/lib/widgets/ui/button_widget.dart @@ -1,8 +1,8 @@ import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/main.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; -import 'package:swift_control/widgets/keymap_explanation.dart'; -import 'package:swift_control/widgets/ui/colors.dart'; +import 'package:bike_control/main.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; +import 'package:bike_control/widgets/keymap_explanation.dart'; +import 'package:bike_control/widgets/ui/colors.dart'; class ButtonWidget extends StatelessWidget { final ControllerButton button; diff --git a/lib/widgets/ui/colored_title.dart b/lib/widgets/ui/colored_title.dart index f179440..ca84d59 100644 --- a/lib/widgets/ui/colored_title.dart +++ b/lib/widgets/ui/colored_title.dart @@ -1,5 +1,5 @@ import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/widgets/ui/gradient_text.dart'; +import 'package:bike_control/widgets/ui/gradient_text.dart'; class ColoredTitle extends StatelessWidget { final String text; diff --git a/lib/widgets/ui/connection_method.dart b/lib/widgets/ui/connection_method.dart index 4355d42..93115e3 100644 --- a/lib/widgets/ui/connection_method.dart +++ b/lib/widgets/ui/connection_method.dart @@ -1,14 +1,14 @@ import 'package:dartx/dartx.dart'; import 'package:flutter/foundation.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/gen/l10n.dart'; -import 'package:swift_control/pages/button_edit.dart'; -import 'package:swift_control/pages/markdown.dart'; -import 'package:swift_control/utils/i18n_extension.dart'; -import 'package:swift_control/utils/requirements/platform.dart'; -import 'package:swift_control/widgets/ui/beta_pill.dart'; -import 'package:swift_control/widgets/ui/small_progress_indicator.dart'; -import 'package:swift_control/widgets/ui/toast.dart'; +import 'package:bike_control/gen/l10n.dart'; +import 'package:bike_control/pages/button_edit.dart'; +import 'package:bike_control/pages/markdown.dart'; +import 'package:bike_control/utils/i18n_extension.dart'; +import 'package:bike_control/utils/requirements/platform.dart'; +import 'package:bike_control/widgets/ui/beta_pill.dart'; +import 'package:bike_control/widgets/ui/small_progress_indicator.dart'; +import 'package:bike_control/widgets/ui/toast.dart'; enum ConnectionMethodType { bluetooth, diff --git a/lib/widgets/ui/gradient_text.dart b/lib/widgets/ui/gradient_text.dart index 6d950ca..69af83f 100644 --- a/lib/widgets/ui/gradient_text.dart +++ b/lib/widgets/ui/gradient_text.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:swift_control/widgets/ui/colors.dart'; +import 'package:bike_control/widgets/ui/colors.dart'; class GradientText extends StatelessWidget { const GradientText( diff --git a/lib/widgets/ui/toast.dart b/lib/widgets/ui/toast.dart index c9d4e75..faf5171 100644 --- a/lib/widgets/ui/toast.dart +++ b/lib/widgets/ui/toast.dart @@ -1,6 +1,6 @@ import 'package:shadcn_flutter/shadcn_flutter.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; -import 'package:swift_control/widgets/ui/button_widget.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/widgets/ui/button_widget.dart'; void buildToast( BuildContext context, { diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 9f35302..1153423 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -10,6 +10,7 @@ import device_info_plus import file_selector_macos import flutter_local_notifications import gamepads_darwin +import in_app_purchase_storekit import in_app_review import keypress_simulator_macos import media_key_detector_macos @@ -29,6 +30,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) GamepadsDarwinPlugin.register(with: registry.registrar(forPlugin: "GamepadsDarwinPlugin")) + InAppPurchasePlugin.register(with: registry.registrar(forPlugin: "InAppPurchasePlugin")) InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin")) KeypressSimulatorMacosPlugin.register(with: registry.registrar(forPlugin: "KeypressSimulatorMacosPlugin")) MediaKeyDetectorPlugin.register(with: registry.registrar(forPlugin: "MediaKeyDetectorPlugin")) diff --git a/pubspec.lock b/pubspec.lock index ebd44e7..8bb1205 100755 --- a/pubspec.lock +++ b/pubspec.lock @@ -656,6 +656,38 @@ packages: url: "https://pub.dev" source: hosted version: "0.2.2" + in_app_purchase: + dependency: "direct main" + description: + name: in_app_purchase + sha256: "5cddd7f463f3bddb1d37a72b95066e840d5822d66291331d7f8f05ce32c24b6c" + url: "https://pub.dev" + source: hosted + version: "3.2.3" + in_app_purchase_android: + dependency: transitive + description: + name: in_app_purchase_android + sha256: abb254ae159a5a9d4f867795ecb076864faeba59ce015ab81d4cca380f23df45 + url: "https://pub.dev" + source: hosted + version: "0.4.0+8" + in_app_purchase_platform_interface: + dependency: transitive + description: + name: in_app_purchase_platform_interface + sha256: "1d353d38251da5b9fea6635c0ebfc6bb17a2d28d0e86ea5e083bf64244f1fb4c" + url: "https://pub.dev" + source: hosted + version: "1.4.0" + in_app_purchase_storekit: + dependency: transitive + description: + name: in_app_purchase_storekit + sha256: f7cbbd7fb47ab5a4fb736fc3f20ae81a4f6def0af9297b3c525ca727761e2589 + url: "https://pub.dev" + source: hosted + version: "0.4.7" in_app_review: dependency: "direct main" description: @@ -863,10 +895,10 @@ packages: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.0" mime: dependency: transitive description: @@ -1365,10 +1397,10 @@ packages: dependency: transitive description: name: test_api - sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 url: "https://pub.dev" source: hosted - version: "0.7.6" + version: "0.7.7" time: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 35fb2cf..90715ea 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,4 +1,4 @@ -name: swift_control +name: bike_control description: "BikeControl - Control your virtual riding" publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 4.1.0+50 diff --git a/test/bluetooth_device_detection.dart b/test/bluetooth_device_detection.dart index ba7662d..6f980b1 100644 --- a/test/bluetooth_device_detection.dart +++ b/test/bluetooth_device_detection.dart @@ -1,17 +1,17 @@ import 'dart:typed_data'; import 'package:flutter_test/flutter_test.dart'; -import 'package:swift_control/bluetooth/devices/bluetooth_device.dart'; -import 'package:swift_control/bluetooth/devices/cycplus/cycplus_bc2.dart'; -import 'package:swift_control/bluetooth/devices/elite/elite_square.dart'; -import 'package:swift_control/bluetooth/devices/elite/elite_sterzo.dart'; -import 'package:swift_control/bluetooth/devices/shimano/shimano_di2.dart'; -import 'package:swift_control/bluetooth/devices/wahoo/wahoo_kickr_bike_shift.dart'; -import 'package:swift_control/bluetooth/devices/zwift/constants.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_click.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_clickv2.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_play.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_ride.dart'; +import 'package:bike_control/bluetooth/devices/bluetooth_device.dart'; +import 'package:bike_control/bluetooth/devices/cycplus/cycplus_bc2.dart'; +import 'package:bike_control/bluetooth/devices/elite/elite_square.dart'; +import 'package:bike_control/bluetooth/devices/elite/elite_sterzo.dart'; +import 'package:bike_control/bluetooth/devices/shimano/shimano_di2.dart'; +import 'package:bike_control/bluetooth/devices/wahoo/wahoo_kickr_bike_shift.dart'; +import 'package:bike_control/bluetooth/devices/zwift/constants.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_click.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_clickv2.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_play.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_ride.dart'; import 'package:universal_ble/universal_ble.dart'; void main() { diff --git a/test/button_simulator_hotkeys_test.dart b/test/button_simulator_hotkeys_test.dart index a58c2f3..fa134fa 100644 --- a/test/button_simulator_hotkeys_test.dart +++ b/test/button_simulator_hotkeys_test.dart @@ -1,7 +1,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/buttons.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/buttons.dart'; void main() { group('Button Simulator Hotkey Tests', () { diff --git a/test/custom_frame.dart b/test/custom_frame.dart index 7cfc48c..f9d7cb2 100644 --- a/test/custom_frame.dart +++ b/test/custom_frame.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:golden_screenshot/golden_screenshot.dart'; -import 'package:swift_control/widgets/ui/colors.dart'; +import 'package:bike_control/widgets/ui/colors.dart'; import 'screenshot_test.dart'; diff --git a/test/custom_profile_test.dart b/test/custom_profile_test.dart index 06f248e..6eb6a3e 100644 --- a/test/custom_profile_test.dart +++ b/test/custom_profile_test.dart @@ -1,8 +1,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/apps/custom_app.dart'; -import 'package:swift_control/utils/settings/settings.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/apps/custom_app.dart'; +import 'package:bike_control/utils/settings/settings.dart'; void main() { group('Custom Profile Tests', () { diff --git a/test/cycplus_bc2_test.dart b/test/cycplus_bc2_test.dart index 1263ec1..6184987 100644 --- a/test/cycplus_bc2_test.dart +++ b/test/cycplus_bc2_test.dart @@ -1,9 +1,9 @@ import 'dart:typed_data'; import 'package:flutter_test/flutter_test.dart'; -import 'package:swift_control/bluetooth/devices/cycplus/cycplus_bc2.dart'; -import 'package:swift_control/utils/actions/base_actions.dart'; -import 'package:swift_control/utils/core.dart'; +import 'package:bike_control/bluetooth/devices/cycplus/cycplus_bc2.dart'; +import 'package:bike_control/utils/actions/base_actions.dart'; +import 'package:bike_control/utils/core.dart'; import 'package:universal_ble/universal_ble.dart'; void main() { diff --git a/test/long_press_test.dart b/test/long_press_test.dart index 8a58024..384307c 100644 --- a/test/long_press_test.dart +++ b/test/long_press_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:swift_control/bluetooth/devices/zwift/constants.dart'; -import 'package:swift_control/utils/keymap/keymap.dart'; +import 'package:bike_control/bluetooth/devices/zwift/constants.dart'; +import 'package:bike_control/utils/keymap/keymap.dart'; void main() { group('Long Press KeyPair Tests', () { diff --git a/test/modifier_keys_test.dart b/test/modifier_keys_test.dart index b5eff88..0aee00c 100644 --- a/test/modifier_keys_test.dart +++ b/test/modifier_keys_test.dart @@ -1,7 +1,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:swift_control/bluetooth/devices/zwift/constants.dart'; -import 'package:swift_control/utils/keymap/keymap.dart'; +import 'package:bike_control/bluetooth/devices/zwift/constants.dart'; +import 'package:bike_control/utils/keymap/keymap.dart'; void main() { group('Modifier Keys KeyPair Tests', () { diff --git a/test/screenshot_test.dart b/test/screenshot_test.dart index f2d21e7..2a6f2e0 100644 --- a/test/screenshot_test.dart +++ b/test/screenshot_test.dart @@ -5,12 +5,12 @@ import 'package:integration_test/integration_test.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:shadcn_flutter/shadcn_flutter.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:swift_control/bluetooth/devices/zwift/zwift_ride.dart'; -import 'package:swift_control/main.dart'; -import 'package:swift_control/pages/navigation.dart'; -import 'package:swift_control/utils/core.dart' show core; -import 'package:swift_control/utils/keymap/apps/my_whoosh.dart'; -import 'package:swift_control/utils/requirements/multi.dart'; +import 'package:bike_control/bluetooth/devices/zwift/zwift_ride.dart'; +import 'package:bike_control/main.dart'; +import 'package:bike_control/pages/navigation.dart'; +import 'package:bike_control/utils/core.dart' show core; +import 'package:bike_control/utils/keymap/apps/my_whoosh.dart'; +import 'package:bike_control/utils/requirements/multi.dart'; import 'package:universal_ble/universal_ble.dart'; import 'custom_frame.dart'; diff --git a/test/shimano_di2_test.dart b/test/shimano_di2_test.dart index b3254bf..678ff76 100644 --- a/test/shimano_di2_test.dart +++ b/test/shimano_di2_test.dart @@ -2,10 +2,10 @@ import 'dart:typed_data'; import 'package:flutter_test/flutter_test.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:swift_control/bluetooth/devices/shimano/shimano_di2.dart'; -import 'package:swift_control/utils/actions/base_actions.dart'; -import 'package:swift_control/utils/core.dart'; -import 'package:swift_control/utils/keymap/apps/openbikecontrol.dart'; +import 'package:bike_control/bluetooth/devices/shimano/shimano_di2.dart'; +import 'package:bike_control/utils/actions/base_actions.dart'; +import 'package:bike_control/utils/core.dart'; +import 'package:bike_control/utils/keymap/apps/openbikecontrol.dart'; import 'package:universal_ble/universal_ble.dart'; Future main() async { diff --git a/test/zwift.dart b/test/zwift.dart index 22862b9..3ee9aae 100644 --- a/test/zwift.dart +++ b/test/zwift.dart @@ -1,8 +1,8 @@ import 'dart:typed_data'; import 'package:flutter_test/flutter_test.dart'; -import 'package:swift_control/bluetooth/devices/zwift/ftms_mdns_emulator.dart'; -import 'package:swift_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; +import 'package:bike_control/bluetooth/devices/zwift/ftms_mdns_emulator.dart'; +import 'package:bike_control/bluetooth/devices/zwift/protocol/zp.pb.dart'; void main() { group('Zwift Emulation', () { diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index 204f936..2d98a7e 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -1,10 +1,10 @@ # Project-level configuration. cmake_minimum_required(VERSION 3.14) -project(swift_control LANGUAGES CXX) +project(bike_control LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. -set(BINARY_NAME "swift_control") +set(BINARY_NAME "bike_control") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/windows/runner/Runner.rc b/windows/runner/Runner.rc index 38ec336..de8d97d 100644 --- a/windows/runner/Runner.rc +++ b/windows/runner/Runner.rc @@ -90,12 +90,12 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "CompanyName", "de.jonasbark" "\0" - VALUE "FileDescription", "swift_control" "\0" + VALUE "FileDescription", "bike_control" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" - VALUE "InternalName", "swift_control" "\0" + VALUE "InternalName", "bike_control" "\0" VALUE "LegalCopyright", "Copyright (C) 2025 de.jonasbark. All rights reserved." "\0" - VALUE "OriginalFilename", "swift_control.exe" "\0" - VALUE "ProductName", "swift_control" "\0" + VALUE "OriginalFilename", "bike_control.exe" "\0" + VALUE "ProductName", "BikeControl" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" END END diff --git a/windows/runner/main.cpp b/windows/runner/main.cpp index 4141ea9..6a5d4ed 100644 --- a/windows/runner/main.cpp +++ b/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.Create(L"swift_control", origin, size)) { + if (!window.Create(L"bike_control", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true);