Skip to content

Commit

Permalink
Ran dart fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen1602 committed Dec 7, 2023
1 parent 9b09253 commit a07b3fb
Show file tree
Hide file tree
Showing 59 changed files with 105 additions and 166 deletions.
2 changes: 1 addition & 1 deletion lib/data/dao/group_dao.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ part 'group_dao.g.dart';
@DriftAccessor(tables: [Groups, GroupEntries])
class GroupDao extends DatabaseAccessor<LighthouseDatabase>
with _$GroupDaoMixin {
GroupDao(final LighthouseDatabase attachedDatabase) : super(attachedDatabase);
GroupDao(super.attachedDatabase);

Stream<List<GroupWithEntries>> watchGroups() {
final groupsStream = select(groups).watch();
Expand Down
3 changes: 1 addition & 2 deletions lib/data/dao/nickname_dao.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ part 'nickname_dao.g.dart';
@DriftAccessor(tables: [Nicknames, LastSeenDevices])
class NicknameDao extends DatabaseAccessor<LighthouseDatabase>
with _$NicknameDaoMixin {
NicknameDao(final LighthouseDatabase attachedDatabase)
: super(attachedDatabase);
NicknameDao(super.attachedDatabase);

Stream<List<Nickname>> get watchSavedNicknames => select(nicknames).watch();

Expand Down
3 changes: 1 addition & 2 deletions lib/data/dao/settings_dao.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ enum SettingsIds {
@DriftAccessor(tables: [SimpleSettings])
class SettingsDao extends DatabaseAccessor<LighthouseDatabase>
with _$SettingsDaoMixin {
SettingsDao(final LighthouseDatabase attachedDatabase)
: super(attachedDatabase);
SettingsDao(super.attachedDatabase);

static const scanDurationValues = [5, 10, 15, 20];
static const updateIntervalValues = [1, 2, 3, 4, 5, 10, 20, 30];
Expand Down
3 changes: 1 addition & 2 deletions lib/data/dao/vive_base_station_dao.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ part 'vive_base_station_dao.g.dart';
@DriftAccessor(tables: [ViveBaseStationIds])
class ViveBaseStationDao extends DatabaseAccessor<LighthouseDatabase>
with _$ViveBaseStationDaoMixin {
ViveBaseStationDao(final LighthouseDatabase attachedDatabase)
: super(attachedDatabase);
ViveBaseStationDao(super.attachedDatabase);

Future<int?> getId(final String deviceId) {
return (select(viveBaseStationIds)
Expand Down
2 changes: 1 addition & 1 deletion lib/data/database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ part 'database.g.dart';
GroupDao,
])
class LighthouseDatabase extends _$LighthouseDatabase {
LighthouseDatabase(final QueryExecutor e) : super(e);
LighthouseDatabase(super.e);

@override
int get schemaVersion => 4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import 'package:flutter/gestures.dart';
///
class CustomLongPressGestureRecognizer extends TapGestureRecognizer {
CustomLongPressGestureRecognizer(
{final Object? debugOwner, final Duration duration = kLongPressTimeout})
: _duration = duration,
super(debugOwner: debugOwner) {
{super.debugOwner, final Duration duration = kLongPressTimeout})
: _duration = duration {
super.onTapDown = _onTapDownHandler;
super.onTapUp = _onTapUpHandler;
super.onTap = _onTapHandler;
Expand Down
3 changes: 2 additions & 1 deletion lib/lighthouse_provider/lighthouse_provider_start.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
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';
Expand Down Expand Up @@ -43,7 +44,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;
}());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import 'change_group_name_alert_widget.dart';
/// Change the group for the items selected.
class ChangeGroupAlertWidget extends StatefulWidget {
const ChangeGroupAlertWidget(
{required this.groups, required this.selectedGroup, final Key? key})
: super(key: key);
{required this.groups, required this.selectedGroup, super.key});

static const int removeGroupId = -1;
static const int newGroupId = -2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import 'package:flutter/material.dart';
/// A dialog for changing the name of a group.
/// Can also be used for creating a new group.
class ChangeGroupNameAlertWidget extends StatefulWidget {
const ChangeGroupNameAlertWidget({this.initialGroupName, final Key? key})
: super(key: key);
const ChangeGroupNameAlertWidget({this.initialGroupName, super.key});

final String? initialGroupName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import 'package:lighthouse_pm/data/database.dart';
import 'package:lighthouse_pm/theming.dart';

class DeleteGroupAlertWidget extends StatelessWidget {
const DeleteGroupAlertWidget({required this.group, final Key? key})
: super(key: key);
const DeleteGroupAlertWidget({required this.group, super.key});

final Group group;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import 'package:flutter/material.dart';
/// A warning dialog for when the user wants to add 2 devices that have the
/// same channel
class DifferentGroupItemChannelAlertWidget extends StatefulWidget {
const DifferentGroupItemChannelAlertWidget({final Key? key})
: super(key: key);
const DifferentGroupItemChannelAlertWidget({super.key});

@override
State<StatefulWidget> createState() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
/// A warning dialog for when the user wants to add 2 different device types
/// to the same group.
class DifferentGroupItemTypesAlertWidget extends StatefulWidget {
const DifferentGroupItemTypesAlertWidget({final Key? key}) : super(key: key);
const DifferentGroupItemTypesAlertWidget({super.key});

@override
State<StatefulWidget> createState() {
Expand Down
3 changes: 1 addition & 2 deletions lib/lighthouse_provider/widgets/lighthouse_group_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,12 @@ class _LighthouseGroupWidgetState extends State<LighthouseGroupWidget> {
/// of the devices in the group.
class _LighthouseGroupWidgetHeader extends StatelessWidget {
const _LighthouseGroupWidgetHeader({
final Key? key,
required this.onSelected,
required this.selected,
required this.selecting,
required this.group,
required this.action,
}) : super(key: key);
});

final VoidCallback onSelected;
final bool selected;
Expand Down
8 changes: 3 additions & 5 deletions lib/lighthouse_provider/widgets/lighthouse_metadata_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import '../../bloc.dart';
import 'widget_for_extension.dart';

class LighthouseMetadataPage extends StatefulWidget {
LighthouseMetadataPage(this.device, {final Key? key}) : super(key: key);
LighthouseMetadataPage(this.device, {super.key});

final LighthouseDevice device;
final BehaviorSubject<int> _updateSubject = BehaviorSubject.seeded(0);
Expand Down Expand Up @@ -117,8 +117,7 @@ class LighthouseMetadataState extends State<LighthouseMetadataPage> {

class _MetadataInkWell extends StatelessWidget {
const _MetadataInkWell(
{final Key? key, required this.name, this.value, this.onTap})
: super(key: key);
{required this.name, this.value, this.onTap});

final String name;
final String? value;
Expand Down Expand Up @@ -154,8 +153,7 @@ class _MetadataInkWell extends StatelessWidget {
}

class _ExtraActionsWidget extends StatelessWidget {
const _ExtraActionsWidget(this.device, {final Key? key, this.updateList})
: super(key: key);
const _ExtraActionsWidget(this.device, {this.updateList});

final DeviceWithExtensions device;
final VoidCallback? updateList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import 'package:lighthouse_pm/theming.dart';
/// A toggle button for the power state of a [LighthouseDevice].
class LighthousePowerButtonWidget extends StatelessWidget {
const LighthousePowerButtonWidget({
final Key? key,
super.key,
required this.powerState,
required this.onPress,
this.onLongPress,
this.disabled = false,
}) : super(key: key);
});
final LighthousePowerState powerState;
final VoidCallback onPress;
final VoidCallback? onLongPress;
Expand Down
6 changes: 2 additions & 4 deletions lib/lighthouse_provider/widgets/lighthouse_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,8 @@ class LighthouseWidgetState extends State<LighthouseWidget> {
/// Display the state of the device together with the state as a number in hex.
class _LHItemPowerStateWidget extends StatelessWidget {
const _LHItemPowerStateWidget(
{final Key? key,
required this.powerStateByte,
required this.toPowerState})
: super(key: key);
{required this.powerStateByte,
required this.toPowerState});

final int? powerStateByte;
final _ToPowerState toPowerState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class OfflineGroupItemAlertWidgetReturn {
/// A dialog that displays a warning to the user if one of the devices in a
/// group is offline.
class OfflineGroupItemAlertWidget extends StatefulWidget {
const OfflineGroupItemAlertWidget({final Key? key}) : super(key: key);
const OfflineGroupItemAlertWidget({super.key});

@override
State<StatefulWidget> createState() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class OfflineLighthouseWidget extends StatelessWidget {
required this.selected,
required this.selecting,
this.nickname,
final Key? key})
: super(key: key);
super.key});

final String deviceId;
final VoidCallback onSelected;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import 'package:lighthouse_provider/lighthouse_provider.dart';
class UnknownGroupStateAlertWidget extends StatelessWidget {
const UnknownGroupStateAlertWidget(
this.supportsStandby, this.isStateUniversal,
{final Key? key})
: super(key: key);
{super.key});

final bool supportsStandby;
final bool isStateUniversal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import 'package:lighthouse_pm/theming.dart';

class ViveBaseStationExtraInfoAlertWidget extends StatefulWidget {
const ViveBaseStationExtraInfoAlertWidget(
{final Key? key, required this.pairIdHint})
: super(key: key);
{super.key, required this.pairIdHint});

final int? pairIdHint;

Expand Down Expand Up @@ -137,8 +136,7 @@ class _ViveBaseStationExtraInfoAlertState

class ViveBaseStationExtraInfoIdWarningAlertWidget extends StatelessWidget {
const ViveBaseStationExtraInfoIdWarningAlertWidget(
{required this.setId, required this.existingIdEnd, final Key? key})
: super(key: key);
{required this.setId, required this.existingIdEnd, super.key});

final String setId;
final int existingIdEnd;
Expand Down
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void main() {
}

class MainApp extends StatelessWidget {
const MainApp({final Key? key}) : super(key: key);
const MainApp({super.key});

@override
Widget build(final BuildContext context) {
Expand Down Expand Up @@ -64,7 +64,7 @@ class MainApp extends StatelessWidget {
}

class LighthousePMApp extends StatelessWidget with WithBlocStateless {
const LighthousePMApp({final Key? key}) : super(key: key);
const LighthousePMApp({super.key});

@override
Widget build(final BuildContext context) {
Expand Down
4 changes: 1 addition & 3 deletions lib/pages/base_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ class _ShortcutLaunchHandleWidget extends StatefulWidget {
final ShortcutHandle? handle;
final bool replace;

const _ShortcutLaunchHandleWidget(this.body, this.handle, this.replace,
{final Key? key})
: super(key: key);
const _ShortcutLaunchHandleWidget(this.body, this.handle, this.replace);

@override
State<StatefulWidget> createState() {
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/database/group_dao_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class _GroupEntryConverter extends DaoTableDataConverter<GroupEntry> {
}

class GroupDaoPage extends BasePage with WithBlocStateless {
const GroupDaoPage({final Key? key}) : super(key: key);
const GroupDaoPage({super.key});

@override
Widget buildPage(final BuildContext context) {
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/database/nickname_dao_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class _LastSeenConverter extends DaoTableDataConverter<LastSeenDevice> {
}

class NicknameDaoPage extends BasePage with WithBlocStateless {
const NicknameDaoPage({final Key? key}) : super(key: key);
const NicknameDaoPage({super.key});

@override
Widget buildPage(final BuildContext context) {
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/database/settings_dao_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class _SimpleSettingConverter extends DaoTableDataConverter<SimpleSetting> {
}

class SettingsDaoPage extends BasePage with WithBlocStateless {
const SettingsDaoPage({final Key? key}) : super(key: key);
const SettingsDaoPage({super.key});

@override
Widget buildPage(final BuildContext context) {
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/database/vive_base_station_dao_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class _ViveBaseStationIdConverter
}

class ViveBaseStationDaoPage extends BasePage with WithBlocStateless {
const ViveBaseStationDaoPage({final Key? key}) : super(key: key);
const ViveBaseStationDaoPage({super.key});

@override
Widget buildPage(final BuildContext context) {
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/database_test_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'database/settings_dao_page.dart';
import 'database/vive_base_station_dao_page.dart';

class DatabaseTestPage extends BasePage with WithBlocStateless {
DatabaseTestPage({final Key? key}) : super(key: key, replace: true);
DatabaseTestPage({super.key}) : super(replace: true);

@override
Widget buildPage(final BuildContext context) {
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/help_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'base_page.dart';
/// A widget showing the a material scaffold with some help items the user may need.
///
class HelpPage extends BasePage with WithBlocStateless {
const HelpPage({final Key? key}) : super(key: key);
const HelpPage({super.key});

@override
Widget buildPage(final BuildContext context) {
Expand Down
11 changes: 4 additions & 7 deletions lib/pages/main_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Stream<Tuple3<List<Nickname>, List<LighthouseDevice>, List<GroupWithEntries>>>
}

class MainPage extends BasePage with WithBlocStateless {
MainPage({final Key? key}) : super(key: key, replace: true);
MainPage({super.key}) : super(replace: true);

@override
Widget buildPage(final BuildContext context) {
Expand All @@ -79,8 +79,7 @@ class MainPage extends BasePage with WithBlocStateless {
}

class _ScanFloatingButtonWidget extends StatelessWidget with ScanningMixin {
const _ScanFloatingButtonWidget({final Key? key, required this.settings})
: super(key: key);
const _ScanFloatingButtonWidget({required this.settings});

final MainPageSettings settings;

Expand Down Expand Up @@ -197,8 +196,7 @@ class _ScanFloatingButtonWidget extends StatelessWidget with ScanningMixin {
}

class ScanDevicesPage extends StatefulWidget {
const ScanDevicesPage({final Key? key, required this.settings})
: super(key: key);
const ScanDevicesPage({super.key, required this.settings});

final MainPageSettings settings;

Expand Down Expand Up @@ -799,8 +797,7 @@ class ScanDevicesIntent extends Intent {

class BluetoothOffScreen extends StatelessWidget with ScanningMixin {
const BluetoothOffScreen(
{final Key? key, required this.state, required this.settings})
: super(key: key);
{super.key, required this.state, required this.settings});

final BluetoothAdapterState? state;
final MainPageSettings settings;
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/material_test_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'base_page.dart';
/// A page showing all the colors the material colors that the app uses.
///
class MaterialTestPage extends BasePage with WithBlocStateless {
const MaterialTestPage({final Key? key}) : super(key: key);
const MaterialTestPage({super.key});

Widget createBlock(final Color background, final Color text,
final String name, final TextStyle baseTheme) {
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/not_found_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:lighthouse_pm/widgets/content_container_widget.dart';
import 'base_page.dart';

class NotFoundPage extends BasePage {
const NotFoundPage({final Key? key}) : super(key: key);
const NotFoundPage({super.key});

@override
Widget buildPage(final BuildContext context) {
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/settings/privacy_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:lighthouse_pm/widgets/privacy_page_segment.dart';
import '../base_page.dart';

class PrivacyPage extends BasePage {
const PrivacyPage({final Key? key}) : super(key: key);
const PrivacyPage({super.key});

static const version1_1Date = "January 1st 2022";

Expand Down
Loading

0 comments on commit a07b3fb

Please sign in to comment.