From 305236aa99a0cdd3231f662392b4c195b44467bf Mon Sep 17 00:00:00 2001 From: Feichtmeier Date: Sat, 3 Feb 2024 08:44:02 +0100 Subject: [PATCH 1/2] Update deps where possible --- lib/services/display/display_service.dart | 4 ++-- lib/services/settings_service.dart | 8 ++++---- lib/view/common/section_description.dart | 2 +- lib/view/common/title_bar_tab.dart | 2 +- lib/view/pages/accessibility/seeing_section.dart | 4 ++-- lib/view/pages/accounts/accounts_page.dart | 10 +++++----- lib/view/pages/appearance/dock_section.dart | 4 ++-- lib/view/pages/appearance/theme_section.dart | 4 ++-- lib/view/pages/apps/apps_page.dart | 2 +- .../pages/bluetooth/bluetooth_device_model.dart | 2 +- lib/view/pages/bluetooth/bluetooth_device_row.dart | 2 +- lib/view/pages/bluetooth/bluetooth_page.dart | 2 +- lib/view/pages/connections/connections_page.dart | 2 +- .../connections/widgets/authentication_dialog.dart | 8 ++++---- lib/view/pages/connections/wifi_content.dart | 8 ++++---- lib/view/pages/date_and_time/date_time_page.dart | 6 +++--- lib/view/pages/date_and_time/timezones.dart | 2 +- lib/view/pages/default_apps/default_apps_page.dart | 2 +- lib/view/pages/displays/displays_model.dart | 8 ++++---- lib/view/pages/displays/nightlight_page.dart | 2 +- .../pages/displays/widgets/monitor_section.dart | 2 +- lib/view/pages/info/info_page.dart | 12 ++++++------ lib/view/pages/keyboard/input_source_model.dart | 4 ++-- lib/view/pages/keyboard/input_source_section.dart | 4 ++-- .../keyboard/input_source_selection_section.dart | 6 +++--- lib/view/pages/keyboard/keyboard_shortcut_row.dart | 6 +++--- .../pages/keyboard/keyboard_shortcuts_page.dart | 2 +- .../pages/keyboard/special_characters_model.dart | 4 ++-- .../pages/keyboard/special_characters_section.dart | 2 +- lib/view/pages/multitasking/multi_tasking_page.dart | 6 +++--- lib/view/pages/power/battery_section.dart | 9 +++++---- lib/view/pages/power/lid_close_section.dart | 2 +- lib/view/pages/power/power_page.dart | 2 +- lib/view/pages/power/power_profile_widgets.dart | 6 +++--- lib/view/pages/power/power_profile_x.dart | 11 +++++++---- lib/view/pages/privacy/house_keeping_page.dart | 6 +++--- lib/view/pages/privacy/location_page.dart | 4 ++-- lib/view/pages/privacy/privacy_page.dart | 2 +- lib/view/pages/privacy/reporting_page.dart | 2 +- lib/view/pages/privacy/screen_saver_page.dart | 2 +- .../region_and_language_page.dart | 4 ++-- .../removable_media/removable_media_model.dart | 2 +- .../pages/removable_media/removable_media_page.dart | 4 ++-- lib/view/pages/settings_simple_dialog.dart | 2 +- lib/view/pages/users/users.dart | 2 +- .../pages/wallpaper/color_shading_option_row.dart | 4 ++-- lib/view/pages/wallpaper/wallpaper_page.dart | 8 ++++---- pubspec.yaml | 13 ++++++------- 48 files changed, 110 insertions(+), 107 deletions(-) diff --git a/lib/services/display/display_service.dart b/lib/services/display/display_service.dart index b5231c69..a4c58737 100644 --- a/lib/services/display/display_service.dart +++ b/lib/services/display/display_service.dart @@ -89,8 +89,8 @@ class DisplayService { displayConfig.identity(i).connector, ), // maybe monitorId ? DBusString(confMonitor.monitorModeId), // option selected - DBusDict.stringVariant({}) - ]) + DBusDict.stringVariant({}), + ]), ]), ]), ); diff --git a/lib/services/settings_service.dart b/lib/services/settings_service.dart index 65fd3d37..607ad0ae 100644 --- a/lib/services/settings_service.dart +++ b/lib/services/settings_service.dart @@ -74,13 +74,13 @@ class Settings { } _values[key] = value; switch (T) { - case bool: + case const (bool): return _settings.set(key, DBusBoolean(value as bool)); - case int: + case const (int): return _settings.set(key, DBusInt32(value as int)); - case double: + case const (double): return _settings.set(key, DBusDouble(value as double)); - case String: + case const (String): return _settings.set(key, DBusString(value as String)); default: break; diff --git a/lib/view/common/section_description.dart b/lib/view/common/section_description.dart index cf26d01d..c398ea83 100644 --- a/lib/view/common/section_description.dart +++ b/lib/view/common/section_description.dart @@ -23,7 +23,7 @@ class SectionDescription extends StatelessWidget { text, style: Theme.of(context).textTheme.bodySmall, ), - ) + ), ], ), ), diff --git a/lib/view/common/title_bar_tab.dart b/lib/view/common/title_bar_tab.dart index 8fa1eb11..d3d76a64 100644 --- a/lib/view/common/title_bar_tab.dart +++ b/lib/view/common/title_bar_tab.dart @@ -30,7 +30,7 @@ class TitleBarTab extends StatelessWidget { textAlign: TextAlign.center, overflow: TextOverflow.ellipsis, ), - ) + ), ], ), ); diff --git a/lib/view/pages/accessibility/seeing_section.dart b/lib/view/pages/accessibility/seeing_section.dart index f6894f8a..a6be4b3c 100644 --- a/lib/view/pages/accessibility/seeing_section.dart +++ b/lib/view/pages/accessibility/seeing_section.dart @@ -281,14 +281,14 @@ class _MagnifierPositionOptions extends StatelessWidget { initialValue: model.screenPosition, itemBuilder: (_) { return [ - for (var item in ScreenPosition.values) + for (final item in ScreenPosition.values) PopupMenuItem( value: item, onTap: !model.screenPartEnabled ? null : () => model.screenPosition = item, child: Text(item.localize(context.l10n)), - ) + ), ]; }, child: Text( diff --git a/lib/view/pages/accounts/accounts_page.dart b/lib/view/pages/accounts/accounts_page.dart index 5f4f325a..8c6fbe5e 100644 --- a/lib/view/pages/accounts/accounts_page.dart +++ b/lib/view/pages/accounts/accounts_page.dart @@ -63,11 +63,11 @@ class AccountsPage extends StatelessWidget { init: () async { await Future.delayed(const Duration(seconds: 1)); }, - ) + ), ], ), ), - ) + ), ], ); } @@ -158,7 +158,7 @@ class _AddUserDialogState extends State<_AddUserDialog> { controller: _passwordHintController, obscureText: true, decoration: const InputDecoration(labelText: 'Password hint'), - ) + ), ], ), actions: [ @@ -175,7 +175,7 @@ class _AddUserDialogState extends State<_AddUserDialog> { model.init().then((value) => Navigator.pop(context)); }), child: Text(context.l10n.confirm), - ) + ), ], ); } @@ -309,7 +309,7 @@ class _EditUserDialogState extends State<_EditUserDialog> { TextField( controller: userNameController, onSubmitted: (value) => model.userName = value, - ) + ), ], ); } diff --git a/lib/view/pages/appearance/dock_section.dart b/lib/view/pages/appearance/dock_section.dart index dd3e4b0b..e4538851 100644 --- a/lib/view/pages/appearance/dock_section.dart +++ b/lib/view/pages/appearance/dock_section.dart @@ -154,7 +154,7 @@ class DockSection extends StatelessWidget { ), ), ], - ) + ), ], ), SettingsSection( @@ -184,7 +184,7 @@ class DockSection extends StatelessWidget { ), height: assetHeight, ), - ) + ), ], ), YaruSwitchRow( diff --git a/lib/view/pages/appearance/theme_section.dart b/lib/view/pages/appearance/theme_section.dart index d33d00d7..3cdba854 100644 --- a/lib/view/pages/appearance/theme_section.dart +++ b/lib/view/pages/appearance/theme_section.dart @@ -63,7 +63,7 @@ class _ThemeSectionState extends State { spacing: 5, runSpacing: 5, children: [ - for (var globalTheme in globalThemeList) + for (final globalTheme in globalThemeList) YaruColorDisk( onPressed: () { theme.apply(Theme.of(context).brightness, globalTheme); @@ -72,7 +72,7 @@ class _ThemeSectionState extends State { selected: YaruTheme.of(context).variant == globalTheme, ), ], - ) + ), ], ); } diff --git a/lib/view/pages/apps/apps_page.dart b/lib/view/pages/apps/apps_page.dart index 18111e5b..fde24385 100644 --- a/lib/view/pages/apps/apps_page.dart +++ b/lib/view/pages/apps/apps_page.dart @@ -32,7 +32,7 @@ class AppsPage extends StatelessWidget { icon: const Icon(YaruIcons.application_bag), ), ), - ) + ), ], ); } diff --git a/lib/view/pages/bluetooth/bluetooth_device_model.dart b/lib/view/pages/bluetooth/bluetooth_device_model.dart index c8aac2ae..753ec329 100644 --- a/lib/view/pages/bluetooth/bluetooth_device_model.dart +++ b/lib/view/pages/bluetooth/bluetooth_device_model.dart @@ -44,7 +44,7 @@ const yaruIcons = { 'video-display': YaruIcons.computer, 'preferences-desktop-keyboard': YaruIcons.keyboard, 'touchpad-disabled': YaruIcons.touchpad, - 'thunderbolt': YaruIcons.thunderbolt + 'thunderbolt': YaruIcons.thunderbolt, }; class BluetoothDeviceModel extends SafeChangeNotifier { diff --git a/lib/view/pages/bluetooth/bluetooth_device_row.dart b/lib/view/pages/bluetooth/bluetooth_device_row.dart index 6f486d87..8d8427d8 100644 --- a/lib/view/pages/bluetooth/bluetooth_device_row.dart +++ b/lib/view/pages/bluetooth/bluetooth_device_row.dart @@ -162,7 +162,7 @@ class _BluetoothDeviceDialog extends StatelessWidget { Text( model.errorMessage, style: TextStyle(color: Theme.of(context).colorScheme.error), - ) + ), ], ); } diff --git a/lib/view/pages/bluetooth/bluetooth_page.dart b/lib/view/pages/bluetooth/bluetooth_page.dart index b61c43ea..8976bc24 100644 --- a/lib/view/pages/bluetooth/bluetooth_page.dart +++ b/lib/view/pages/bluetooth/bluetooth_page.dart @@ -108,7 +108,7 @@ class _BluetoothPageState extends State { return const SizedBox(); } }, - ) + ), ], ), ], diff --git a/lib/view/pages/connections/connections_page.dart b/lib/view/pages/connections/connections_page.dart index c9a4ce31..16785c53 100644 --- a/lib/view/pages/connections/connections_page.dart +++ b/lib/view/pages/connections/connections_page.dart @@ -62,7 +62,7 @@ class _ConnectionsPageState extends State { TitleBarTab( iconData: YaruIcons.network_cellular, text: 'Cellular', - ) + ), ], ), ), diff --git a/lib/view/pages/connections/widgets/authentication_dialog.dart b/lib/view/pages/connections/widgets/authentication_dialog.dart index 94e38142..90fa627a 100644 --- a/lib/view/pages/connections/widgets/authentication_dialog.dart +++ b/lib/view/pages/connections/widgets/authentication_dialog.dart @@ -42,7 +42,7 @@ class AuthenticationDialog extends StatelessWidget { DropdownMenuItem( value: 'a', child: Text('Not Implemented yet'), - ) + ), ], ), ), @@ -90,7 +90,7 @@ class AuthenticationDialog extends StatelessWidget { ), ), ), - ) + ), ], ), actions: [ @@ -107,7 +107,7 @@ class AuthenticationDialog extends StatelessWidget { TextButton( onPressed: () => Navigator.of(context).pop(), child: const Text('Cancel'), - ) + ), ], ); } @@ -133,7 +133,7 @@ class _DialogRow extends StatelessWidget { ), ), const SizedBox(width: 10), - Flexible(fit: FlexFit.loose, flex: 10, child: field) + Flexible(fit: FlexFit.loose, flex: 10, child: field), ], ); } diff --git a/lib/view/pages/connections/wifi_content.dart b/lib/view/pages/connections/wifi_content.dart index 0a3eb6a1..0db86028 100644 --- a/lib/view/pages/connections/wifi_content.dart +++ b/lib/view/pages/connections/wifi_content.dart @@ -40,7 +40,7 @@ class WifiDevicesContent extends StatelessWidget { .onSurface .withOpacity(0.5), ), - ) + ), ], ), onChanged: wifiModel.toggleWifi, @@ -74,11 +74,11 @@ class WifiDevicesContent extends StatelessWidget { ); } }, - ) + ), ], ); }, - ) + ), ], ); } @@ -120,7 +120,7 @@ class WifiAdaptorNotFound extends StatelessWidget { Text( 'Make sure you have a Wi-Fi adaptor plugged and turned on', style: Theme.of(context).textTheme.bodyMedium, - ) + ), ], ); } diff --git a/lib/view/pages/date_and_time/date_time_page.dart b/lib/view/pages/date_and_time/date_time_page.dart index 4afc313d..bc0ffeb9 100644 --- a/lib/view/pages/date_and_time/date_time_page.dart +++ b/lib/view/pages/date_and_time/date_time_page.dart @@ -105,7 +105,7 @@ class _DateTimePageState extends State { style: Theme.of(context).textTheme.displayLarge, ), ), - ) + ), ], ), SettingsSection( @@ -165,7 +165,7 @@ class _TimezoneSelectDialog extends StatelessWidget { title: context.l10n.dateAmdTimePageSelectTimezone, child: SettingsPage( children: [ - for (var timezone in timezones) + for (final timezone in timezones) InkWell( borderRadius: BorderRadius.circular(6.0), onTap: () { @@ -179,7 +179,7 @@ class _TimezoneSelectDialog extends StatelessWidget { ), trailing: const Text(''), ), - ) + ), ], ), ); diff --git a/lib/view/pages/date_and_time/timezones.dart b/lib/view/pages/date_and_time/timezones.dart index a086ef81..d024eccc 100644 --- a/lib/view/pages/date_and_time/timezones.dart +++ b/lib/view/pages/date_and_time/timezones.dart @@ -593,5 +593,5 @@ const timezones = [ 'Universal', 'W-SU', 'WET', - 'Zulu' + 'Zulu', ]; diff --git a/lib/view/pages/default_apps/default_apps_page.dart b/lib/view/pages/default_apps/default_apps_page.dart index 49367082..d5fb9a5f 100644 --- a/lib/view/pages/default_apps/default_apps_page.dart +++ b/lib/view/pages/default_apps/default_apps_page.dart @@ -23,7 +23,7 @@ class DefaultAppsPage extends StatelessWidget { children: [ Center( child: Text(context.l10n.defaultAppsPageTitle), - ) + ), ], ); } diff --git a/lib/view/pages/displays/displays_model.dart b/lib/view/pages/displays/displays_model.dart index a600542c..84d64625 100644 --- a/lib/view/pages/displays/displays_model.dart +++ b/lib/view/pages/displays/displays_model.dart @@ -54,7 +54,7 @@ class DisplaysModel extends SafeChangeNotifier { extension DisplayModelSetters on DisplaysModel { void setResolution(int index, String resolution) { final configurations = [ - ..._currentNotifier.value!.configurations + ..._currentNotifier.value!.configurations, ]; final configurationMonitorUpdate = configurations.removeAt(index); @@ -93,7 +93,7 @@ extension DisplayModelSetters on DisplaysModel { } final configurations = [ - ..._currentNotifier.value!.configurations + ..._currentNotifier.value!.configurations, ]; final configurationMonitorUpdate = configurations.removeAt(index); @@ -110,7 +110,7 @@ extension DisplayModelSetters on DisplaysModel { void setOrientation(int index, LogicalMonitorOrientation orientation) { final configurations = [ - ..._currentNotifier.value!.configurations + ..._currentNotifier.value!.configurations, ]; final configurationMonitorUpdate = configurations.removeAt(index); @@ -126,7 +126,7 @@ extension DisplayModelSetters on DisplaysModel { void setScale(int index, double scale) { final configurations = [ - ..._currentNotifier.value!.configurations + ..._currentNotifier.value!.configurations, ]; final configurationMonitorUpdate = configurations.removeAt(index); diff --git a/lib/view/pages/displays/nightlight_page.dart b/lib/view/pages/displays/nightlight_page.dart index cb857d12..32ec52f5 100644 --- a/lib/view/pages/displays/nightlight_page.dart +++ b/lib/view/pages/displays/nightlight_page.dart @@ -63,7 +63,7 @@ class NightlightPage extends StatelessWidget { ), const TimeSelector( isFrom: false, - ) + ), ], ), ), diff --git a/lib/view/pages/displays/widgets/monitor_section.dart b/lib/view/pages/displays/widgets/monitor_section.dart index 7cda2660..1a2d3c59 100644 --- a/lib/view/pages/displays/widgets/monitor_section.dart +++ b/lib/view/pages/displays/widgets/monitor_section.dart @@ -119,7 +119,7 @@ class MonitorSection extends StatelessWidget { child: Text( 'x${config.availableScales[i].toString().replaceAll('.0', '')}', ), - ) + ), ], child: Text('x${config.scale.toString().replaceAll('.0', '')}'), diff --git a/lib/view/pages/info/info_page.dart b/lib/view/pages/info/info_page.dart index f6950cbb..99cc14da 100644 --- a/lib/view/pages/info/info_page.dart +++ b/lib/view/pages/info/info_page.dart @@ -13,7 +13,7 @@ import 'package:settings/view/pages/settings_simple_dialog.dart'; import 'package:ubuntu_service/ubuntu_service.dart'; import 'package:udisks/udisks.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:yaru_colors/yaru_colors.dart'; +import 'package:yaru/yaru.dart'; import 'package:yaru_icons/yaru_icons.dart'; import 'package:yaru_widgets/yaru_widgets.dart'; @@ -102,7 +102,7 @@ class _InfoPageState extends State { .textTheme .displayMedium! .copyWith(color: Theme.of(context).colorScheme.onSurface), - ) + ), ], ), const SizedBox(height: 50), @@ -182,7 +182,7 @@ class _InfoPageState extends State { .showSnackBar(sysInfoSnackBar), ); }, - ) + ), ], ), ), @@ -232,7 +232,7 @@ class _Computer extends StatelessWidget { ), ], ), - ) + ), ], ); } @@ -285,9 +285,9 @@ class _HostnameSettingsState extends State<_HostnameSettings> { TextButton( onPressed: () => model.setHostname(_controller.value.text), child: const Text('Rename'), - ) + ), ], - ) + ), ], ); } diff --git a/lib/view/pages/keyboard/input_source_model.dart b/lib/view/pages/keyboard/input_source_model.dart index 7df0b1ec..7e9ae351 100644 --- a/lib/view/pages/keyboard/input_source_model.dart +++ b/lib/view/pages/keyboard/input_source_model.dart @@ -54,8 +54,8 @@ class InputSourceModel extends SafeChangeNotifier { final settings = GSettings(schemaInputSources); final array = DBusArray(DBusSignature('(ss)'), [ - for (var inputType in inputTypes ?? []) - DBusStruct([const DBusString('xkb'), DBusString(inputType)]) + for (final inputType in inputTypes ?? []) + DBusStruct([const DBusString('xkb'), DBusString(inputType)]), ]); await settings.set(_sourcesKey, array); diff --git a/lib/view/pages/keyboard/input_source_section.dart b/lib/view/pages/keyboard/input_source_section.dart index 13873b77..d4190800 100644 --- a/lib/view/pages/keyboard/input_source_section.dart +++ b/lib/view/pages/keyboard/input_source_section.dart @@ -39,9 +39,9 @@ class InputSourceSection extends StatelessWidget { groupValue: inputSourceModel.perWindow, onChanged: (_) => inputSourceModel.perWindow = true, ), - ) + ), ], - ) + ), ], ); } diff --git a/lib/view/pages/keyboard/input_source_selection_section.dart b/lib/view/pages/keyboard/input_source_selection_section.dart index ecdd4945..4903d97b 100644 --- a/lib/view/pages/keyboard/input_source_selection_section.dart +++ b/lib/view/pages/keyboard/input_source_selection_section.dart @@ -96,7 +96,7 @@ class _InputTypeRow extends StatelessWidget { YaruOptionButton( onPressed: () => model.removeInputSource(inputType), child: const Icon(YaruIcons.trash), - ) + ), ], ), title: Text( @@ -155,7 +155,7 @@ class _AddKeymapDialogState extends State<_AddKeymapDialog> { '${model.inputSources[tabbedIndex].name ?? ''}: ${model.inputSources[tabbedIndex].description ?? ''}', closeIconData: YaruIcons.window_close, children: [ - for (var variant in model.inputSources[tabbedIndex].variants) + for (final variant in model.inputSources[tabbedIndex].variants) InkWell( onTap: () { if (model.inputSources[tabbedIndex].name != null && @@ -183,7 +183,7 @@ class _AddKeymapDialogState extends State<_AddKeymapDialog> { variantsLoad = false; }), child: const Icon(YaruIcons.pan_start), - ) + ), ], ); } diff --git a/lib/view/pages/keyboard/keyboard_shortcut_row.dart b/lib/view/pages/keyboard/keyboard_shortcut_row.dart index ee2bd147..ef785844 100644 --- a/lib/view/pages/keyboard/keyboard_shortcut_row.dart +++ b/lib/view/pages/keyboard/keyboard_shortcut_row.dart @@ -66,7 +66,7 @@ class _KeyboardShortcutRowState extends State { title: Text(widget.label), trailing: Row( children: [ - for (var string in shortcut) + for (final string in shortcut) Card( child: Padding( padding: const EdgeInsets.all(4.0), @@ -80,7 +80,7 @@ class _KeyboardShortcutRowState extends State { ), ), ), - ) + ), ], ), ), @@ -141,7 +141,7 @@ class KeyboardShortcutDialog extends StatelessWidget { ElevatedButton( child: const Text('Confirm'), onPressed: () => Navigator.of(context).pop([processKeys(keys)]), - ) + ), ], ); } diff --git a/lib/view/pages/keyboard/keyboard_shortcuts_page.dart b/lib/view/pages/keyboard/keyboard_shortcuts_page.dart index 56312d78..eb553039 100644 --- a/lib/view/pages/keyboard/keyboard_shortcuts_page.dart +++ b/lib/view/pages/keyboard/keyboard_shortcuts_page.dart @@ -54,7 +54,7 @@ class KeyboardShortcutsPage extends StatelessWidget { ), ], ), - ) + ), ], ); } diff --git a/lib/view/pages/keyboard/special_characters_model.dart b/lib/view/pages/keyboard/special_characters_model.dart index 47390739..a5d99e1a 100644 --- a/lib/view/pages/keyboard/special_characters_model.dart +++ b/lib/view/pages/keyboard/special_characters_model.dart @@ -124,7 +124,7 @@ class SpecialCharactersModel extends SafeChangeNotifier { ComposeOptions.caps: 'Caps-Lock-Key', ComposeOptions.print: 'Print-Key', ComposeOptions.scrollLock: 'Scroll-Lock-Key', - ComposeOptions.defaultLayout: 'Default Layout' + ComposeOptions.defaultLayout: 'Default Layout', }; Future getLv3Options() async { @@ -148,7 +148,7 @@ class SpecialCharactersModel extends SafeChangeNotifier { final lv3OptionsToStringMap = { null: 'Default Layout', Lv3Options.none: 'None', - Lv3Options.rightAlt: 'Right Alt-Key' + Lv3Options.rightAlt: 'Right Alt-Key', }; void setLv3Options(Lv3Options lv3options) async { diff --git a/lib/view/pages/keyboard/special_characters_section.dart b/lib/view/pages/keyboard/special_characters_section.dart index 21057021..7e560bcf 100644 --- a/lib/view/pages/keyboard/special_characters_section.dart +++ b/lib/view/pages/keyboard/special_characters_section.dart @@ -63,7 +63,7 @@ class SpecialCharactersSection extends StatelessWidget { ), ), ), - ) + ), ], ); } diff --git a/lib/view/pages/multitasking/multi_tasking_page.dart b/lib/view/pages/multitasking/multi_tasking_page.dart index b172aba8..59e0a59a 100644 --- a/lib/view/pages/multitasking/multi_tasking_page.dart +++ b/lib/view/pages/multitasking/multi_tasking_page.dart @@ -100,7 +100,7 @@ class MultiTaskingPage extends StatelessWidget { ), ), ], - ) + ), ], ), SettingsSection( @@ -148,7 +148,7 @@ class MultiTaskingPage extends StatelessWidget { onChanged: (value) => model.numWorkspaces = value.toInt(), ), ), - ) + ), ], ), SettingsSection( @@ -212,7 +212,7 @@ class MultiTaskingPage extends StatelessWidget { ), height: 60, ), - ) + ), ], ), SettingsSection( diff --git a/lib/view/pages/power/battery_section.dart b/lib/view/pages/power/battery_section.dart index 3e346dce..c4d2b21c 100644 --- a/lib/view/pages/power/battery_section.dart +++ b/lib/view/pages/power/battery_section.dart @@ -7,7 +7,7 @@ import 'package:settings/view/pages/power/battery_model.dart'; import 'package:settings/view/pages/power/battery_widgets.dart'; import 'package:ubuntu_service/ubuntu_service.dart'; import 'package:upower/upower.dart'; -import 'package:yaru_colors/yaru_colors.dart'; +import 'package:yaru/yaru.dart'; import 'package:yaru_widgets/yaru_widgets.dart'; class BatterySection extends StatefulWidget { @@ -35,6 +35,7 @@ class _BatterySectionState extends State { @override Widget build(BuildContext context) { + final theme = Theme.of(context); final model = context.watch(); return SettingsSection( width: kDefaultWidth, @@ -45,10 +46,10 @@ class _BatterySectionState extends State { child: YaruLinearProgressIndicator( value: model.percentage / 100.0, color: model.percentage > 80.0 - ? YaruColors.success + ? theme.colorScheme.success : model.percentage < 30.0 - ? YaruColors.error - : YaruColors.warning, + ? theme.colorScheme.error + : theme.colorScheme.warning, ), ), Padding( diff --git a/lib/view/pages/power/lid_close_section.dart b/lib/view/pages/power/lid_close_section.dart index b576adc3..b0bba231 100644 --- a/lib/view/pages/power/lid_close_section.dart +++ b/lib/view/pages/power/lid_close_section.dart @@ -65,7 +65,7 @@ class LidCloseSection extends StatelessWidget { : '', ), ), - ) + ), ], ); } diff --git a/lib/view/pages/power/power_page.dart b/lib/view/pages/power/power_page.dart index e2777845..d7de6659 100644 --- a/lib/view/pages/power/power_page.dart +++ b/lib/view/pages/power/power_page.dart @@ -29,7 +29,7 @@ class PowerPage extends StatelessWidget { PowerProfileSection.create(context), PowerSettingsSection.create(context), SuspendSection.create(context), - LidCloseSection.create(context) + LidCloseSection.create(context), ], ); } diff --git a/lib/view/pages/power/power_profile_widgets.dart b/lib/view/pages/power/power_profile_widgets.dart index 95cd73c5..c6255509 100644 --- a/lib/view/pages/power/power_profile_widgets.dart +++ b/lib/view/pages/power/power_profile_widgets.dart @@ -14,6 +14,7 @@ class ProfileModeTitle extends StatelessWidget { @override Widget build(BuildContext context) { + final theme = Theme.of(context); return Padding( padding: const EdgeInsets.only(bottom: 5), child: Row( @@ -22,11 +23,10 @@ class ProfileModeTitle extends StatelessWidget { padding: const EdgeInsets.only(right: 5), child: Icon( powerProfile.getIcon(), - color: powerProfile - .getColor(Theme.of(context).brightness == Brightness.light), + color: powerProfile.getColor(theme), ), ), - title + title, ], ), ); diff --git a/lib/view/pages/power/power_profile_x.dart b/lib/view/pages/power/power_profile_x.dart index f5bb9067..5bb52e9a 100644 --- a/lib/view/pages/power/power_profile_x.dart +++ b/lib/view/pages/power/power_profile_x.dart @@ -1,8 +1,8 @@ -import 'package:flutter/widgets.dart'; +import 'package:flutter/material.dart'; import 'package:settings/l10n/l10n.dart'; import 'package:settings/services/power_profile_service.dart'; import 'package:settings/utils.dart'; -import 'package:yaru_colors/yaru_colors.dart'; +import 'package:yaru/yaru.dart'; import 'package:yaru_icons/yaru_icons.dart'; extension PowerProfileX on PowerProfile { @@ -39,14 +39,17 @@ extension PowerProfileX on PowerProfile { } } - Color getColor(bool light) { + Color getColor(ThemeData theme) { + final light = theme.brightness == Brightness.light; switch (this) { case PowerProfile.performance: return light ? YaruColors.red : lighten(YaruColors.red, 30); case PowerProfile.balanced: return light ? YaruColors.inkstone : YaruColors.porcelain; case PowerProfile.powerSaver: - return light ? YaruColors.success : lighten(YaruColors.success, 30); + return light + ? theme.colorScheme.success + : lighten(theme.colorScheme.success, 30); } } } diff --git a/lib/view/pages/privacy/house_keeping_page.dart b/lib/view/pages/privacy/house_keeping_page.dart index 1f7e7087..0c7c9312 100644 --- a/lib/view/pages/privacy/house_keeping_page.dart +++ b/lib/view/pages/privacy/house_keeping_page.dart @@ -92,7 +92,7 @@ class HouseKeepingPage extends StatelessWidget { ), ), ), - ) + ), ], ), SettingsSection( @@ -260,11 +260,11 @@ class _ConfirmationDialogState extends State context.l10n.confirm, ), ), - ) + ), ], ), ), - ) + ), ], ); } diff --git a/lib/view/pages/privacy/location_page.dart b/lib/view/pages/privacy/location_page.dart index 89d918fc..aa432518 100644 --- a/lib/view/pages/privacy/location_page.dart +++ b/lib/view/pages/privacy/location_page.dart @@ -56,9 +56,9 @@ class LocationPage extends StatelessWidget { trailingWidget: Text(context.l10n.locationActionLabel), value: model.enabled, onChanged: (v) => model.enabled = v, - ) + ), ], - ) + ), ], ); } diff --git a/lib/view/pages/privacy/privacy_page.dart b/lib/view/pages/privacy/privacy_page.dart index 76d165fc..a7d0e5e7 100644 --- a/lib/view/pages/privacy/privacy_page.dart +++ b/lib/view/pages/privacy/privacy_page.dart @@ -44,7 +44,7 @@ class PrivacyPage extends StatelessWidget { Padding( padding: EdgeInsets.all(8.0), child: Text('Thunderbolt - Please implement 🥲️'), - ) + ), ], ): (YaruIcons.thunderbolt, context.l10n.thunderBoltPageTitle), HouseKeepingPage.create(context): ( diff --git a/lib/view/pages/privacy/reporting_page.dart b/lib/view/pages/privacy/reporting_page.dart index 1b405a47..e34788c2 100644 --- a/lib/view/pages/privacy/reporting_page.dart +++ b/lib/view/pages/privacy/reporting_page.dart @@ -60,7 +60,7 @@ class ReportingPage extends StatelessWidget { onChanged: (value) => model.sendSoftwareUsageStats = value, ), ], - ) + ), ], ); } diff --git a/lib/view/pages/privacy/screen_saver_page.dart b/lib/view/pages/privacy/screen_saver_page.dart index 6511311d..575b1c20 100644 --- a/lib/view/pages/privacy/screen_saver_page.dart +++ b/lib/view/pages/privacy/screen_saver_page.dart @@ -75,7 +75,7 @@ class ScreenSaverPage extends StatelessWidget { onChanged: (v) => model.showOnLockScreen = v, ), ], - ) + ), ], ); } diff --git a/lib/view/pages/region_and_language/region_and_language_page.dart b/lib/view/pages/region_and_language/region_and_language_page.dart index 295324f6..cf4a79ac 100644 --- a/lib/view/pages/region_and_language/region_and_language_page.dart +++ b/lib/view/pages/region_and_language/region_and_language_page.dart @@ -80,7 +80,7 @@ class _RegionAndLanguagePageState extends State { ), ), ], - ) + ), ], ); } @@ -170,7 +170,7 @@ class _LocaleSelectDialogState extends State<_LocaleSelectDialog> { context.l10n.confirm, ), ), - ) + ), ], ), ); diff --git a/lib/view/pages/removable_media/removable_media_model.dart b/lib/view/pages/removable_media/removable_media_model.dart index 64622f1b..9cd0e69a 100644 --- a/lib/view/pages/removable_media/removable_media_model.dart +++ b/lib/view/pages/removable_media/removable_media_model.dart @@ -47,7 +47,7 @@ class RemovableMediaModel extends SafeChangeNotifier { 'x-content/video-hddvd': 'Video HD DVD', 'x-content/video-svcd': 'Video SV CD', 'x-content/video-vcd': 'Video V CD', - 'x-content/win32-software': 'Windows Software' + 'x-content/win32-software': 'Windows Software', }; final Settings? _removableMediaSettings; diff --git a/lib/view/pages/removable_media/removable_media_page.dart b/lib/view/pages/removable_media/removable_media_page.dart index 3587950c..d75c0d60 100644 --- a/lib/view/pages/removable_media/removable_media_page.dart +++ b/lib/view/pages/removable_media/removable_media_page.dart @@ -46,7 +46,7 @@ class RemovableMediaPage extends StatelessWidget { height: 20, ), if (!model.autoRunNever) - for (var mimeType in RemovableMediaModel.mimeTypes.entries) + for (final mimeType in RemovableMediaModel.mimeTypes.entries) SizedBox( width: kDefaultWidth, child: YaruTile( @@ -57,7 +57,7 @@ class RemovableMediaPage extends StatelessWidget { initialValue: model.getMimeTypeBehavior(mimeType.key), itemBuilder: (p0) { return [ - for (var behavior in MimeTypeBehavior.values) + for (final behavior in MimeTypeBehavior.values) PopupMenuItem( value: behavior, onTap: () => model.setMimeTypeBehavior( diff --git a/lib/view/pages/settings_simple_dialog.dart b/lib/view/pages/settings_simple_dialog.dart index 4fbe6537..49221bf2 100644 --- a/lib/view/pages/settings_simple_dialog.dart +++ b/lib/view/pages/settings_simple_dialog.dart @@ -67,7 +67,7 @@ class SettingsSimpleDialog extends StatelessWidget { semanticLabel: semanticLabel, alignment: alignment, children: [ - for (var child in children) SizedBox(width: width, child: child) + for (final child in children) SizedBox(width: width, child: child), ], ), ); diff --git a/lib/view/pages/users/users.dart b/lib/view/pages/users/users.dart index 32e90189..3a27bcf8 100644 --- a/lib/view/pages/users/users.dart +++ b/lib/view/pages/users/users.dart @@ -21,7 +21,7 @@ class UsersPage extends StatelessWidget { children: [ Center( child: Text(context.l10n.usersPageTitle), - ) + ), ], ); } diff --git a/lib/view/pages/wallpaper/color_shading_option_row.dart b/lib/view/pages/wallpaper/color_shading_option_row.dart index 879fb789..e47055fe 100644 --- a/lib/view/pages/wallpaper/color_shading_option_row.dart +++ b/lib/view/pages/wallpaper/color_shading_option_row.dart @@ -42,7 +42,7 @@ class ColorShadingOptionRow extends StatelessWidget { value: type, onTap: () => model.colorShadingType = type, child: Text(type.localize(context.l10n)), - ) + ), ]; }, ), @@ -82,7 +82,7 @@ class ColorShadingOptionRow extends StatelessWidget { if (primary) {model.primaryColor = '#${color.hex}'} else - {model.secondaryColor = '#${color.hex}'} + {model.secondaryColor = '#${color.hex}'}, }, width: 40, height: 40, diff --git a/lib/view/pages/wallpaper/wallpaper_page.dart b/lib/view/pages/wallpaper/wallpaper_page.dart index df4ef5cf..153fd4e9 100644 --- a/lib/view/pages/wallpaper/wallpaper_page.dart +++ b/lib/view/pages/wallpaper/wallpaper_page.dart @@ -64,7 +64,7 @@ class WallpaperPage extends StatelessWidget { value: mode, onTap: () => model.setWallpaperMode(mode), child: Text(mode.localize(context.l10n)), - ) + ), ]; }, child: Text(model.wallpaperMode.localize(context.l10n)), @@ -138,7 +138,7 @@ class WallpaperPage extends StatelessWidget { child: Text( provider.localize(context.l10n), ), - ) + ), ]; }, child: Text( @@ -251,7 +251,7 @@ class _AddWallpaperTile extends StatelessWidget { const XTypeGroup( label: 'images', extensions: ['jpg', 'png'], - ) + ), ], ); if (null != picPath) { @@ -333,7 +333,7 @@ class _WallpaperGridState extends State<_WallpaperGrid> { ChangeNotifierProvider.value( value: model, child: const _AddWallpaperTile(), - ) + ), ] + widget.data .map( diff --git a/pubspec.yaml b/pubspec.yaml index 6b687f84..ac512f3b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -42,25 +42,24 @@ dependencies: pdf: ^3.7.4 provider: ^6.0.2 safe_change_notifier: ^0.3.1 - ubuntu_service: ^0.2.4 + ubuntu_service: ^0.3.1 udisks: ^0.4.0 upower: ^0.7.0 url_launcher: ^6.0.20 xdg_accounts: git: https://github.com/ubuntu-flutter-community/xdg_accounts xml: ^6.2.2 - yaru: ^0.10.0 - yaru_colors: ^0.1.6 - yaru_icons: ^2.1.0 - yaru_widgets: ^2.7.0 + yaru: ^1.2.1 + yaru_icons: ^2.4.0 + yaru_widgets: ^3.5.0 dev_dependencies: build_runner: ^2.1.2 - flutter_lints: ^2.0.2 + flutter_lints: ^3.0.1 flutter_test: sdk: flutter - mockingjay: ^0.3.0 + mockingjay: ^0.5.0 mockito: ^5.0.16 flutter: From 3c09a0305ee65b9f5ad11607fc5a9d3f9513e45e Mon Sep 17 00:00:00 2001 From: Feichtmeier Date: Sat, 3 Feb 2024 08:47:20 +0100 Subject: [PATCH 2/2] update ci flutter version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 922979c2..cd342727 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: env: - FLUTTER_VERSION: 3.10.x + FLUTTER_VERSION: 3.16.x jobs: analyze: