From b26638956704babfb30810b227dca327eaaa6a26 Mon Sep 17 00:00:00 2001 From: Shripal Jain Date: Sat, 28 Feb 2026 17:22:20 +0100 Subject: [PATCH 01/10] Upgrade `fluent_ui` to v4.14.0 --- pubspec.lock | 56 ++++++++++++++++++++++------------------------------ pubspec.yaml | 4 ++-- 2 files changed, 26 insertions(+), 34 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index e81421a..bd08728 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -125,10 +125,10 @@ packages: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" checked_yaml: dependency: transitive description: @@ -341,10 +341,10 @@ packages: dependency: "direct main" description: name: fluent_ui - sha256: "64223237a1d873b426d578d4d8b2703b8f7d9731608a5beb7b9745194568d484" + sha256: "3fe3b66351e0c47b778e9778c4c1b9c9086515d0d61ea9be3010a9de23cdf28b" url: "https://pub.dev" source: hosted - version: "4.13.0" + version: "4.14.0" flutter: dependency: "direct main" description: flutter @@ -370,10 +370,10 @@ packages: dependency: "direct main" description: name: flutter_i18n - sha256: fe2bd740fe522d9dd791850baa6cba492f00c283f3c0b0012995d538ce66570c + sha256: af7d625e4bfd04764d1554a6411d349dd62d4dc204105cc819a81a35a77bd9b6 url: "https://pub.dev" source: hosted - version: "0.36.3" + version: "0.37.1" flutter_launcher_icons: dependency: "direct dev" description: @@ -501,14 +501,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.5" - js: - dependency: transitive - description: - name: js - sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" - url: "https://pub.dev" - source: hosted - version: "0.7.2" json_annotation: dependency: transitive description: @@ -569,26 +561,26 @@ packages: dependency: transitive description: name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6" url: "https://pub.dev" source: hosted - version: "0.12.17" + version: "0.12.18" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.13.0" math_expressions: dependency: transitive description: name: math_expressions - sha256: "218dc65bed4726562bb31c53d8daa3cc824664b26fb72d77bc592757edf74ba0" + sha256: "2e1ceb974c2b1893c809a68c7005f1b63f7324db0add800a0e792b1ac8ff9f03" url: "https://pub.dev" source: hosted - version: "2.7.0" + version: "3.1.0" menu_base: dependency: transitive description: @@ -745,10 +737,10 @@ packages: dependency: transitive description: name: petitparser - sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" + sha256: "91bd59303e9f769f108f8df05e371341b15d59e995e6806aefab827b58336675" url: "https://pub.dev" source: hosted - version: "6.1.0" + version: "7.0.2" platform: dependency: transitive description: @@ -1110,26 +1102,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "75906bf273541b676716d1ca7627a17e4c4070a3a16272b7a3dc7da3b9f3f6b7" + sha256: "54c516bbb7cee2754d327ad4fca637f78abfc3cbcc5ace83b3eda117e42cd71a" url: "https://pub.dev" source: hosted - version: "1.26.3" + version: "1.29.0" test_api: dependency: transitive description: name: test_api - sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 + sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636" url: "https://pub.dev" source: hosted - version: "0.7.7" + version: "0.7.9" test_core: dependency: transitive description: name: test_core - sha256: "0cc24b5ff94b38d2ae73e1eb43cc302b77964fbf67abad1e296025b78deb53d0" + sha256: "394f07d21f0f2255ec9e3989f21e54d3c7dc0e6e9dbce160e5a9c1a6be0e2943" url: "https://pub.dev" source: hosted - version: "0.6.12" + version: "0.6.15" text_scroll: dependency: "direct main" description: @@ -1142,10 +1134,10 @@ packages: dependency: transitive description: name: toml - sha256: d968d149c8bd06dc14e09ea3a140f90a3f2ba71949e7a91df4a46f3107400e71 + sha256: "35cd2a1351c14bd213f130f8efcbd3e0c18181bff0c8ca7a08f6822a2bede786" url: "https://pub.dev" source: hosted - version: "0.16.0" + version: "0.17.0" tray_manager: dependency: "direct main" description: @@ -1302,10 +1294,10 @@ packages: dependency: transitive description: name: xml - sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + sha256: "971043b3a0d3da28727e40ed3e0b5d18b742fa5a68665cca88e74b7876d5e025" url: "https://pub.dev" source: hosted - version: "6.5.0" + version: "6.6.1" xml2json: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index a2b1829..026d9b3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,11 +28,11 @@ dependencies: sdk: flutter # UI - fluent_ui: ^4.13.0 + fluent_ui: ^4.14.0 system_theme: ^3.1.2 go_router: ^17.0.0 flutter_acrylic: ^1.1.4 - flutter_i18n: ^0.36.3 + flutter_i18n: ^0.37.1 window_manager: ^0.5.1 text_scroll: ^0.2.1 From acb3ebe79aded3885bb0753fb237be69f548a9c5 Mon Sep 17 00:00:00 2001 From: Shripal Jain Date: Sat, 28 Feb 2026 17:29:14 +0100 Subject: [PATCH 02/10] Refactor theme brightness settings - To support fluent_ui upgrade to `RadioGroup` --- .../widget/theme_brightness_setting.dart | 65 +++++++++++-------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/lib/presentation/settings/widget/theme_brightness_setting.dart b/lib/presentation/settings/widget/theme_brightness_setting.dart index 5f33cb6..310d548 100644 --- a/lib/presentation/settings/widget/theme_brightness_setting.dart +++ b/lib/presentation/settings/widget/theme_brightness_setting.dart @@ -12,34 +12,45 @@ class ThemeBrightnessSetting extends AppStatelessWidget { @override Widget build(BuildContext context) { - return Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ...Brightness.values.map( - (brightness) => Padding( - padding: const EdgeInsets.only(bottom: 8), - child: RadioButton( - checked: brightnessPreference.getValue() == brightness, - onChanged: (checked) { - if (checked) { - brightnessPreference.setValue(brightness); - } - }, - content: Text(translatedText(context, key: brightness.name)), - ), - ), + return StreamBuilder( + stream: brightnessPreference, + builder: (context, brightness) => RadioGroup( + groupValue: AppThemeBrightness.fromBrightness(brightness.data), + onChanged: (newValue) => brightnessPreference.setValue(newValue?.toBrightness()), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: AppThemeBrightness.values + .map( + (brightness) => Padding( + padding: const EdgeInsets.only(bottom: 8), + child: RadioButton( + value: brightness, + content: Text(translatedText(context, key: brightness.name)), + ), + ), + ) + .toList(), ), - RadioButton( - checked: brightnessPreference.getValue() == null, - onChanged: (checked) { - if (checked) { - brightnessPreference.setValue(null); - } - }, - content: Text(translatedText(context, key: 'system')), - ), - ], + ), ); } } + +enum AppThemeBrightness { + light, + dark, + system; + + Brightness? toBrightness() => switch (this) { + dark => Brightness.dark, + system => null, + light => Brightness.light, + }; + + static AppThemeBrightness fromBrightness(Brightness? brightness) => switch (brightness) { + Brightness.dark => dark, + null => system, + Brightness.light => light, + }; +} From 452641d4e87a3947d51c3a1724976627ca8a9935 Mon Sep 17 00:00:00 2001 From: Shripal Jain Date: Sat, 28 Feb 2026 17:29:45 +0100 Subject: [PATCH 03/10] Handle fluent_ui upgrade breaking change for brightness extension methods --- lib/init.dart | 2 +- lib/main.dart | 2 +- lib/presentation/devices/widget/devices_header.dart | 4 ++-- lib/presentation/extension/context_extension.dart | 2 +- lib/presentation/home/console_section/console_section.dart | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/init.dart b/lib/init.dart index 6fecbfe..dac6f1b 100644 --- a/lib/init.dart +++ b/lib/init.dart @@ -38,7 +38,7 @@ Future init() async { Future initTrayIcon([Brightness platformBrightness = Brightness.light]) async { // tray icon init try { - final iconName = platformBrightness.isDark ? 'icon_light' : 'icon_dark'; + final iconName = platformBrightness == Brightness.dark ? 'icon_light' : 'icon_dark'; await trayManager.setIcon(Platform.isWindows ? 'assets/tray/$iconName.ico' : 'assets/tray/$iconName.png'); if (Platform.isLinux) { // Don't show title on macOS (takes up more space in menu bar) diff --git a/lib/main.dart b/lib/main.dart index 46b3c6e..5fd5af4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -80,7 +80,7 @@ class _MyAppState extends State { title: 'scrcpy buddy 🤝', themeMode: brightness.data == null ? ThemeMode.system - : (brightness.data!.isDark ? ThemeMode.dark : ThemeMode.light), + : (brightness.data! == Brightness.dark ? ThemeMode.dark : ThemeMode.light), theme: FluentThemeData(accentColor: SystemTheme.accentColor.accent.toAccentColor()), darkTheme: FluentThemeData( brightness: Brightness.dark, diff --git a/lib/presentation/devices/widget/devices_header.dart b/lib/presentation/devices/widget/devices_header.dart index a03e41c..5a5ec04 100644 --- a/lib/presentation/devices/widget/devices_header.dart +++ b/lib/presentation/devices/widget/devices_header.dart @@ -42,10 +42,10 @@ class DevicesHeader extends AppStatelessWidget { } Color backgroundColor(Brightness brightness) { - return brightness.isLight ? Colors.grey[30] : Colors.grey[150]; + return brightness == Brightness.light ? Colors.grey[30] : Colors.grey[150]; } Color separatorColor(Brightness brightness) { - return brightness.isLight ? Colors.grey[40] : Colors.grey[160]; + return brightness == Brightness.light ? Colors.grey[40] : Colors.grey[160]; } } diff --git a/lib/presentation/extension/context_extension.dart b/lib/presentation/extension/context_extension.dart index 96d3689..c6165e4 100644 --- a/lib/presentation/extension/context_extension.dart +++ b/lib/presentation/extension/context_extension.dart @@ -10,7 +10,7 @@ extension ContextExtension on BuildContext { Size get windowSize => read(); - Color get errorColor => theme.brightness.isDark ? Colors.red.lighter : Colors.errorPrimaryColor; + Color get errorColor => theme.brightness == Brightness.dark ? Colors.red.lighter : Colors.errorPrimaryColor; Future openDialog(Widget child) => showDialog(context: this, barrierDismissible: true, builder: (_) => child); diff --git a/lib/presentation/home/console_section/console_section.dart b/lib/presentation/home/console_section/console_section.dart index 2d86909..e7242b8 100644 --- a/lib/presentation/home/console_section/console_section.dart +++ b/lib/presentation/home/console_section/console_section.dart @@ -80,7 +80,7 @@ class _ConsoleSectionState extends AppModuleState { curve: context.theme.animationCurve, child: Container( color: context.theme.resources.solidBackgroundFillColorTertiary.lerpWith( - context.theme.brightness.isDark ? Colors.white : Colors.black, + context.theme.brightness == Brightness.dark ? Colors.white : Colors.black, 0.1, ), child: Column( From 278f8ec344970fea3c8cbbda3b9044275c143561 Mon Sep 17 00:00:00 2001 From: Shripal Jain Date: Sat, 28 Feb 2026 17:30:32 +0100 Subject: [PATCH 04/10] Migration of home_screen (NavigationView) - According to breaking changes by fluent_ui upgrade v4.14.0 --- lib/presentation/home/home_screen.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/presentation/home/home_screen.dart b/lib/presentation/home/home_screen.dart index 9ff8d75..00b973c 100644 --- a/lib/presentation/home/home_screen.dart +++ b/lib/presentation/home/home_screen.dart @@ -206,11 +206,11 @@ class _HomeScreenState extends AppModuleState with WindowListener, T selected: selectedIndex, footerItems: footerItems, ), - appBar: NavigationAppBar( - automaticallyImplyLeading: false, + titleBar: TitleBar( + isBackButtonVisible: false, title: Text(context.translatedText(key: 'appName'), style: typography.bodyStrong), - actions: Padding( - padding: const EdgeInsets.only(top: 12, right: 16), + endHeader: Padding( + padding: const EdgeInsets.only(right: 0), child: Row( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.center, From 45ae8eb736983b6edcf03aaf20b9df506579b4f7 Mon Sep 17 00:00:00 2001 From: Shripal Jain Date: Sat, 28 Feb 2026 17:31:26 +0100 Subject: [PATCH 05/10] Cleanup unneded padding --- lib/presentation/home/home_screen.dart | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/lib/presentation/home/home_screen.dart b/lib/presentation/home/home_screen.dart index 00b973c..372924e 100644 --- a/lib/presentation/home/home_screen.dart +++ b/lib/presentation/home/home_screen.dart @@ -209,19 +209,16 @@ class _HomeScreenState extends AppModuleState with WindowListener, T titleBar: TitleBar( isBackButtonVisible: false, title: Text(context.translatedText(key: 'appName'), style: typography.bodyStrong), - endHeader: Padding( - padding: const EdgeInsets.only(right: 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - ProfileButton(), - const SizedBox(width: 8), - StartButton(), - const SizedBox(width: 8), - StopButton(), - ], - ), + endHeader: Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + ProfileButton(), + const SizedBox(width: 8), + StartButton(), + const SizedBox(width: 8), + StopButton(), + ], ), ), ); From fd6a4138b2dcfba10186cf47a297fe5fe8a8976b Mon Sep 17 00:00:00 2001 From: Shripal Jain Date: Tue, 10 Mar 2026 20:15:37 +0100 Subject: [PATCH 06/10] Upgrade `fluent_ui` to 4.15.0 --- pubspec.lock | 20 ++++++++++---------- pubspec.yaml | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index bd08728..c118d4a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -341,10 +341,10 @@ packages: dependency: "direct main" description: name: fluent_ui - sha256: "3fe3b66351e0c47b778e9778c4c1b9c9086515d0d61ea9be3010a9de23cdf28b" + sha256: "5d067d38d0b8b5750e096c61a96b9aca5883dea82ec429b35deeab3d76186711" url: "https://pub.dev" source: hosted - version: "4.14.0" + version: "4.15.0" flutter: dependency: "direct main" description: flutter @@ -561,10 +561,10 @@ packages: dependency: transitive description: name: matcher - sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6" + sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 url: "https://pub.dev" source: hosted - version: "0.12.18" + version: "0.12.19" material_color_utilities: dependency: transitive description: @@ -1102,26 +1102,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "54c516bbb7cee2754d327ad4fca637f78abfc3cbcc5ace83b3eda117e42cd71a" + sha256: "280d6d890011ca966ad08df7e8a4ddfab0fb3aa49f96ed6de56e3521347a9ae7" url: "https://pub.dev" source: hosted - version: "1.29.0" + version: "1.30.0" test_api: dependency: transitive description: name: test_api - sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636" + sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a" url: "https://pub.dev" source: hosted - version: "0.7.9" + version: "0.7.10" test_core: dependency: transitive description: name: test_core - sha256: "394f07d21f0f2255ec9e3989f21e54d3c7dc0e6e9dbce160e5a9c1a6be0e2943" + sha256: "0381bd1585d1a924763c308100f2138205252fb90c9d4eeaf28489ee65ccde51" url: "https://pub.dev" source: hosted - version: "0.6.15" + version: "0.6.16" text_scroll: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 026d9b3..64b2b24 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,7 +28,7 @@ dependencies: sdk: flutter # UI - fluent_ui: ^4.14.0 + fluent_ui: ^4.15.0 system_theme: ^3.1.2 go_router: ^17.0.0 flutter_acrylic: ^1.1.4 From 8c6049630a895eb98ab5f7a4ee1d0cc254698981 Mon Sep 17 00:00:00 2001 From: Shripal Jain Date: Tue, 10 Mar 2026 20:16:06 +0100 Subject: [PATCH 07/10] Move title bar controls to `captionControls`, and add back padding --- lib/presentation/home/home_screen.dart | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/presentation/home/home_screen.dart b/lib/presentation/home/home_screen.dart index 372924e..429d881 100644 --- a/lib/presentation/home/home_screen.dart +++ b/lib/presentation/home/home_screen.dart @@ -209,16 +209,19 @@ class _HomeScreenState extends AppModuleState with WindowListener, T titleBar: TitleBar( isBackButtonVisible: false, title: Text(context.translatedText(key: 'appName'), style: typography.bodyStrong), - endHeader: Row( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - ProfileButton(), - const SizedBox(width: 8), - StartButton(), - const SizedBox(width: 8), - StopButton(), - ], + captionControls: Padding( + padding: const EdgeInsets.only(right: 16), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + ProfileButton(), + const SizedBox(width: 8), + StartButton(), + const SizedBox(width: 8), + StopButton(), + ], + ), ), ), ); From 3304e237085332a99ccdd319f77664f053ee6c33 Mon Sep 17 00:00:00 2001 From: Shripal Jain Date: Sat, 28 Mar 2026 15:46:30 +0100 Subject: [PATCH 08/10] Upgrade fluent_ui --- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index c118d4a..fc0ef3b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -341,10 +341,10 @@ packages: dependency: "direct main" description: name: fluent_ui - sha256: "5d067d38d0b8b5750e096c61a96b9aca5883dea82ec429b35deeab3d76186711" + sha256: ccddccb8256f2d7c93838be8e01021cfe337070bb6b880d0f005c137d3e29224 url: "https://pub.dev" source: hosted - version: "4.15.0" + version: "4.15.1" flutter: dependency: "direct main" description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 64b2b24..0bf3334 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,7 +28,7 @@ dependencies: sdk: flutter # UI - fluent_ui: ^4.15.0 + fluent_ui: ^4.15.1 system_theme: ^3.1.2 go_router: ^17.0.0 flutter_acrylic: ^1.1.4 From fdd06df688388baafecb7713bc8188cf4fd3904e Mon Sep 17 00:00:00 2001 From: Shripal Jain Date: Sat, 28 Mar 2026 15:46:44 +0100 Subject: [PATCH 09/10] Hard-code titlebar height --- lib/presentation/home/home_screen.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/presentation/home/home_screen.dart b/lib/presentation/home/home_screen.dart index 429d881..713f690 100644 --- a/lib/presentation/home/home_screen.dart +++ b/lib/presentation/home/home_screen.dart @@ -207,6 +207,7 @@ class _HomeScreenState extends AppModuleState with WindowListener, T footerItems: footerItems, ), titleBar: TitleBar( + height: 56, isBackButtonVisible: false, title: Text(context.translatedText(key: 'appName'), style: typography.bodyStrong), captionControls: Padding( From 99fb050e61a48c399f72dfe47769c2e287436023 Mon Sep 17 00:00:00 2001 From: Shripal Jain Date: Sat, 28 Mar 2026 15:47:10 +0100 Subject: [PATCH 10/10] Increase minimum window size to accommodate actions without overflowing --- lib/init.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/init.dart b/lib/init.dart index dac6f1b..c151666 100644 --- a/lib/init.dart +++ b/lib/init.dart @@ -24,7 +24,7 @@ Future init() async { windowManager.setPreventClose(true); } windowManager.waitUntilReadyToShow().then((_) async { - await windowManager.setMinimumSize(const Size(500, 600)); + await windowManager.setMinimumSize(const Size(700, 700)); await windowManager.setTitle(_appName); await windowManager.show(); });