From 5bd49323d20629eb7d5163cc74a3af4f8ee5ac59 Mon Sep 17 00:00:00 2001 From: Jeroen1602 <1492076+jeroen1602@users.noreply.github.com> Date: Thu, 2 Nov 2023 14:11:38 +0100 Subject: [PATCH] Fixed lint warnings --- .../lighthouse_provider_start.dart | 3 +-- .../widgets/lighthouse_metadata_page.dart | 3 +-- .../widgets/lighthouse_widget.dart | 3 +-- lib/pages/main_page.dart | 1 + lib/pages/shortcut/mac_shortcut_handle.dart | 1 + .../shortcut/states/get_device_state_stream.dart | 4 +--- lib/pages/shortcut/states/get_device_stream.dart | 4 +--- lib/pages/shortcut/states/permission_stream.dart | 4 +--- lib/pages/shortcut/states/settings_stream.dart | 4 +--- lib/pages/shortcut_handler_page.dart | 4 +--- lib/pages/simple_base_page.dart | 3 +-- lib/widgets/content_container_widget.dart | 2 +- lib/widgets/dao_data_create_alert_widget.dart | 3 +-- lib/widgets/markdown/src/icon_builder.dart | 2 +- lib/widgets/markdown/src/icon_syntax.dart | 2 +- lib/widgets/markdown/src/markdown_tap_link.dart | 2 +- lib/widgets/markdown/src/super_script_syntax.dart | 2 +- lib/widgets/waterfall_widget.dart | 4 +--- .../lib/src/back_end/ble_lighthouse_back_end.dart | 2 +- .../lib/src/back_end/pair_back_end.dart | 2 +- .../lib/src/ble/bluetooth_characteristic.dart | 2 +- .../lib/src/ble/bluetooth_device.dart | 2 +- .../lib/src/ble/bluetooth_service.dart | 2 +- .../lib/src/device/ble_device.dart | 2 +- .../lib/src/device/low_level_device.dart | 2 +- .../lib/src/device_provider/ble_device_provider.dart | 2 +- .../lib/src/helpers/byte_data_extensions.dart | 2 +- .../lib/src/provider/device_provider.dart | 2 +- .../lib/src/ble/bluez_bluetooth_characteristic.dart | 2 +- .../lib/src/ble/bluez_bluetooth_device.dart | 2 +- .../lib/src/ble/bluez_bluetooth_service.dart | 2 +- .../lib/src/ble/fake_bluetooth_device.dart | 2 +- .../lib/src/ble/fake_device_identifier.dart | 2 +- .../src/ble/flutter_reactive_ble_characteristic.dart | 11 +++++------ .../lib/src/ble/flutter_reactive_ble_device.dart | 5 +++-- .../lib/src/ble/flutter_reactive_ble_service.dart | 7 +++---- .../ble/flutter_web_bluetooth_characteristic.dart | 2 +- .../lib/src/ble/flutter_web_bluetooth_device.dart | 2 +- .../lib/src/ble/flutter_web_bluetooth_service.dart | 2 +- .../device_extensions/device_with_extensions.dart | 2 +- .../lib/device_extensions/on_extension.dart | 12 +++--------- .../lib/device_extensions/sleep_extension.dart | 12 +++--------- .../lib/device_extensions/state_extension.dart | 6 +++--- .../lib/src/adapter_state/adapter_state.dart | 2 +- .../lib/src/ble/default_characteristics.dart | 2 +- .../lib/src/ble/device_identifier.dart | 2 +- .../lighthouse_provider/lib/src/ble/guid.dart | 2 +- .../lib/src/devices/lighthouse_device.dart | 2 +- .../lib/src/devices/lighthouse_power_state.dart | 2 +- .../lib/src/devices/stateful_lighthouse_device.dart | 2 +- .../lib/src/helpers/mutex_with_stack.dart | 2 +- .../lib/src/provider/provider.dart | 2 +- .../lib/src/timeout/timeout_container.dart | 2 +- .../lighthouse_v2/device/lighthouse_v2_device.dart | 8 +++----- .../src/lighthouse_v2/lighthouse_v2_persistence.dart | 2 +- .../identify_device_extension.dart | 5 ++--- .../specific_extensions/standby_extension.dart | 11 +++-------- .../device/vive_base_station_device.dart | 9 +++------ .../specific_extensions/clear_id_extension.dart | 2 +- .../vive_base_station_persistence.dart | 2 +- 60 files changed, 81 insertions(+), 120 deletions(-) diff --git a/lib/lighthouse_provider/lighthouse_provider_start.dart b/lib/lighthouse_provider/lighthouse_provider_start.dart index 57cd6838..c31e3afb 100644 --- a/lib/lighthouse_provider/lighthouse_provider_start.dart +++ b/lib/lighthouse_provider/lighthouse_provider_start.dart @@ -1,5 +1,4 @@ import 'package:bluez_back_end/bluez_back_end.dart'; -import 'package:fake_back_end/fake_back_end.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_reactive_ble_back_end/flutter_reactive_ble_end.dart'; import 'package:flutter_web_bluetooth_back_end/flutter_web_bluetooth_back_end.dart'; @@ -44,7 +43,7 @@ class LighthouseProviderStart { // you'll also need to // import 'package:lighthouse_pm/lighthouse_back_ends/fake/fake_back_end.dart'; - LighthouseProvider.instance.addBackEnd(FakeBLEBackEnd.instance); + // LighthouseProvider.instance.addBackEnd(FakeBLEBackEnd.instance); return true; }()); diff --git a/lib/lighthouse_provider/widgets/lighthouse_metadata_page.dart b/lib/lighthouse_provider/widgets/lighthouse_metadata_page.dart index 8bcfdfe4..dc7afa4f 100644 --- a/lib/lighthouse_provider/widgets/lighthouse_metadata_page.dart +++ b/lib/lighthouse_provider/widgets/lighthouse_metadata_page.dart @@ -116,8 +116,7 @@ class LighthouseMetadataState extends State { } class _MetadataInkWell extends StatelessWidget { - const _MetadataInkWell( - {required this.name, this.value, this.onTap}); + const _MetadataInkWell({required this.name, this.value, this.onTap}); final String name; final String? value; diff --git a/lib/lighthouse_provider/widgets/lighthouse_widget.dart b/lib/lighthouse_provider/widgets/lighthouse_widget.dart index 4807fa99..a8ffc7ad 100644 --- a/lib/lighthouse_provider/widgets/lighthouse_widget.dart +++ b/lib/lighthouse_provider/widgets/lighthouse_widget.dart @@ -266,8 +266,7 @@ class LighthouseWidgetState extends State { /// Display the state of the device together with the state as a number in hex. class _LHItemPowerStateWidget extends StatelessWidget { const _LHItemPowerStateWidget( - {required this.powerStateByte, - required this.toPowerState}); + {required this.powerStateByte, required this.toPowerState}); final int? powerStateByte; final _ToPowerState toPowerState; diff --git a/lib/pages/main_page.dart b/lib/pages/main_page.dart index f8ceb05f..1c64ff50 100644 --- a/lib/pages/main_page.dart +++ b/lib/pages/main_page.dart @@ -770,6 +770,7 @@ class _ScanDevicesPage extends State @override void didChangeAppLifecycleState(final AppLifecycleState state) { switch (state) { + case AppLifecycleState.hidden: case AppLifecycleState.paused: setState(() { updates = 0; diff --git a/lib/pages/shortcut/mac_shortcut_handle.dart b/lib/pages/shortcut/mac_shortcut_handle.dart index ed227611..b5599ba4 100644 --- a/lib/pages/shortcut/mac_shortcut_handle.dart +++ b/lib/pages/shortcut/mac_shortcut_handle.dart @@ -39,6 +39,7 @@ class ShortcutHandleMacState extends State @override void didChangeAppLifecycleState(final AppLifecycleState state) { switch (state) { + case AppLifecycleState.hidden: case AppLifecycleState.paused: cleanUp(); break; diff --git a/lib/pages/shortcut/states/get_device_state_stream.dart b/lib/pages/shortcut/states/get_device_state_stream.dart index 438d4e0b..31376d5e 100644 --- a/lib/pages/shortcut/states/get_device_state_stream.dart +++ b/lib/pages/shortcut/states/get_device_state_stream.dart @@ -13,9 +13,7 @@ class GetDeviceStateStream extends WaterfallStreamWidget final int settingsIndex; GetDeviceStateStream(this.settingsIndex, - {super.key, - required super.upStream, - super.downStreamBuilders}); + {super.key, required super.upStream, super.downStreamBuilders}); Stream> getDeviceState( final StatefulLighthouseDevice device, final Duration timeout) { diff --git a/lib/pages/shortcut/states/get_device_stream.dart b/lib/pages/shortcut/states/get_device_stream.dart index db7ab251..006ed7d6 100644 --- a/lib/pages/shortcut/states/get_device_stream.dart +++ b/lib/pages/shortcut/states/get_device_stream.dart @@ -14,9 +14,7 @@ class GetDeviceStream extends WaterfallStreamWidget final int settingsIndex; GetDeviceStream(this.deviceId, this.settingsIndex, - {required super.upStream, - required super.downStreamBuilders, - super.key}); + {required super.upStream, required super.downStreamBuilders, super.key}); Stream> listenForDevice( final Duration timeout) { diff --git a/lib/pages/shortcut/states/permission_stream.dart b/lib/pages/shortcut/states/permission_stream.dart index cb45bf71..0e4aaa7a 100644 --- a/lib/pages/shortcut/states/permission_stream.dart +++ b/lib/pages/shortcut/states/permission_stream.dart @@ -8,9 +8,7 @@ import 'package:permission_handler/permission_handler.dart'; class PermissionsStream extends WaterfallStreamWidget with ScanningMixin, CloseCurrentRouteMixin { PermissionsStream( - {super.key, - required super.upStream, - super.downStreamBuilders}); + {super.key, required super.upStream, super.downStreamBuilders}); @override Widget build(final BuildContext context) { diff --git a/lib/pages/shortcut/states/settings_stream.dart b/lib/pages/shortcut/states/settings_stream.dart index 155d47ed..245ba31f 100644 --- a/lib/pages/shortcut/states/settings_stream.dart +++ b/lib/pages/shortcut/states/settings_stream.dart @@ -6,9 +6,7 @@ import 'package:lighthouse_pm/widgets/waterfall_widget.dart'; class SettingsStream extends WaterfallStreamWidget with WithBlocStateless { SettingsStream( - {super.key, - required super.upStream, - super.downStreamBuilders}); + {super.key, required super.upStream, super.downStreamBuilders}); @override Widget build(final BuildContext context) { diff --git a/lib/pages/shortcut_handler_page.dart b/lib/pages/shortcut_handler_page.dart index fef48412..b984f298 100644 --- a/lib/pages/shortcut_handler_page.dart +++ b/lib/pages/shortcut_handler_page.dart @@ -10,9 +10,7 @@ class ShortcutHandlerPage extends BasePage { final Object? handle; const ShortcutHandlerPage(this.handle, {super.key}) - : super( - shortcutHandleArgument: handle as ShortcutHandle?, - replace: true); + : super(shortcutHandleArgument: handle as ShortcutHandle?, replace: true); @override Widget buildPage(final BuildContext context) { diff --git a/lib/pages/simple_base_page.dart b/lib/pages/simple_base_page.dart index ffe68348..e51918be 100644 --- a/lib/pages/simple_base_page.dart +++ b/lib/pages/simple_base_page.dart @@ -10,8 +10,7 @@ import 'base_page.dart'; class SimpleBasePage extends BasePage { final Widget _body; - const SimpleBasePage(this._body, - {super.key, super.shortcutHandleArgument}); + const SimpleBasePage(this._body, {super.key, super.shortcutHandleArgument}); @override Widget buildPage(final BuildContext context) { diff --git a/lib/widgets/content_container_widget.dart b/lib/widgets/content_container_widget.dart index c6d1d45b..34c84a90 100644 --- a/lib/widgets/content_container_widget.dart +++ b/lib/widgets/content_container_widget.dart @@ -160,7 +160,7 @@ class ContentScrollbar extends StatelessWidget { final ScrollController? controller, required this.scrollbarChildBuilder, this.maxSize = ContentContainerWidget.defaultMaxSize, - }) : controller = controller ?? ScrollController(); + }) : controller = controller ?? ScrollController(); final ScrollbarChildBuilder scrollbarChildBuilder; diff --git a/lib/widgets/dao_data_create_alert_widget.dart b/lib/widgets/dao_data_create_alert_widget.dart index dde45634..aa812257 100644 --- a/lib/widgets/dao_data_create_alert_widget.dart +++ b/lib/widgets/dao_data_create_alert_widget.dart @@ -96,8 +96,7 @@ abstract class DaoDataCreateAlertDecorator { /// class DaoDataCreateAlertStringDecorator extends DaoDataCreateAlertDecorator { - DaoDataCreateAlertStringDecorator( - super.name, super.originalValue, + DaoDataCreateAlertStringDecorator(super.name, super.originalValue, {this.validator}); final FormFieldValidator? validator; diff --git a/lib/widgets/markdown/src/icon_builder.dart b/lib/widgets/markdown/src/icon_builder.dart index 85361f97..0c32935c 100644 --- a/lib/widgets/markdown/src/icon_builder.dart +++ b/lib/widgets/markdown/src/icon_builder.dart @@ -1,4 +1,4 @@ -part of lighthouse_markdown; +part of '../markdown.dart'; /// /// Convert an [md.Element] to the actual [Widget] for rendering. Use [IconSyntax] diff --git a/lib/widgets/markdown/src/icon_syntax.dart b/lib/widgets/markdown/src/icon_syntax.dart index 548c2c23..ff50bc47 100644 --- a/lib/widgets/markdown/src/icon_syntax.dart +++ b/lib/widgets/markdown/src/icon_syntax.dart @@ -1,4 +1,4 @@ -part of lighthouse_markdown; +part of '../markdown.dart'; /// /// Convert an {the icon} tag into an element that can be used in diff --git a/lib/widgets/markdown/src/markdown_tap_link.dart b/lib/widgets/markdown/src/markdown_tap_link.dart index 8d91d919..3790cfc4 100644 --- a/lib/widgets/markdown/src/markdown_tap_link.dart +++ b/lib/widgets/markdown/src/markdown_tap_link.dart @@ -1,4 +1,4 @@ -part of lighthouse_markdown; +part of '../markdown.dart'; markdownOpenLinkOnTap( final String text, final String? href, final String title) { diff --git a/lib/widgets/markdown/src/super_script_syntax.dart b/lib/widgets/markdown/src/super_script_syntax.dart index 8152a399..8ed1fa21 100644 --- a/lib/widgets/markdown/src/super_script_syntax.dart +++ b/lib/widgets/markdown/src/super_script_syntax.dart @@ -1,4 +1,4 @@ -part of lighthouse_markdown; +part of '../markdown.dart'; /// /// Convert the markdown content inside the `` tag into actual super diff --git a/lib/widgets/waterfall_widget.dart b/lib/widgets/waterfall_widget.dart index 574d96cb..5330519c 100644 --- a/lib/widgets/waterfall_widget.dart +++ b/lib/widgets/waterfall_widget.dart @@ -9,9 +9,7 @@ abstract class WaterfallStreamWidget extends StatelessWidget { final List downStreamBuilders; const WaterfallStreamWidget( - {super.key, - required this.upStream, - this.downStreamBuilders = const []}); + {super.key, required this.upStream, this.downStreamBuilders = const []}); WaterfallStreamWidget getNextStreamDown( final BuildContext context, final T? upstreamData) { diff --git a/lighthouse_provider/lighthouse_back_end/lib/src/back_end/ble_lighthouse_back_end.dart b/lighthouse_provider/lighthouse_back_end/lib/src/back_end/ble_lighthouse_back_end.dart index 42775dd1..f27f056e 100644 --- a/lighthouse_provider/lighthouse_back_end/lib/src/back_end/ble_lighthouse_back_end.dart +++ b/lighthouse_provider/lighthouse_back_end/lib/src/back_end/ble_lighthouse_back_end.dart @@ -1,4 +1,4 @@ -part of lighthouse_back_end; +part of '../../lighthouse_back_end.dart'; /// /// A back end that will use [BLEDeviceProvider]s to provide [BLEDevice]s diff --git a/lighthouse_provider/lighthouse_back_end/lib/src/back_end/pair_back_end.dart b/lighthouse_provider/lighthouse_back_end/lib/src/back_end/pair_back_end.dart index c94fc611..44fa1a95 100644 --- a/lighthouse_provider/lighthouse_back_end/lib/src/back_end/pair_back_end.dart +++ b/lighthouse_provider/lighthouse_back_end/lib/src/back_end/pair_back_end.dart @@ -1,4 +1,4 @@ -part of lighthouse_back_end; +part of '../../lighthouse_back_end.dart'; /// /// A back end that requires the user to pair a device before it's able to be diff --git a/lighthouse_provider/lighthouse_back_end/lib/src/ble/bluetooth_characteristic.dart b/lighthouse_provider/lighthouse_back_end/lib/src/ble/bluetooth_characteristic.dart index 5bdce492..44ff44c9 100644 --- a/lighthouse_provider/lighthouse_back_end/lib/src/ble/bluetooth_characteristic.dart +++ b/lighthouse_provider/lighthouse_back_end/lib/src/ble/bluetooth_characteristic.dart @@ -1,4 +1,4 @@ -part of lighthouse_back_end; +part of '../../lighthouse_back_end.dart'; /// An abstract class for bluetooth characteristic. /// diff --git a/lighthouse_provider/lighthouse_back_end/lib/src/ble/bluetooth_device.dart b/lighthouse_provider/lighthouse_back_end/lib/src/ble/bluetooth_device.dart index dab92258..64947fa6 100644 --- a/lighthouse_provider/lighthouse_back_end/lib/src/ble/bluetooth_device.dart +++ b/lighthouse_provider/lighthouse_back_end/lib/src/ble/bluetooth_device.dart @@ -1,4 +1,4 @@ -part of lighthouse_back_end; +part of '../../lighthouse_back_end.dart'; /// An abstract class for bluetooth devices. /// diff --git a/lighthouse_provider/lighthouse_back_end/lib/src/ble/bluetooth_service.dart b/lighthouse_provider/lighthouse_back_end/lib/src/ble/bluetooth_service.dart index 51aea46a..eb3a110e 100644 --- a/lighthouse_provider/lighthouse_back_end/lib/src/ble/bluetooth_service.dart +++ b/lighthouse_provider/lighthouse_back_end/lib/src/ble/bluetooth_service.dart @@ -1,4 +1,4 @@ -part of lighthouse_back_end; +part of '../../lighthouse_back_end.dart'; /// An abstract bluetooth service. /// diff --git a/lighthouse_provider/lighthouse_back_end/lib/src/device/ble_device.dart b/lighthouse_provider/lighthouse_back_end/lib/src/device/ble_device.dart index 1452a464..602302aa 100644 --- a/lighthouse_provider/lighthouse_back_end/lib/src/device/ble_device.dart +++ b/lighthouse_provider/lighthouse_back_end/lib/src/device/ble_device.dart @@ -1,4 +1,4 @@ -part of lighthouse_back_end; +part of '../../lighthouse_back_end.dart'; /// /// A device for all other devices. diff --git a/lighthouse_provider/lighthouse_back_end/lib/src/device/low_level_device.dart b/lighthouse_provider/lighthouse_back_end/lib/src/device/low_level_device.dart index a465b970..ea57be19 100644 --- a/lighthouse_provider/lighthouse_back_end/lib/src/device/low_level_device.dart +++ b/lighthouse_provider/lighthouse_back_end/lib/src/device/low_level_device.dart @@ -1,4 +1,4 @@ -part of lighthouse_back_end; +part of '../../lighthouse_back_end.dart'; /// What a back end device should at least have for the providers to work with it. abstract class LowLevelDevice { diff --git a/lighthouse_provider/lighthouse_back_end/lib/src/device_provider/ble_device_provider.dart b/lighthouse_provider/lighthouse_back_end/lib/src/device_provider/ble_device_provider.dart index ce5827a0..efa38381 100644 --- a/lighthouse_provider/lighthouse_back_end/lib/src/device_provider/ble_device_provider.dart +++ b/lighthouse_provider/lighthouse_back_end/lib/src/device_provider/ble_device_provider.dart @@ -1,4 +1,4 @@ -part of lighthouse_back_end; +part of '../../lighthouse_back_end.dart'; /// /// An abstract device provider specifically made for Bluetooth low energy. diff --git a/lighthouse_provider/lighthouse_back_end/lib/src/helpers/byte_data_extensions.dart b/lighthouse_provider/lighthouse_back_end/lib/src/helpers/byte_data_extensions.dart index e75a56ed..bfbb5bbd 100644 --- a/lighthouse_provider/lighthouse_back_end/lib/src/helpers/byte_data_extensions.dart +++ b/lighthouse_provider/lighthouse_back_end/lib/src/helpers/byte_data_extensions.dart @@ -1,4 +1,4 @@ -part of lighthouse_back_end; +part of '../../lighthouse_back_end.dart'; /// /// Extension functions for [ByteData] diff --git a/lighthouse_provider/lighthouse_back_end/lib/src/provider/device_provider.dart b/lighthouse_provider/lighthouse_back_end/lib/src/provider/device_provider.dart index f3bfe37c..d22e26f2 100644 --- a/lighthouse_provider/lighthouse_back_end/lib/src/provider/device_provider.dart +++ b/lighthouse_provider/lighthouse_back_end/lib/src/provider/device_provider.dart @@ -1,4 +1,4 @@ -part of lighthouse_back_end; +part of '../../lighthouse_back_end.dart'; /// /// An abstract super class of what all device provider should be able to do. diff --git a/lighthouse_provider/lighthouse_back_ends/bluez_back_end/lib/src/ble/bluez_bluetooth_characteristic.dart b/lighthouse_provider/lighthouse_back_ends/bluez_back_end/lib/src/ble/bluez_bluetooth_characteristic.dart index 3f121b79..4c24cc84 100644 --- a/lighthouse_provider/lighthouse_back_ends/bluez_back_end/lib/src/ble/bluez_bluetooth_characteristic.dart +++ b/lighthouse_provider/lighthouse_back_ends/bluez_back_end/lib/src/ble/bluez_bluetooth_characteristic.dart @@ -1,4 +1,4 @@ -part of bluez_back_end; +part of '../bluez_back_end_io.dart'; class BlueZBluetoothCharacteristic extends LHBluetoothCharacteristic { BlueZBluetoothCharacteristic(this.characteristic); diff --git a/lighthouse_provider/lighthouse_back_ends/bluez_back_end/lib/src/ble/bluez_bluetooth_device.dart b/lighthouse_provider/lighthouse_back_ends/bluez_back_end/lib/src/ble/bluez_bluetooth_device.dart index 32732d02..56fe2d2a 100644 --- a/lighthouse_provider/lighthouse_back_ends/bluez_back_end/lib/src/ble/bluez_bluetooth_device.dart +++ b/lighthouse_provider/lighthouse_back_ends/bluez_back_end/lib/src/ble/bluez_bluetooth_device.dart @@ -1,4 +1,4 @@ -part of bluez_back_end; +part of '../bluez_back_end_io.dart'; class BlueZBluetoothDevice extends LHBluetoothDevice { BlueZBluetoothDevice(this.device) { diff --git a/lighthouse_provider/lighthouse_back_ends/bluez_back_end/lib/src/ble/bluez_bluetooth_service.dart b/lighthouse_provider/lighthouse_back_ends/bluez_back_end/lib/src/ble/bluez_bluetooth_service.dart index b7b164e0..d9d04574 100644 --- a/lighthouse_provider/lighthouse_back_ends/bluez_back_end/lib/src/ble/bluez_bluetooth_service.dart +++ b/lighthouse_provider/lighthouse_back_ends/bluez_back_end/lib/src/ble/bluez_bluetooth_service.dart @@ -1,4 +1,4 @@ -part of bluez_back_end; +part of '../bluez_back_end_io.dart'; class BlueZBluetoothService extends LHBluetoothService { BlueZBluetoothService(this.service); diff --git a/lighthouse_provider/lighthouse_back_ends/fake_back_end/lib/src/ble/fake_bluetooth_device.dart b/lighthouse_provider/lighthouse_back_ends/fake_back_end/lib/src/ble/fake_bluetooth_device.dart index 249e456e..a05f6040 100644 --- a/lighthouse_provider/lighthouse_back_ends/fake_back_end/lib/src/ble/fake_bluetooth_device.dart +++ b/lighthouse_provider/lighthouse_back_ends/fake_back_end/lib/src/ble/fake_bluetooth_device.dart @@ -1,4 +1,4 @@ -part of fake_back_end; +part of '../../fake_back_end.dart'; class FakeBluetoothDevice extends LHBluetoothDevice { final LHDeviceIdentifier deviceIdentifier; diff --git a/lighthouse_provider/lighthouse_back_ends/fake_back_end/lib/src/ble/fake_device_identifier.dart b/lighthouse_provider/lighthouse_back_ends/fake_back_end/lib/src/ble/fake_device_identifier.dart index 1fbe1620..f3b0ba2b 100644 --- a/lighthouse_provider/lighthouse_back_ends/fake_back_end/lib/src/ble/fake_device_identifier.dart +++ b/lighthouse_provider/lighthouse_back_ends/fake_back_end/lib/src/ble/fake_device_identifier.dart @@ -1,4 +1,4 @@ -part of fake_back_end; +part of '../../fake_back_end.dart'; abstract class FakeDeviceIdentifier { static LHDeviceIdentifier generateDeviceIdentifier(final int seed) { diff --git a/lighthouse_provider/lighthouse_back_ends/flutter_reactive_ble_back_end/lib/src/ble/flutter_reactive_ble_characteristic.dart b/lighthouse_provider/lighthouse_back_ends/flutter_reactive_ble_back_end/lib/src/ble/flutter_reactive_ble_characteristic.dart index 4cc79c2d..564349ba 100644 --- a/lighthouse_provider/lighthouse_back_ends/flutter_reactive_ble_back_end/lib/src/ble/flutter_reactive_ble_characteristic.dart +++ b/lighthouse_provider/lighthouse_back_ends/flutter_reactive_ble_back_end/lib/src/ble/flutter_reactive_ble_characteristic.dart @@ -1,15 +1,14 @@ -part of flutter_reactive_ble_back_end; +part of '../flutter_reactive_ble_io.dart'; class FlutterReactiveBleCharacteristic extends LHBluetoothCharacteristic { FlutterReactiveBleCharacteristic( final String deviceId, - final DiscoveredCharacteristic characteristic, + final Characteristic characteristic, ) : _qualifiedCharacteristic = QualifiedCharacteristic( - characteristicId: characteristic.characteristicId, - serviceId: characteristic.serviceId, + characteristicId: characteristic.id, + serviceId: characteristic.service.id, deviceId: deviceId), - uuid = LighthouseGuid.fromString( - characteristic.characteristicId.toString()); + uuid = LighthouseGuid.fromString(characteristic.id.toString()); final QualifiedCharacteristic _qualifiedCharacteristic; final _flutterReactiveBle = FlutterReactiveBle(); diff --git a/lighthouse_provider/lighthouse_back_ends/flutter_reactive_ble_back_end/lib/src/ble/flutter_reactive_ble_device.dart b/lighthouse_provider/lighthouse_back_ends/flutter_reactive_ble_back_end/lib/src/ble/flutter_reactive_ble_device.dart index d2680a8c..c89c4350 100644 --- a/lighthouse_provider/lighthouse_back_ends/flutter_reactive_ble_back_end/lib/src/ble/flutter_reactive_ble_device.dart +++ b/lighthouse_provider/lighthouse_back_ends/flutter_reactive_ble_back_end/lib/src/ble/flutter_reactive_ble_device.dart @@ -1,4 +1,4 @@ -part of flutter_reactive_ble_back_end; +part of '../flutter_reactive_ble_io.dart'; /// An abstraction for the [FlutterReactiveBle] bluetooth device. class FlutterReactiveBleBluetoothDevice extends LHBluetoothDevice { @@ -62,7 +62,8 @@ class FlutterReactiveBleBluetoothDevice extends LHBluetoothDevice { @override Future> discoverServices() async { - final services = await _flutterReactiveBle.discoverServices(device.id); + await _flutterReactiveBle.discoverAllServices(device.id); + final services = await _flutterReactiveBle.getDiscoveredServices(device.id); return services.map((final service) { return FlutterReactiveBleService(device.id, service); diff --git a/lighthouse_provider/lighthouse_back_ends/flutter_reactive_ble_back_end/lib/src/ble/flutter_reactive_ble_service.dart b/lighthouse_provider/lighthouse_back_ends/flutter_reactive_ble_back_end/lib/src/ble/flutter_reactive_ble_service.dart index dcfdb95c..10cb18a6 100644 --- a/lighthouse_provider/lighthouse_back_ends/flutter_reactive_ble_back_end/lib/src/ble/flutter_reactive_ble_service.dart +++ b/lighthouse_provider/lighthouse_back_ends/flutter_reactive_ble_back_end/lib/src/ble/flutter_reactive_ble_service.dart @@ -1,10 +1,9 @@ -part of flutter_reactive_ble_back_end; +part of '../flutter_reactive_ble_io.dart'; class FlutterReactiveBleService extends LHBluetoothService { FlutterReactiveBleService( - final String deviceId, final DiscoveredService discoveredService) - : uuid = - LighthouseGuid.fromString(discoveredService.serviceId.toString()), + final String deviceId, final Service discoveredService) + : uuid = LighthouseGuid.fromString(discoveredService.id.toString()), characteristics = discoveredService.characteristics.map((final characteristic) { return FlutterReactiveBleCharacteristic(deviceId, characteristic); diff --git a/lighthouse_provider/lighthouse_back_ends/flutter_web_bluetooth_back_end/lib/src/ble/flutter_web_bluetooth_characteristic.dart b/lighthouse_provider/lighthouse_back_ends/flutter_web_bluetooth_back_end/lib/src/ble/flutter_web_bluetooth_characteristic.dart index 5e340fc9..7f32330d 100644 --- a/lighthouse_provider/lighthouse_back_ends/flutter_web_bluetooth_back_end/lib/src/ble/flutter_web_bluetooth_characteristic.dart +++ b/lighthouse_provider/lighthouse_back_ends/flutter_web_bluetooth_back_end/lib/src/ble/flutter_web_bluetooth_characteristic.dart @@ -1,4 +1,4 @@ -part of flutter_web_bluetooth_back_end; +part of '../../flutter_web_bluetooth_back_end.dart'; class FlutterWebBluetoothCharacteristic extends LHBluetoothCharacteristic { FlutterWebBluetoothCharacteristic(this.characteristic); diff --git a/lighthouse_provider/lighthouse_back_ends/flutter_web_bluetooth_back_end/lib/src/ble/flutter_web_bluetooth_device.dart b/lighthouse_provider/lighthouse_back_ends/flutter_web_bluetooth_back_end/lib/src/ble/flutter_web_bluetooth_device.dart index 9d48abe8..f0bdc16f 100644 --- a/lighthouse_provider/lighthouse_back_ends/flutter_web_bluetooth_back_end/lib/src/ble/flutter_web_bluetooth_device.dart +++ b/lighthouse_provider/lighthouse_back_ends/flutter_web_bluetooth_back_end/lib/src/ble/flutter_web_bluetooth_device.dart @@ -1,4 +1,4 @@ -part of flutter_web_bluetooth_back_end; +part of '../../flutter_web_bluetooth_back_end.dart'; class FlutterWebBluetoothDevice extends LHBluetoothDevice { FlutterWebBluetoothDevice(this.device, this.characteristicsGuid); diff --git a/lighthouse_provider/lighthouse_back_ends/flutter_web_bluetooth_back_end/lib/src/ble/flutter_web_bluetooth_service.dart b/lighthouse_provider/lighthouse_back_ends/flutter_web_bluetooth_back_end/lib/src/ble/flutter_web_bluetooth_service.dart index 9b62402f..f459b15c 100644 --- a/lighthouse_provider/lighthouse_back_ends/flutter_web_bluetooth_back_end/lib/src/ble/flutter_web_bluetooth_service.dart +++ b/lighthouse_provider/lighthouse_back_ends/flutter_web_bluetooth_back_end/lib/src/ble/flutter_web_bluetooth_service.dart @@ -1,4 +1,4 @@ -part of flutter_web_bluetooth_back_end; +part of '../../flutter_web_bluetooth_back_end.dart'; class FlutterWebBluetoothService extends LHBluetoothService { FlutterWebBluetoothService(this.service, diff --git a/lighthouse_provider/lighthouse_provider/lib/device_extensions/device_with_extensions.dart b/lighthouse_provider/lighthouse_provider/lib/device_extensions/device_with_extensions.dart index 8f6da4e1..f7cadd8c 100644 --- a/lighthouse_provider/lighthouse_provider/lib/device_extensions/device_with_extensions.dart +++ b/lighthouse_provider/lighthouse_provider/lib/device_extensions/device_with_extensions.dart @@ -1,4 +1,4 @@ -part of device_extension; +part of 'device_extension.dart'; /// An interface for devices that have extra function extensions. abstract class DeviceWithExtensions { diff --git a/lighthouse_provider/lighthouse_provider/lib/device_extensions/on_extension.dart b/lighthouse_provider/lighthouse_provider/lib/device_extensions/on_extension.dart index cee902e2..f44b56c7 100644 --- a/lighthouse_provider/lighthouse_provider/lib/device_extensions/on_extension.dart +++ b/lighthouse_provider/lighthouse_provider/lib/device_extensions/on_extension.dart @@ -1,15 +1,9 @@ -part of device_extension; +part of 'device_extension.dart'; /// /// An extension to allow a device to turn on /// class OnExtension extends StateExtension { - OnExtension( - {required final ChangeStateFunction changeState, - required final GetPowerStateStream powerStateStream}) - : super( - toolTip: "On", - changeState: changeState, - powerStateStream: powerStateStream, - toState: LighthousePowerState.on); + OnExtension({required super.changeState, required super.powerStateStream}) + : super(toolTip: "On", toState: LighthousePowerState.on); } diff --git a/lighthouse_provider/lighthouse_provider/lib/device_extensions/sleep_extension.dart b/lighthouse_provider/lighthouse_provider/lib/device_extensions/sleep_extension.dart index 50f13597..6b38d6fb 100644 --- a/lighthouse_provider/lighthouse_provider/lib/device_extensions/sleep_extension.dart +++ b/lighthouse_provider/lighthouse_provider/lib/device_extensions/sleep_extension.dart @@ -1,15 +1,9 @@ -part of device_extension; +part of 'device_extension.dart'; /// /// An extension to allow a device to go into sleep mode /// class SleepExtension extends StateExtension { - SleepExtension( - {required final ChangeStateFunction changeState, - required final GetPowerStateStream powerStateStream}) - : super( - toolTip: "Sleep", - changeState: changeState, - powerStateStream: powerStateStream, - toState: LighthousePowerState.sleep); + SleepExtension({required super.changeState, required super.powerStateStream}) + : super(toolTip: "Sleep", toState: LighthousePowerState.sleep); } diff --git a/lighthouse_provider/lighthouse_provider/lib/device_extensions/state_extension.dart b/lighthouse_provider/lighthouse_provider/lib/device_extensions/state_extension.dart index c8da8a52..9f3a9052 100644 --- a/lighthouse_provider/lighthouse_provider/lib/device_extensions/state_extension.dart +++ b/lighthouse_provider/lighthouse_provider/lib/device_extensions/state_extension.dart @@ -1,4 +1,4 @@ -part of device_extension; +part of 'device_extension.dart'; typedef ChangeStateFunction = Future Function( LighthousePowerState newState); @@ -10,11 +10,11 @@ typedef GetPowerStateStream = Stream Function(); /// abstract class StateExtension extends DeviceExtension { StateExtension( - {required final String toolTip, + {required super.toolTip, required final ChangeStateFunction changeState, required this.powerStateStream, required this.toState}) - : super(toolTip: toolTip, onTap: () => changeState(toState)) { + : super(onTap: () => changeState(toState)) { super.streamEnabledFunction = _enabledStream; assert( toState != LighthousePowerState.unknown && diff --git a/lighthouse_provider/lighthouse_provider/lib/src/adapter_state/adapter_state.dart b/lighthouse_provider/lighthouse_provider/lib/src/adapter_state/adapter_state.dart index af387b93..f2292c57 100644 --- a/lighthouse_provider/lighthouse_provider/lib/src/adapter_state/adapter_state.dart +++ b/lighthouse_provider/lighthouse_provider/lib/src/adapter_state/adapter_state.dart @@ -1,4 +1,4 @@ -part of lighthouse_provider; +part of '../../lighthouse_provider.dart'; enum BluetoothAdapterState { unknown("unknown"), diff --git a/lighthouse_provider/lighthouse_provider/lib/src/ble/default_characteristics.dart b/lighthouse_provider/lighthouse_provider/lib/src/ble/default_characteristics.dart index 86f9c16c..2632b689 100644 --- a/lighthouse_provider/lighthouse_provider/lib/src/ble/default_characteristics.dart +++ b/lighthouse_provider/lighthouse_provider/lib/src/ble/default_characteristics.dart @@ -1,4 +1,4 @@ -part of lighthouse_provider; +part of '../../lighthouse_provider.dart'; /// /// Some default Bluetooth Low Energy characteristics. That most devices support diff --git a/lighthouse_provider/lighthouse_provider/lib/src/ble/device_identifier.dart b/lighthouse_provider/lighthouse_provider/lib/src/ble/device_identifier.dart index d88b43fa..27ede1c6 100644 --- a/lighthouse_provider/lighthouse_provider/lib/src/ble/device_identifier.dart +++ b/lighthouse_provider/lighthouse_provider/lib/src/ble/device_identifier.dart @@ -1,4 +1,4 @@ -part of lighthouse_provider; +part of '../../lighthouse_provider.dart'; /// /// A class for storing a device identifier or MAC address. diff --git a/lighthouse_provider/lighthouse_provider/lib/src/ble/guid.dart b/lighthouse_provider/lighthouse_provider/lib/src/ble/guid.dart index f27671e1..a526f4df 100644 --- a/lighthouse_provider/lighthouse_provider/lib/src/ble/guid.dart +++ b/lighthouse_provider/lighthouse_provider/lib/src/ble/guid.dart @@ -1,4 +1,4 @@ -part of lighthouse_provider; +part of '../../lighthouse_provider.dart'; /// /// Guid for Bluetooth Low energy services and characteristics. diff --git a/lighthouse_provider/lighthouse_provider/lib/src/devices/lighthouse_device.dart b/lighthouse_provider/lighthouse_provider/lib/src/devices/lighthouse_device.dart index c2abbe28..7b550a61 100644 --- a/lighthouse_provider/lighthouse_provider/lib/src/devices/lighthouse_device.dart +++ b/lighthouse_provider/lighthouse_provider/lib/src/devices/lighthouse_device.dart @@ -1,4 +1,4 @@ -part of lighthouse_provider; +part of '../../lighthouse_provider.dart'; abstract class LighthouseDevice { /// diff --git a/lighthouse_provider/lighthouse_provider/lib/src/devices/lighthouse_power_state.dart b/lighthouse_provider/lighthouse_provider/lib/src/devices/lighthouse_power_state.dart index 20104d6e..d021a331 100644 --- a/lighthouse_provider/lighthouse_provider/lib/src/devices/lighthouse_power_state.dart +++ b/lighthouse_provider/lighthouse_provider/lib/src/devices/lighthouse_power_state.dart @@ -1,4 +1,4 @@ -part of lighthouse_provider; +part of '../../lighthouse_provider.dart'; /// An enum that describes the current power state of a lighthouse beacon. /// diff --git a/lighthouse_provider/lighthouse_provider/lib/src/devices/stateful_lighthouse_device.dart b/lighthouse_provider/lighthouse_provider/lib/src/devices/stateful_lighthouse_device.dart index fbb309ea..3c3807cd 100644 --- a/lighthouse_provider/lighthouse_provider/lib/src/devices/stateful_lighthouse_device.dart +++ b/lighthouse_provider/lighthouse_provider/lib/src/devices/stateful_lighthouse_device.dart @@ -1,4 +1,4 @@ -part of lighthouse_provider; +part of '../../lighthouse_provider.dart'; mixin StatefulLighthouseDevice on LighthouseDevice { /// diff --git a/lighthouse_provider/lighthouse_provider/lib/src/helpers/mutex_with_stack.dart b/lighthouse_provider/lighthouse_provider/lib/src/helpers/mutex_with_stack.dart index 0e61d73b..49811947 100644 --- a/lighthouse_provider/lighthouse_provider/lib/src/helpers/mutex_with_stack.dart +++ b/lighthouse_provider/lighthouse_provider/lib/src/helpers/mutex_with_stack.dart @@ -1,4 +1,4 @@ -part of lighthouse_provider; +part of '../../lighthouse_provider.dart'; class MutexWithStack extends Mutex { StackTrace? _lockTrace; diff --git a/lighthouse_provider/lighthouse_provider/lib/src/provider/provider.dart b/lighthouse_provider/lighthouse_provider/lib/src/provider/provider.dart index a76d332f..e2d07afb 100644 --- a/lighthouse_provider/lighthouse_provider/lib/src/provider/provider.dart +++ b/lighthouse_provider/lighthouse_provider/lib/src/provider/provider.dart @@ -1,4 +1,4 @@ -part of lighthouse_provider; +part of '../../lighthouse_provider.dart'; ///A provider for getting all [LighthouseDevice]s in the area. /// diff --git a/lighthouse_provider/lighthouse_provider/lib/src/timeout/timeout_container.dart b/lighthouse_provider/lighthouse_provider/lib/src/timeout/timeout_container.dart index 52da0970..c3a58cc4 100644 --- a/lighthouse_provider/lighthouse_provider/lib/src/timeout/timeout_container.dart +++ b/lighthouse_provider/lighthouse_provider/lib/src/timeout/timeout_container.dart @@ -1,4 +1,4 @@ -part of lighthouse_provider; +part of '../../lighthouse_provider.dart'; class TimeoutContainer { TimeoutContainer(this.data, {final DateTime? lastSeen}) diff --git a/lighthouse_provider/lighthouse_providers/lib/src/lighthouse_v2/device/lighthouse_v2_device.dart b/lighthouse_provider/lighthouse_providers/lib/src/lighthouse_v2/device/lighthouse_v2_device.dart index cf792865..16f6a2f0 100644 --- a/lighthouse_provider/lighthouse_providers/lib/src/lighthouse_v2/device/lighthouse_v2_device.dart +++ b/lighthouse_provider/lighthouse_providers/lib/src/lighthouse_v2/device/lighthouse_v2_device.dart @@ -1,4 +1,4 @@ -part of lighthouse_v2_device_provider; +part of '../../../lighthouse_v2_device_provider.dart'; ///The bluetooth service that handles the power state of the device. // final String _poserService = '00001523-1212-efde-1523-785feabcd124'; @@ -20,11 +20,9 @@ class LighthouseV2Device extends BLEDevice static const String controlServiceUUID = "00001523-1212-efde-1523-785feabcd124"; - LighthouseV2Device(final LHBluetoothDevice device, - final LighthouseV2Persistence? persistence, + LighthouseV2Device(super.device, super.persistence, [final CreateShortcutCallback? createShortcut]) - : _createShortcut = createShortcut, - super(device, persistence) { + : _createShortcut = createShortcut { // Add a part of the [DeviceExtension]s the rest are added after [afterIsValid]. deviceExtensions.add(IdentifyDeviceExtension(onTap: identify)); } diff --git a/lighthouse_provider/lighthouse_providers/lib/src/lighthouse_v2/lighthouse_v2_persistence.dart b/lighthouse_provider/lighthouse_providers/lib/src/lighthouse_v2/lighthouse_v2_persistence.dart index 6361b2b3..7051532e 100644 --- a/lighthouse_provider/lighthouse_providers/lib/src/lighthouse_v2/lighthouse_v2_persistence.dart +++ b/lighthouse_provider/lighthouse_providers/lib/src/lighthouse_v2/lighthouse_v2_persistence.dart @@ -1,4 +1,4 @@ -part of lighthouse_v2_device_provider; +part of '../../lighthouse_v2_device_provider.dart'; abstract class LighthouseV2Persistence { Future areShortcutsEnabled(); diff --git a/lighthouse_provider/lighthouse_providers/lib/src/lighthouse_v2/specific_extensions/identify_device_extension.dart b/lighthouse_provider/lighthouse_providers/lib/src/lighthouse_v2/specific_extensions/identify_device_extension.dart index 168923f6..f7424987 100644 --- a/lighthouse_provider/lighthouse_providers/lib/src/lighthouse_v2/specific_extensions/identify_device_extension.dart +++ b/lighthouse_provider/lighthouse_providers/lib/src/lighthouse_v2/specific_extensions/identify_device_extension.dart @@ -1,9 +1,8 @@ -part of lighthouse_v2_device_provider; +part of '../../../lighthouse_v2_device_provider.dart'; /// A device extension that allow the device to be identified. class IdentifyDeviceExtension extends DeviceExtension { - IdentifyDeviceExtension({required final FutureCallback onTap}) - : super(onTap: onTap, toolTip: 'Identify') { + IdentifyDeviceExtension({required super.onTap}) : super(toolTip: 'Identify') { super.streamEnabledFunction = _enabledStream; } diff --git a/lighthouse_provider/lighthouse_providers/lib/src/lighthouse_v2/specific_extensions/standby_extension.dart b/lighthouse_provider/lighthouse_providers/lib/src/lighthouse_v2/specific_extensions/standby_extension.dart index 5aefcdda..a4c0ae90 100644 --- a/lighthouse_provider/lighthouse_providers/lib/src/lighthouse_v2/specific_extensions/standby_extension.dart +++ b/lighthouse_provider/lighthouse_providers/lib/src/lighthouse_v2/specific_extensions/standby_extension.dart @@ -1,17 +1,12 @@ -part of lighthouse_v2_device_provider; +part of '../../../lighthouse_v2_device_provider.dart'; /// /// An extension to allow a device to go into standby mode /// class StandbyExtension extends StateExtension { StandbyExtension( - {required final ChangeStateFunction changeState, - required final GetPowerStateStream powerStateStream}) - : super( - toolTip: "Standby", - changeState: changeState, - powerStateStream: powerStateStream, - toState: LighthousePowerState.standby); + {required super.changeState, required super.powerStateStream}) + : super(toolTip: "Standby", toState: LighthousePowerState.standby); } extension StandbyExtensionExtensions on LighthouseDevice { diff --git a/lighthouse_provider/lighthouse_providers/lib/src/vive_base_station/device/vive_base_station_device.dart b/lighthouse_provider/lighthouse_providers/lib/src/vive_base_station/device/vive_base_station_device.dart index 02a9c688..8bac3b7a 100644 --- a/lighthouse_provider/lighthouse_providers/lib/src/vive_base_station/device/vive_base_station_device.dart +++ b/lighthouse_provider/lighthouse_providers/lib/src/vive_base_station/device/vive_base_station_device.dart @@ -1,13 +1,10 @@ -part of vive_base_station_device_provider; +part of '../../../vive_base_station_device_provider.dart'; class ViveBaseStationDevice extends BLEDevice implements DeviceWithExtensions { - ViveBaseStationDevice( - final LHBluetoothDevice device, - final ViveBaseStationPersistence? persistence, + ViveBaseStationDevice(super.device, super.persistence, final RequestPairId? requestCallback) - : _requestCallback = requestCallback, - super(device, persistence); + : _requestCallback = requestCallback; static const String powerServiceUUID = '0000cb00-0000-1000-8000-00805f9b34fb'; static const String powerCharacteristicUUID = diff --git a/lighthouse_provider/lighthouse_providers/lib/src/vive_base_station/specific_extensions/clear_id_extension.dart b/lighthouse_provider/lighthouse_providers/lib/src/vive_base_station/specific_extensions/clear_id_extension.dart index 1bf34b78..914cd26a 100644 --- a/lighthouse_provider/lighthouse_providers/lib/src/vive_base_station/specific_extensions/clear_id_extension.dart +++ b/lighthouse_provider/lighthouse_providers/lib/src/vive_base_station/specific_extensions/clear_id_extension.dart @@ -1,4 +1,4 @@ -part of vive_base_station_device_provider; +part of '../../../vive_base_station_device_provider.dart'; typedef ClearIdCallback = Function(); diff --git a/lighthouse_provider/lighthouse_providers/lib/src/vive_base_station/vive_base_station_persistence.dart b/lighthouse_provider/lighthouse_providers/lib/src/vive_base_station/vive_base_station_persistence.dart index 31389f8d..0154fb8c 100644 --- a/lighthouse_provider/lighthouse_providers/lib/src/vive_base_station/vive_base_station_persistence.dart +++ b/lighthouse_provider/lighthouse_providers/lib/src/vive_base_station/vive_base_station_persistence.dart @@ -1,4 +1,4 @@ -part of vive_base_station_device_provider; +part of '../../vive_base_station_device_provider.dart'; abstract class ViveBaseStationPersistence { Future getId(final LHDeviceIdentifier deviceId);