diff --git a/CHANGELOG.md b/CHANGELOG.md index e3ab2fbf1..b86f0c6c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,5 @@ -## [next] +## 4.10.0 -- feat: Add `ColorPicker` ([#1001](https://github.com/bdlukaa/fluent_ui/issues/1001) - fix: Add missing properties (`closeIconSize`, `closeButtonStyle`) in `debugFillProperties` and `InfoBarThemeData.merge` ([#1128](https://github.com/bdlukaa/fluent_ui/issues/1128) - feat: Add `TabView.reservedStripWidth`, which adds a minimum empty area between the tabs and the tab view footer ([#1106](https://github.com/bdlukaa/fluent_ui/issues/1106))] - fix: Correctly unfocus `NumberBox` when user taps outside ([#1135](https://github.com/bdlukaa/fluent_ui/issues/1135)) @@ -36,6 +35,10 @@ - feat: Add `DropDownButton.style` ([#1139](https://github.com/bdlukaa/fluent_ui/issues/1139)) - feat: Possibility to open date and time pickers programatically ([#1142](https://github.com/bdlukaa/fluent_ui/issues/1142)) - fix: `TimePicker` hour offset +- feat: Add `ColorPicker` ([#1152](https://github.com/bdlukaa/fluent_ui/pull/1152)) +- fix: `NumberBox` initial value formatting ([#1153](https://github.com/bdlukaa/fluent_ui/issues/1153)) +- fix: `NumberBox` incrementing/decrementing when not focused ([#1124](https://github.com/bdlukaa/fluent_ui/issues/1124)) +- fix: `NumberBox` text is correctly when there are no visible actions ([#1150](https://github.com/bdlukaa/fluent_ui/issues/1150)) ## 4.9.2 @@ -84,8 +87,8 @@ return ButtonState.forStates( states, disabled: Colors.grey, - hovered: Colors.white.withOpacity(0.8), - pressed: Colors.white.withOpacity(0.6), + hovered: Colors.white.withValues(alpha: 0.8), + pressed: Colors.white.withValues(alpha: 0.6), ); }), ), @@ -108,8 +111,8 @@ return WidgetStateExtension.forStates( states, disabled: Colors.grey, - hovered: Colors.white.withOpacity(0.8), - pressed: Colors.white.withOpacity(0.6), + hovered: Colors.white.withValues(alpha: 0.8), + pressed: Colors.white.withValues(alpha: 0.6), ); }), ), diff --git a/example/.gitignore b/example/.gitignore index 555e954c3..be061f40c 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -41,3 +41,8 @@ app.*.map.json /android/ ios/ + +# Flutter generated plugin files +linux/flutter/generated_* +macos/Flutter/GeneratedPluginRegistrant.* +windows/flutter/generated_* \ No newline at end of file diff --git a/example/lib/main.dart b/example/lib/main.dart index 7c918658c..b06d0a77f 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -557,7 +557,6 @@ class _MyHomePageState extends State with WindowListener { case NavigationIndicators.end: return const EndNavigationIndicator(); case NavigationIndicators.sticky: - default: return const StickyNavigationIndicator(); } }(), diff --git a/example/lib/screens/home.dart b/example/lib/screens/home.dart index 32b1f58d4..5bd4875e3 100644 --- a/example/lib/screens/home.dart +++ b/example/lib/screens/home.dart @@ -200,7 +200,7 @@ class _HomePageState extends State with PageMixin { shaderCallback: (rect) { return LinearGradient( colors: [ - Colors.white.withOpacity(0.8), + Colors.white.withValues(alpha: 0.8), ...Colors.accentColors, ], ).createShader(rect); diff --git a/example/lib/screens/popups/flyout.dart b/example/lib/screens/popups/flyout.dart index 0df448378..e065fe452 100644 --- a/example/lib/screens/popups/flyout.dart +++ b/example/lib/screens/popups/flyout.dart @@ -531,7 +531,7 @@ return GestureDetector( ); contextController.showFlyout( - barrierColor: Colors.black.withOpacity(0.1), + barrierColor: Colors.black.withValues(alpha: 0.1), position: position, builder: (context) { return FlyoutContent( @@ -591,7 +591,7 @@ return GestureDetector( void showFlyout(Offset position) { contextController.showFlyout( - barrierColor: Colors.black.withOpacity(0.1), + barrierColor: Colors.black.withValues(alpha: 0.1), position: position, barrierRecognizer: TapGestureRecognizer() ..onTap = () { diff --git a/example/lib/screens/surface/acrylic.dart b/example/lib/screens/surface/acrylic.dart index e72bcfd80..0d2acad82 100644 --- a/example/lib/screens/surface/acrylic.dart +++ b/example/lib/screens/surface/acrylic.dart @@ -40,7 +40,7 @@ class _AcrylicPageState extends State with PageMixin { @override Widget build(BuildContext context) { final menuColor = - FluentTheme.of(context).menuColor.withOpacity(kMenuColorOpacity); + FluentTheme.of(context).menuColor.withValues(alpha: kMenuColorOpacity); return ScaffoldPage.scrollable( header: const PageHeader(title: Text('Acrylic')), diff --git a/example/lib/screens/theming/reveal_focus.dart b/example/lib/screens/theming/reveal_focus.dart index da3d23913..268720817 100644 --- a/example/lib/screens/theming/reveal_focus.dart +++ b/example/lib/screens/theming/reveal_focus.dart @@ -45,7 +45,7 @@ class RevealFocusPage extends StatelessWidget with PageMixin { child: FocusTheme( data: FocusThemeData( borderRadius: BorderRadius.zero, - // glowColor: theme.accentColor.withOpacity(0.2), + // glowColor: theme.accentColor.withValues(alpha: 0.2), glowFactor: 4.0, primaryBorder: BorderSide( width: 2.0, diff --git a/example/lib/theme.dart b/example/lib/theme.dart index 87528c51e..3beb31422 100644 --- a/example/lib/theme.dart +++ b/example/lib/theme.dart @@ -49,7 +49,7 @@ class AppTheme extends ChangeNotifier { WindowEffect.solid, WindowEffect.acrylic, ].contains(effect) - ? FluentTheme.of(context).micaBackgroundColor.withOpacity(0.05) + ? FluentTheme.of(context).micaBackgroundColor.withValues(alpha: 0.05) : Colors.transparent, dark: FluentTheme.of(context).brightness.isDark, ); diff --git a/example/linux/flutter/generated_plugin_registrant.cc b/example/linux/flutter/generated_plugin_registrant.cc deleted file mode 100644 index fcf84ccb5..000000000 --- a/example/linux/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,31 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - -#include -#include -#include -#include -#include - -void fl_register_plugins(FlPluginRegistry* registry) { - g_autoptr(FlPluginRegistrar) flutter_acrylic_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterAcrylicPlugin"); - flutter_acrylic_plugin_register_with_registrar(flutter_acrylic_registrar); - g_autoptr(FlPluginRegistrar) screen_retriever_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin"); - screen_retriever_plugin_register_with_registrar(screen_retriever_registrar); - g_autoptr(FlPluginRegistrar) system_theme_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "SystemThemePlugin"); - system_theme_plugin_register_with_registrar(system_theme_registrar); - g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); - url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); - g_autoptr(FlPluginRegistrar) window_manager_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "WindowManagerPlugin"); - window_manager_plugin_register_with_registrar(window_manager_registrar); -} diff --git a/example/linux/flutter/generated_plugin_registrant.h b/example/linux/flutter/generated_plugin_registrant.h deleted file mode 100644 index e0f0a47bc..000000000 --- a/example/linux/flutter/generated_plugin_registrant.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GENERATED_PLUGIN_REGISTRANT_ -#define GENERATED_PLUGIN_REGISTRANT_ - -#include - -// Registers Flutter plugins. -void fl_register_plugins(FlPluginRegistry* registry); - -#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/example/linux/flutter/generated_plugins.cmake b/example/linux/flutter/generated_plugins.cmake deleted file mode 100644 index 6fcc32680..000000000 --- a/example/linux/flutter/generated_plugins.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST - flutter_acrylic - screen_retriever - system_theme - url_launcher_linux - window_manager -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/example/macos/Flutter/GeneratedPluginRegistrant.swift deleted file mode 100644 index a841078eb..000000000 --- a/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// Generated file. Do not edit. -// - -import FlutterMacOS -import Foundation - -import macos_window_utils -import path_provider_foundation -import screen_retriever -import system_theme -import url_launcher_macos -import window_manager - -func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - MacOSWindowUtilsPlugin.register(with: registry.registrar(forPlugin: "MacOSWindowUtilsPlugin")) - PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) - ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin")) - SystemThemePlugin.register(with: registry.registrar(forPlugin: "SystemThemePlugin")) - UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) - WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin")) -} diff --git a/example/pubspec.lock b/example/pubspec.lock deleted file mode 100644 index 740343b39..000000000 --- a/example/pubspec.lock +++ /dev/null @@ -1,703 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - ansicolor: - dependency: transitive - description: - name: ansicolor - sha256: "8bf17a8ff6ea17499e40a2d2542c2f481cd7615760c6d34065cb22bfd22e6880" - url: "https://pub.dev" - source: hosted - version: "2.0.2" - archive: - dependency: transitive - description: - name: archive - sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d - url: "https://pub.dev" - source: hosted - version: "3.6.1" - args: - dependency: transitive - description: - name: args - sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" - url: "https://pub.dev" - source: hosted - version: "2.5.0" - async: - dependency: transitive - description: - name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" - source: hosted - version: "2.11.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - characters: - dependency: transitive - description: - name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" - source: hosted - version: "1.3.0" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff - url: "https://pub.dev" - source: hosted - version: "2.0.3" - cli_util: - dependency: transitive - description: - name: cli_util - sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19 - url: "https://pub.dev" - source: hosted - version: "0.4.1" - clipboard: - dependency: "direct main" - description: - name: clipboard - sha256: "2ec38f0e59878008ceca0ab122e4bfde98847f88ef0f83331362ba4521f565a9" - url: "https://pub.dev" - source: hosted - version: "0.1.3" - clock: - dependency: transitive - description: - name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" - source: hosted - version: "1.1.1" - collection: - dependency: transitive - description: - name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a - url: "https://pub.dev" - source: hosted - version: "1.18.0" - crypto: - dependency: transitive - description: - name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab - url: "https://pub.dev" - source: hosted - version: "3.0.3" - csslib: - dependency: transitive - description: - name: csslib - sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" - url: "https://pub.dev" - source: hosted - version: "1.0.0" - email_validator: - dependency: "direct main" - description: - name: email_validator - sha256: e9a90f27ab2b915a27d7f9c2a7ddda5dd752d6942616ee83529b686fc086221b - url: "https://pub.dev" - source: hosted - version: "2.1.17" - fake_async: - dependency: transitive - description: - name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - ffi: - dependency: transitive - description: - name: ffi - sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - fluent_ui: - dependency: "direct main" - description: - path: ".." - relative: true - source: path - version: "4.9.2" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_acrylic: - dependency: "direct main" - description: - name: flutter_acrylic - sha256: b3996dbde5abf5823cc9ead4cf2e5267c3181f15585fe47ce4dc4472e7ec827a - url: "https://pub.dev" - source: hosted - version: "1.1.4" - flutter_launcher_icons: - dependency: "direct dev" - description: - name: flutter_launcher_icons - sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea" - url: "https://pub.dev" - source: hosted - version: "0.13.1" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 - url: "https://pub.dev" - source: hosted - version: "2.0.3" - flutter_localizations: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - flutter_markdown: - dependency: "direct main" - description: - name: flutter_markdown - sha256: "04c4722cc36ec5af38acc38ece70d22d3c2123c61305d555750a091517bbe504" - url: "https://pub.dev" - source: hosted - version: "0.6.23" - flutter_native_splash: - dependency: "direct dev" - description: - name: flutter_native_splash - sha256: edf39bcf4d74aca1eb2c1e43c3e445fd9f494013df7f0da752fefe72020eedc0 - url: "https://pub.dev" - source: hosted - version: "2.4.0" - flutter_syntax_view: - dependency: "direct main" - description: - path: "." - ref: HEAD - resolved-ref: "8b0fb4944fc36f691e40fdc944d08b7bc16973ea" - url: "https://github.com/YehudaKremer/flutter_syntax_view.git" - source: git - version: "4.0.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - go_router: - dependency: "direct main" - description: - name: go_router - sha256: e1a30a66d734f9e498b1b6522d6a75ded28242bad2359a9158df38a1c30bcf1f - url: "https://pub.dev" - source: hosted - version: "10.2.0" - google_fonts: - dependency: "direct main" - description: - name: google_fonts - sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82 - url: "https://pub.dev" - source: hosted - version: "6.2.1" - html: - dependency: transitive - description: - name: html - sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" - url: "https://pub.dev" - source: hosted - version: "0.15.4" - http: - dependency: "direct main" - description: - name: http - sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" - url: "https://pub.dev" - source: hosted - version: "1.2.1" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" - source: hosted - version: "4.0.2" - image: - dependency: transitive - description: - name: image - sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8" - url: "https://pub.dev" - source: hosted - version: "4.2.0" - intl: - dependency: "direct main" - description: - name: intl - sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf - url: "https://pub.dev" - source: hosted - version: "0.19.0" - json_annotation: - dependency: transitive - description: - name: json_annotation - sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" - url: "https://pub.dev" - source: hosted - version: "4.9.0" - leak_tracker: - dependency: transitive - description: - name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" - url: "https://pub.dev" - source: hosted - version: "10.0.5" - leak_tracker_flutter_testing: - dependency: transitive - description: - name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" - url: "https://pub.dev" - source: hosted - version: "3.0.5" - leak_tracker_testing: - dependency: transitive - description: - name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" - url: "https://pub.dev" - source: hosted - version: "3.0.1" - lints: - dependency: transitive - description: - name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - logging: - dependency: transitive - description: - name: logging - sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - macos_window_utils: - dependency: transitive - description: - name: macos_window_utils - sha256: "230be594d26f6dee92c5a1544f4242d25138a5bfb9f185b27f14de3949ef0be8" - url: "https://pub.dev" - source: hosted - version: "1.5.0" - markdown: - dependency: transitive - description: - name: markdown - sha256: ef2a1298144e3f985cc736b22e0ccdaf188b5b3970648f2d9dc13efd1d9df051 - url: "https://pub.dev" - source: hosted - version: "7.2.2" - matcher: - dependency: transitive - description: - name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb - url: "https://pub.dev" - source: hosted - version: "0.12.16+1" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec - url: "https://pub.dev" - source: hosted - version: "0.11.1" - math_expressions: - dependency: transitive - description: - name: math_expressions - sha256: db0b72d867491c4e53a1c773e2708d5d6e94bbe06be07080fc9f896766b9cd3d - url: "https://pub.dev" - source: hosted - version: "2.5.0" - meta: - dependency: transitive - description: - name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 - url: "https://pub.dev" - source: hosted - version: "1.15.0" - nested: - dependency: transitive - description: - name: nested - sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" - url: "https://pub.dev" - source: hosted - version: "1.0.0" - path: - dependency: transitive - description: - name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" - url: "https://pub.dev" - source: hosted - version: "1.9.0" - path_provider: - dependency: transitive - description: - name: path_provider - sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 - url: "https://pub.dev" - source: hosted - version: "2.1.3" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - sha256: bca87b0165ffd7cdb9cad8edd22d18d2201e886d9a9f19b4fb3452ea7df3a72a - url: "https://pub.dev" - source: hosted - version: "2.2.6" - path_provider_foundation: - dependency: transitive - description: - name: path_provider_foundation - sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 - url: "https://pub.dev" - source: hosted - version: "2.4.0" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 - url: "https://pub.dev" - source: hosted - version: "2.2.1" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" - url: "https://pub.dev" - source: hosted - version: "2.2.1" - petitparser: - dependency: transitive - description: - name: petitparser - sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 - url: "https://pub.dev" - source: hosted - version: "6.0.2" - platform: - dependency: transitive - description: - name: platform - sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" - url: "https://pub.dev" - source: hosted - version: "3.1.5" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" - url: "https://pub.dev" - source: hosted - version: "2.1.8" - provider: - dependency: "direct main" - description: - name: provider - sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c - url: "https://pub.dev" - source: hosted - version: "6.1.2" - recase: - dependency: transitive - description: - name: recase - sha256: e4eb4ec2dcdee52dcf99cb4ceabaffc631d7424ee55e56f280bc039737f89213 - url: "https://pub.dev" - source: hosted - version: "4.1.0" - screen_retriever: - dependency: transitive - description: - name: screen_retriever - sha256: "6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90" - url: "https://pub.dev" - source: hosted - version: "0.1.9" - scroll_pos: - dependency: transitive - description: - name: scroll_pos - sha256: cebf602b2dd939de6832bb902ffefb574608d1b84f420b82b381a4007d3c1e1b - url: "https://pub.dev" - source: hosted - version: "0.5.0" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" - url: "https://pub.dev" - source: hosted - version: "1.10.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" - url: "https://pub.dev" - source: hosted - version: "1.11.1" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 - url: "https://pub.dev" - source: hosted - version: "2.1.2" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - system_theme: - dependency: "direct main" - description: - name: system_theme - sha256: "1f208db140a3d1e1eac2034b54920d95699c1534df576ced44b3312c5de3975f" - url: "https://pub.dev" - source: hosted - version: "2.3.1" - system_theme_web: - dependency: transitive - description: - name: system_theme_web - sha256: "7566f5a928f6d28d7a60c97bea8a851d1c6bc9b86a4df2366230a97458489219" - url: "https://pub.dev" - source: hosted - version: "0.0.2" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - test_api: - dependency: transitive - description: - name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" - url: "https://pub.dev" - source: hosted - version: "0.7.2" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://pub.dev" - source: hosted - version: "1.3.2" - universal_io: - dependency: transitive - description: - name: universal_io - sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad" - url: "https://pub.dev" - source: hosted - version: "2.2.2" - url_launcher: - dependency: "direct main" - description: - name: url_launcher - sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3" - url: "https://pub.dev" - source: hosted - version: "6.3.0" - url_launcher_android: - dependency: transitive - description: - name: url_launcher_android - sha256: ceb2625f0c24ade6ef6778d1de0b2e44f2db71fded235eb52295247feba8c5cf - url: "https://pub.dev" - source: hosted - version: "6.3.3" - url_launcher_ios: - dependency: transitive - description: - name: url_launcher_ios - sha256: "7068716403343f6ba4969b4173cbf3b84fc768042124bc2c011e5d782b24fe89" - url: "https://pub.dev" - source: hosted - version: "6.3.0" - url_launcher_linux: - dependency: transitive - description: - name: url_launcher_linux - sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 - url: "https://pub.dev" - source: hosted - version: "3.1.1" - url_launcher_macos: - dependency: transitive - description: - name: url_launcher_macos - sha256: "9a1a42d5d2d95400c795b2914c36fdcb525870c752569438e4ebb09a2b5d90de" - url: "https://pub.dev" - source: hosted - version: "3.2.0" - url_launcher_platform_interface: - dependency: transitive - description: - name: url_launcher_platform_interface - sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" - url: "https://pub.dev" - source: hosted - version: "2.3.2" - url_launcher_web: - dependency: transitive - description: - name: url_launcher_web - sha256: "8d9e750d8c9338601e709cd0885f95825086bd8b642547f26bda435aade95d8a" - url: "https://pub.dev" - source: hosted - version: "2.3.1" - url_launcher_windows: - dependency: transitive - description: - name: url_launcher_windows - sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 - url: "https://pub.dev" - source: hosted - version: "3.1.1" - url_strategy: - dependency: "direct main" - description: - name: url_strategy - sha256: "42b68b42a9864c4d710401add17ad06e28f1c1d5500c93b98c431f6b0ea4ab87" - url: "https://pub.dev" - source: hosted - version: "0.2.0" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" - url: "https://pub.dev" - source: hosted - version: "14.2.5" - web: - dependency: transitive - description: - name: web - sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" - url: "https://pub.dev" - source: hosted - version: "0.5.1" - win32: - dependency: transitive - description: - name: win32 - sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4 - url: "https://pub.dev" - source: hosted - version: "5.5.1" - window_manager: - dependency: "direct main" - description: - name: window_manager - sha256: "8699323b30da4cdbe2aa2e7c9de567a6abd8a97d9a5c850a3c86dcd0b34bbfbf" - url: "https://pub.dev" - source: hosted - version: "0.3.9" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d - url: "https://pub.dev" - source: hosted - version: "1.0.4" - xml: - dependency: transitive - description: - name: xml - sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 - url: "https://pub.dev" - source: hosted - version: "6.5.0" - yaml: - dependency: transitive - description: - name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" - url: "https://pub.dev" - source: hosted - version: "3.1.2" -sdks: - dart: ">=3.4.0 <4.0.0" - flutter: ">=3.22.0" diff --git a/example/windows/flutter/generated_plugin_registrant.cc b/example/windows/flutter/generated_plugin_registrant.cc deleted file mode 100644 index 0ab16e958..000000000 --- a/example/windows/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,26 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - -#include -#include -#include -#include -#include - -void RegisterPlugins(flutter::PluginRegistry* registry) { - FlutterAcrylicPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("FlutterAcrylicPlugin")); - ScreenRetrieverPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("ScreenRetrieverPlugin")); - SystemThemePluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("SystemThemePlugin")); - UrlLauncherWindowsRegisterWithRegistrar( - registry->GetRegistrarForPlugin("UrlLauncherWindows")); - WindowManagerPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("WindowManagerPlugin")); -} diff --git a/example/windows/flutter/generated_plugin_registrant.h b/example/windows/flutter/generated_plugin_registrant.h deleted file mode 100644 index dc139d85a..000000000 --- a/example/windows/flutter/generated_plugin_registrant.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GENERATED_PLUGIN_REGISTRANT_ -#define GENERATED_PLUGIN_REGISTRANT_ - -#include - -// Registers Flutter plugins. -void RegisterPlugins(flutter::PluginRegistry* registry); - -#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake deleted file mode 100644 index 23433ff55..000000000 --- a/example/windows/flutter/generated_plugins.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST - flutter_acrylic - screen_retriever - system_theme - url_launcher_windows - window_manager -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) diff --git a/lib/fluent_ui.dart b/lib/fluent_ui.dart index 6dd39bed7..9efecb3af 100644 --- a/lib/fluent_ui.dart +++ b/lib/fluent_ui.dart @@ -92,7 +92,7 @@ export 'src/layout/dynamic_overflow.dart'; export 'src/layout/page.dart'; export 'src/navigation/route.dart'; export 'src/styles/acrylic.dart'; -export 'src/styles/color.dart' hide ColorConst; +export 'src/styles/color.dart'; export 'src/styles/color_resources.dart'; export 'src/styles/focus.dart'; export 'src/styles/mica.dart'; diff --git a/lib/l10n/extension/fluent_localizations_extension.dart b/lib/l10n/extension/fluent_localizations_extension.dart index f669e50c2..e65670ecd 100644 --- a/lib/l10n/extension/fluent_localizations_extension.dart +++ b/lib/l10n/extension/fluent_localizations_extension.dart @@ -60,7 +60,7 @@ extension FluentLocalizationsExtension on FluentLocalizations { } if (!colorKey.startsWith('color')) { - colorKey = 'color' + colorKey; + colorKey = 'color$colorKey'; } return switch (colorKey) { diff --git a/lib/src/app.dart b/lib/src/app.dart index 06d8a7c2d..598c27406 100644 --- a/lib/src/app.dart +++ b/lib/src/app.dart @@ -441,7 +441,7 @@ class _FluentAppState extends State { m.ThemeData( colorScheme: m.ColorScheme.fromSwatch( primarySwatch: m.MaterialColor( - themeData.accentColor.value, + themeData.accentColor.colorValue, themeData.accentColor.swatch.map((key, color) { colorValue -= 100; return MapEntry(colorValue, color); diff --git a/lib/src/controls/flyouts/content.dart b/lib/src/controls/flyouts/content.dart index 3baa081f8..7af9542ba 100644 --- a/lib/src/controls/flyouts/content.dart +++ b/lib/src/controls/flyouts/content.dart @@ -79,7 +79,8 @@ class FlyoutContent extends StatelessWidget { child: Container( constraints: constraints, decoration: ShapeDecoration( - color: color ?? theme.menuColor.withOpacity(kMenuColorOpacity), + color: + color ?? theme.menuColor.withValues(alpha: kMenuColorOpacity), shape: resolvedShape, ), padding: padding, diff --git a/lib/src/controls/flyouts/flyout.dart b/lib/src/controls/flyouts/flyout.dart index 7d2fd1985..4387a5105 100644 --- a/lib/src/controls/flyouts/flyout.dart +++ b/lib/src/controls/flyouts/flyout.dart @@ -82,7 +82,6 @@ enum FlyoutPlacementMode { case FlyoutPlacementMode.right: return isRtl ? FlyoutPlacementMode.left : this; case FlyoutPlacementMode.auto: - default: return this; } } @@ -102,7 +101,6 @@ enum FlyoutPlacementMode { case FlyoutPlacementMode.right: return EdgeInsets.only(left: additionalOffset); case FlyoutPlacementMode.auto: - default: return EdgeInsets.all(additionalOffset); } } @@ -140,9 +138,8 @@ enum FlyoutPlacementMode { maxHeight: rootSize.height._ensurePositive(), ); case FlyoutPlacementMode.auto: - default: - throw Exception( - 'Can not find the available space of auto mode', + throw UnsupportedError( + 'It is not possible to find the available space of an auto mode', ); } } @@ -426,7 +423,6 @@ class _FlyoutPositionDelegate extends SingleChildLayoutDelegate { horizontalY, ); case FlyoutPlacementMode.auto: - default: return targetOffset; } } @@ -639,7 +635,7 @@ class FlyoutController with ChangeNotifier { assert(menus.length == keys.length); final barrier = ColoredBox( - color: barrierColor ?? Colors.black.withOpacity(0.3), + color: barrierColor ?? Colors.black.withValues(alpha: 0.3), ); Widget box = Stack(children: [ diff --git a/lib/src/controls/form/auto_suggest_box.dart b/lib/src/controls/form/auto_suggest_box.dart index 2e48186ce..2c0df1a8d 100644 --- a/lib/src/controls/form/auto_suggest_box.dart +++ b/lib/src/controls/form/auto_suggest_box.dart @@ -899,13 +899,13 @@ class _AutoSuggestBoxOverlayState extends State<_AutoSuggestBoxOverlay> { color: theme.resources.cardBackgroundFillColorDefault, shadows: [ BoxShadow( - color: Colors.black.withOpacity(0.05), + color: Colors.black.withValues(alpha: 0.05), offset: const Offset(-1, 1), blurRadius: 2.0, spreadRadius: 3.0, ), BoxShadow( - color: Colors.black.withOpacity(0.05), + color: Colors.black.withValues(alpha: 0.05), offset: const Offset(1, 1), blurRadius: 2.0, spreadRadius: 3.0, diff --git a/lib/src/controls/form/color_picker/color_picker.dart b/lib/src/controls/form/color_picker/color_picker.dart index 58b8a424d..49cbcef70 100644 --- a/lib/src/controls/form/color_picker/color_picker.dart +++ b/lib/src/controls/form/color_picker/color_picker.dart @@ -673,52 +673,48 @@ class _ColorSliders extends StatelessWidget { height: isVertical ? _ColorPickerSizes.spectrum.size : _ColorPickerSizes.slider.size, - child: ClipRRect( - borderRadius: BorderRadius.circular(6), - child: Stack( - children: [ - Container( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: isVertical - ? Alignment.bottomCenter - : Alignment.centerLeft, - end: isVertical ? Alignment.topCenter : Alignment.centerRight, - colors: [ - const Color(0xFF000000), - HSVColor.fromAHSV(1, math.max(0, colorState.hue), - math.max(0, colorState.saturation), 1.0) - .toColor(), - ], - ), - ), - ), - SliderTheme( - data: SliderThemeData( - activeColor: WidgetStatePropertyAll(thumbColor), - trackHeight: const WidgetStatePropertyAll(0.0), - ), - child: Slider( - label: valueText, - vertical: isVertical, - value: colorState.value, - min: minValue / 100, - max: maxValue / 100, - onChanged: (value) => - onColorChanged(colorState.copyWith(value: value)), - ), + child: Stack(clipBehavior: Clip.none, children: [ + Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: isVertical ? Alignment.bottomCenter : Alignment.centerLeft, + end: isVertical ? Alignment.topCenter : Alignment.centerRight, + colors: [ + const Color(0xFF000000), + HSVColor.fromAHSV(1, math.max(0, colorState.hue), + math.max(0, colorState.saturation), 1.0) + .toColor(), + ], ), - ], + borderRadius: BorderRadius.circular(6), + ), ), - ), + SliderTheme( + data: SliderThemeData( + activeColor: WidgetStatePropertyAll(thumbColor), + trackHeight: const WidgetStatePropertyAll(0.0), + thumbRadius: const WidgetStatePropertyAll(8.0), + thumbBallInnerFactor: const WidgetStatePropertyAll(0.6), + ), + child: Slider( + label: valueText, + vertical: isVertical, + value: colorState.value, + min: minValue / 100, + max: maxValue / 100, + onChanged: (value) => + onColorChanged(colorState.copyWith(value: value)), + ), + ), + ]), ); } /// Builds the alpha slider for the color picker. Widget _buildAlphaSlider(FluentThemeData theme, bool isVertical) { final thumbColor = theme.resources.focusStrokeColorOuter; - final opacityText = - '${(colorState.alpha * 100).round()}% opacity'; // TODO: Localize + // TODO: Localize + final opacityText = '${(colorState.alpha * 100).round()}% opacity'; return SizedBox( width: isVertical @@ -729,44 +725,44 @@ class _ColorSliders extends StatelessWidget { height: isVertical ? _ColorPickerSizes.spectrum.size : _ColorPickerSizes.slider.size, - child: ClipRRect( - borderRadius: BorderRadius.circular(6), - child: Stack( - children: [ - Positioned.fill( - child: CustomPaint(painter: CheckerboardPainter(theme: theme)), - ), - Container( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: isVertical - ? Alignment.bottomCenter - : Alignment.centerLeft, - end: isVertical ? Alignment.topCenter : Alignment.centerRight, - colors: [ - colorState.toColor().withAlpha(0), - colorState.toColor().withAlpha(255), - ], - ), + child: Stack( + clipBehavior: Clip.none, + children: [ + Positioned.fill( + child: CustomPaint(painter: CheckerboardPainter(theme: theme)), + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + gradient: LinearGradient( + begin: + isVertical ? Alignment.bottomCenter : Alignment.centerLeft, + end: isVertical ? Alignment.topCenter : Alignment.centerRight, + colors: [ + colorState.toColor().withAlpha(0), + colorState.toColor().withAlpha(255), + ], ), ), - SliderTheme( - data: SliderThemeData( - activeColor: WidgetStatePropertyAll(thumbColor), - trackHeight: const WidgetStatePropertyAll(0.0), - ), - child: Slider( - label: opacityText, - vertical: isVertical, - value: colorState.alpha, - min: 0, - max: 1, - onChanged: (value) => - onColorChanged(colorState.copyWith(alpha: value)), - ), + ), + SliderTheme( + data: SliderThemeData( + activeColor: WidgetStatePropertyAll(thumbColor), + trackHeight: const WidgetStatePropertyAll(0.0), + thumbRadius: const WidgetStatePropertyAll(8.0), + thumbBallInnerFactor: const WidgetStatePropertyAll(0.6), ), - ], - ), + child: Slider( + label: opacityText, + vertical: isVertical, + value: colorState.alpha, + min: 0, + max: 1, + onChanged: (value) => + onColorChanged(colorState.copyWith(alpha: value)), + ), + ), + ], ), ); } @@ -1074,7 +1070,6 @@ class _ColorInputs extends StatelessWidget { required double min, required double max, }) { - // TODO: initial format issue of NumberBox not being applied. return Column(children: [ SizedBox(height: _ColorPickerSpacing.small.size), Row( diff --git a/lib/src/controls/form/color_picker/color_spectrum.dart b/lib/src/controls/form/color_picker/color_spectrum.dart index 60671c123..a4f7a1943 100644 --- a/lib/src/controls/form/color_picker/color_spectrum.dart +++ b/lib/src/controls/form/color_picker/color_spectrum.dart @@ -434,8 +434,8 @@ class _RingSpectrumPainter extends CustomPainter { final textPainter = TextPainter( text: textSpan, textAlign: TextAlign.left, - textDirection: dart.TextDirection - .ltr, // TODO: Update if color names support RTL languages in the future. + // TODO: Update if color names support RTL languages in the future. + textDirection: dart.TextDirection.ltr, )..layout(); final labelWidth = textPainter.width + labelPadding.horizontal; @@ -457,7 +457,7 @@ class _RingSpectrumPainter extends CustomPainter { // Draw background with shadow final shadow = BoxShadow( - color: Colors.black.withOpacity(0.1), + color: Colors.black.withValues(alpha: 0.1), blurRadius: 4, offset: const Offset(0, 2), ); @@ -654,8 +654,8 @@ class _BoxSpectrumPainter extends CustomPainter { final textPainter = TextPainter( text: textSpan, textAlign: TextAlign.left, - textDirection: dart.TextDirection - .ltr, // TODO: Update if color names support RTL languages in the future. + // TODO: Update if color names support RTL languages in the future. + textDirection: dart.TextDirection.ltr, )..layout(); final labelWidth = textPainter.width + labelPadding.horizontal; @@ -677,7 +677,7 @@ class _BoxSpectrumPainter extends CustomPainter { // Draw background with shadow final shadow = BoxShadow( - color: Colors.black.withOpacity(0.1), + color: Colors.black.withValues(alpha: 0.1), blurRadius: 4, offset: const Offset(0, 2), ); diff --git a/lib/src/controls/form/color_picker/color_state.dart b/lib/src/controls/form/color_picker/color_state.dart index e488f63b2..8f57b0b0f 100644 --- a/lib/src/controls/form/color_picker/color_state.dart +++ b/lib/src/controls/form/color_picker/color_state.dart @@ -74,10 +74,10 @@ class ColorState extends ChangeNotifier { /// Creates a [ColorState] from a [Color]. static ColorState fromColor(Color color) { - final r = color.red.toDouble() / 255; - final g = color.green.toDouble() / 255; - final b = color.blue.toDouble() / 255; - final a = color.alpha.toDouble() / 255; + final r = color.r.toDouble(); + final g = color.g.toDouble(); + final b = color.b.toDouble(); + final a = color.a.toDouble(); final hsv = rgbToHsv(RgbComponents(r, g, b)); return ColorState(r, g, b, a, hsv.h, hsv.s, hsv.v); @@ -151,10 +151,10 @@ class ColorState extends ChangeNotifier { final colorText = text.length == 6 ? 'FF$text' : text; final color = Color(int.parse(colorText, radix: 16)); - _red = color.red / 255; - _green = color.green / 255; - _blue = color.blue / 255; - _alpha = color.alpha / 255; + _red = color.r; + _green = color.g; + _blue = color.b; + _alpha = color.a; final hsv = rgbToHsv(RgbComponents(_red, _green, _blue)); _hue = hsv.h; @@ -220,7 +220,7 @@ class ColorState extends ChangeNotifier { /// If [includeAlpha] is true, the alpha channel will be included in the string. String toHexString(bool includeAlpha) { final colorValue = - toColor().value.toRadixString(16).padLeft(8, '0').toUpperCase(); + toColor().colorValue.toRadixString(16).padLeft(8, '0').toUpperCase(); return includeAlpha ? '#$colorValue' : '#${colorValue.substring(2)}'; } @@ -342,18 +342,18 @@ class ColorState extends ChangeNotifier { /// Converts Color to HSV. static HsvComponents colorToHsv(Color color) { - final red = color.red / 255; - final green = color.green / 255; - final blue = color.blue / 255; + final red = color.r; + final green = color.g; + final blue = color.b; return rgbToHsv(RgbComponents(red, green, blue)); } /// Converts Color to HSL. static HslComponents colorToHsl(Color color) { - final red = color.red / 255; - final green = color.green / 255; - final blue = color.blue / 255; + final red = color.r; + final green = color.g; + final blue = color.b; return rgbToHsl(RgbComponents(red, green, blue)); } @@ -500,9 +500,8 @@ class ColorState extends ChangeNotifier { /// Get distance between two colors considering both RGB and HSL spaces static double colorDistance(Color from, Color to) { // Normalize RGB values to range 0-1 - final fromRgb = - RgbComponents(from.red / 255, from.green / 255, from.blue / 255); - final toRgb = RgbComponents(to.red / 255, to.green / 255, to.blue / 255); + final fromRgb = RgbComponents(from.r, from.g, from.b); + final toRgb = RgbComponents(to.r, to.g, to.b); // Convert RGB to HSL final fromHsl = rgbToHsl(fromRgb); @@ -556,9 +555,9 @@ class ColorState extends ChangeNotifier { /// /// Returns a value between 0 (darkest) and 1 (brightest). static double relativeLuminance(Color color) { - final r = _standardToLinear(color.red / 255); - final g = _standardToLinear(color.green / 255); - final b = _standardToLinear(color.blue / 255); + final r = _standardToLinear(color.r); + final g = _standardToLinear(color.g); + final b = _standardToLinear(color.b); return (r * 0.2126 + g * 0.7152 + b * 0.0722); } diff --git a/lib/src/controls/form/combo_box.dart b/lib/src/controls/form/combo_box.dart index 5a918d830..dd98a78b9 100644 --- a/lib/src/controls/form/combo_box.dart +++ b/lib/src/controls/form/combo_box.dart @@ -338,7 +338,7 @@ class _ComboBoxMenuState extends State<_ComboBoxMenu> { borderRadius: BorderRadius.all(kComboBoxRadius), ), child: ColoredBox( - color: theme.menuColor.withOpacity(kMenuColorOpacity), + color: theme.menuColor.withValues(alpha: kMenuColorOpacity), child: Semantics( scopesRoute: true, namesRoute: true, diff --git a/lib/src/controls/form/number_box.dart b/lib/src/controls/form/number_box.dart index 478289da2..bf27c1ed2 100644 --- a/lib/src/controls/form/number_box.dart +++ b/lib/src/controls/form/number_box.dart @@ -404,7 +404,8 @@ class NumberBoxState extends State> { return _formatter.format(value); }; } - controller.text = widget.value?.toString() ?? ''; + + if (widget.value != null) _updateController(widget.value!); } @override @@ -510,14 +511,23 @@ class NumberBoxState extends State> { _entry = null; } + final _clearButtonKey = GlobalKey(); + final _incrementButtonKey = GlobalKey(); + final _decrementButtonKey = GlobalKey(); + @override Widget build(BuildContext context) { assert(debugCheckHasFluentTheme(context)); assert(debugCheckHasOverlay(context)); final textFieldSuffix = [ + // Ensure all modes have a suffix. This is necessary to ensure the text + // is aligned correctly when there are no suffix actions. + // See https://github.com/bdlukaa/fluent_ui/issues/1150 + const SizedBox(), if (widget.clearButton && _hasPrimaryFocus) IconButton( + key: _clearButtonKey, icon: const Icon(FluentIcons.clear), onPressed: _clearValue, ), @@ -527,13 +537,16 @@ class NumberBoxState extends State> { case SpinButtonPlacementMode.inline: textFieldSuffix.addAll([ IconButton( + key: _incrementButtonKey, icon: const Icon(FluentIcons.chevron_up), onPressed: widget.onChanged != null ? incrementSmall : null, ), IconButton( + key: _decrementButtonKey, icon: const Icon(FluentIcons.chevron_down), onPressed: widget.onChanged != null ? decrementSmall : null, ), + const SizedBox(), ]); break; case SpinButtonPlacementMode.compact: @@ -563,8 +576,13 @@ class NumberBoxState extends State> { controller: controller, keyboardType: widget.keyboardType, enabled: widget.onChanged != null, - suffix: - textFieldSuffix.isNotEmpty ? Row(children: textFieldSuffix) : null, + suffix: textFieldSuffix.isNotEmpty + ? Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.end, + children: textFieldSuffix, + ) + : null, style: widget.style, textAlign: widget.textAlign ?? TextAlign.start, keyboardAppearance: widget.keyboardAppearance, diff --git a/lib/src/controls/form/pickers/pickers.dart b/lib/src/controls/form/pickers/pickers.dart index 9f901c48a..f9fc57107 100644 --- a/lib/src/controls/form/pickers/pickers.dart +++ b/lib/src/controls/form/pickers/pickers.dart @@ -38,7 +38,7 @@ Decoration kPickerDecorationBuilder( color: ButtonThemeData.buttonColor(context, states), border: Border.all( width: 0.15, - color: theme.inactiveColor.withOpacity(0.2), + color: theme.inactiveColor.withValues(alpha: 0.2), ), ); } diff --git a/lib/src/controls/form/selection_controls.dart b/lib/src/controls/form/selection_controls.dart index 31e8c6570..095e6c659 100644 --- a/lib/src/controls/form/selection_controls.dart +++ b/lib/src/controls/form/selection_controls.dart @@ -392,7 +392,7 @@ class _FluentTextSelectionToolbar extends StatelessWidget { elevation: 4.0, shape: RoundedRectangleBorder(borderRadius: radius), child: Container( - color: theme.menuColor.withOpacity(kMenuColorOpacity), + color: theme.menuColor.withValues(alpha: kMenuColorOpacity), padding: const EdgeInsetsDirectional.only( top: 5.0, start: 5.0, diff --git a/lib/src/controls/inputs/buttons/outlined_button.dart b/lib/src/controls/inputs/buttons/outlined_button.dart index 1b622c7e7..4cbf9a981 100644 --- a/lib/src/controls/inputs/buttons/outlined_button.dart +++ b/lib/src/controls/inputs/buttons/outlined_button.dart @@ -36,11 +36,12 @@ class OutlinedButton extends BaseButton { foregroundColor: WidgetStatePropertyAll(theme.inactiveColor), backgroundColor: WidgetStateProperty.resolveWith((states) { if (states.isDisabled) { - return theme.resources.controlFillColorDisabled.withOpacity(0.30); + return theme.resources.controlFillColorDisabled + .withValues(alpha: 0.30); } else if (states.isPressed) { - return theme.inactiveColor.withOpacity(0.25); + return theme.inactiveColor.withValues(alpha: 0.25); } else if (states.isHovered) { - return theme.inactiveColor.withOpacity(0.10); + return theme.inactiveColor.withValues(alpha: 0.10); } else { return Colors.transparent; } diff --git a/lib/src/controls/inputs/checkbox.dart b/lib/src/controls/inputs/checkbox.dart index 79f7c66d1..987423dd6 100644 --- a/lib/src/controls/inputs/checkbox.dart +++ b/lib/src/controls/inputs/checkbox.dart @@ -454,7 +454,7 @@ class _Icon extends StatelessWidget { final iconOpacity = iconTheme.opacity ?? 1.0; var iconColor = color ?? iconTheme.color!; if (iconOpacity != 1.0) { - iconColor = iconColor.withOpacity(iconColor.opacity * iconOpacity); + iconColor = iconColor.withValues(alpha: iconColor.a * iconOpacity); } Widget iconWidget = RichText( diff --git a/lib/src/controls/inputs/slider.dart b/lib/src/controls/inputs/slider.dart index a974936b0..4939cf4bc 100644 --- a/lib/src/controls/inputs/slider.dart +++ b/lib/src/controls/inputs/slider.dart @@ -289,11 +289,11 @@ class _SliderState extends State { duration: theme.fastAnimationDuration, tween: Tween( begin: 1.0, - end: states.isPressed || _sliding - ? 0.45 - : states.isHovered - ? 0.66 - : 0.5, + end: style.thumbBallInnerFactor?.resolve({ + ...states, + if (_sliding) WidgetState.pressed, + }) ?? + 0.5, ), builder: (context, innerFactor, child) => m.SliderTheme( data: m.SliderThemeData( @@ -521,7 +521,7 @@ class SliderThumbShape extends m.SliderComponentShape { center - const Offset(0, 6), center + const Offset(0, 6), Paint() - ..color = color.withOpacity(activationAnimation.value) + ..color = color.withValues(alpha: activationAnimation.value) ..style = PaintingStyle.stroke ..strokeJoin = StrokeJoin.round ..strokeCap = StrokeCap.round @@ -630,6 +630,7 @@ class SliderThemeData with Diagnosticable { final Color? labelForegroundColor; final bool? useThumbBall; + final WidgetStateProperty? thumbBallInnerFactor; final WidgetStateProperty? activeColor; final WidgetStateProperty? inactiveColor; @@ -646,6 +647,7 @@ class SliderThemeData with Diagnosticable { this.labelBackgroundColor, this.labelForegroundColor, this.useThumbBall, + this.thumbBallInnerFactor, }); factory SliderThemeData.standard(FluentThemeData theme) { @@ -665,6 +667,13 @@ class SliderThemeData with Diagnosticable { }), margin: EdgeInsets.zero, useThumbBall: true, + thumbBallInnerFactor: WidgetStateProperty.resolveWith((states) { + return states.isPressed + ? 0.45 + : states.isHovered + ? 0.66 + : 0.5; + }), labelBackgroundColor: theme.resources.controlSolidFillColorDefault, labelForegroundColor: theme.resources.textFillColorPrimary, trackHeight: const WidgetStatePropertyAll(3.75), @@ -691,6 +700,8 @@ class SliderThemeData with Diagnosticable { labelForegroundColor: Color.lerp(a.labelForegroundColor, b.labelForegroundColor, t), useThumbBall: t < 0.5 ? a.useThumbBall : b.useThumbBall, + thumbBallInnerFactor: WidgetStateProperty.lerp( + a.thumbBallInnerFactor, b.thumbBallInnerFactor, t, lerpDouble), ); } @@ -705,6 +716,7 @@ class SliderThemeData with Diagnosticable { labelForegroundColor: style?.labelForegroundColor ?? labelForegroundColor, useThumbBall: style?.useThumbBall ?? useThumbBall, trackHeight: style?.trackHeight ?? trackHeight, + thumbBallInnerFactor: style?.thumbBallInnerFactor ?? thumbBallInnerFactor, ); } @@ -717,7 +729,9 @@ class SliderThemeData with Diagnosticable { ..add(DiagnosticsProperty('activeColor', activeColor)) ..add(DiagnosticsProperty('inactiveColor', inactiveColor)) ..add(ColorProperty('labelBackgroundColor', labelBackgroundColor)) - ..add(ColorProperty('labelForegroundColor', labelForegroundColor)); + ..add(ColorProperty('labelForegroundColor', labelForegroundColor)) + ..add(DiagnosticsProperty('useThumbBall', useThumbBall)) + ..add(DiagnosticsProperty('thumbBallInnerFactor', thumbBallInnerFactor)); } } @@ -904,7 +918,7 @@ class _RectangularSliderValueIndicatorPathPainter { final trianglePath = Path()..close(); final fillPaint = Paint() - ..color = backgroundPaintColor.withOpacity(opacity); + ..color = backgroundPaintColor.withValues(alpha: opacity); final upperRRect = RRect.fromRectAndRadius( upperRect, const Radius.circular(_upperRectRadius), @@ -935,7 +949,7 @@ class _RectangularSliderValueIndicatorPathPainter { if (vertical) canvas.rotate((ltr ? 1 : -1) * math.pi / 2); if (strokePaintColor != null) { final strokePaint = Paint() - ..color = strokePaintColor.withOpacity(opacity) + ..color = strokePaintColor.withValues(alpha: opacity) ..strokeWidth = 1.0 ..style = PaintingStyle.stroke; canvas.drawPath(trianglePath, strokePaint); @@ -956,7 +970,7 @@ class _RectangularSliderValueIndicatorPathPainter { ..text = TextSpan( text: span.text, style: span.style - ?.copyWith(color: span.style?.color?.withOpacity(opacity)), + ?.copyWith(color: span.style?.color?.withValues(alpha: opacity)), ) ..paint(canvas, labelOffset); diff --git a/lib/src/controls/navigation/navigation_view/pane_items.dart b/lib/src/controls/navigation/navigation_view/pane_items.dart index a7d294507..b048733bb 100644 --- a/lib/src/controls/navigation/navigation_view/pane_items.dart +++ b/lib/src/controls/navigation/navigation_view/pane_items.dart @@ -289,7 +289,7 @@ class PaneItem extends NavigationPaneItem { } return KeyedSubtree(key: itemKey, child: result); default: - throw '$mode is not a supported type'; + throw UnsupportedError('$mode is not a supported type'); } } @@ -906,7 +906,7 @@ class __PaneItemExpanderState extends State<_PaneItemExpander> controller: flyoutController, child: item, ); - default: + case PaneDisplayMode.auto: return item; } } diff --git a/lib/src/controls/surfaces/dialog.dart b/lib/src/controls/surfaces/dialog.dart index 6b09a1f8c..97858453e 100644 --- a/lib/src/controls/surfaces/dialog.dart +++ b/lib/src/controls/surfaces/dialog.dart @@ -414,7 +414,7 @@ class ContentDialogThemeData { // boxShadow: kElevationToShadow[1], ), actionsPadding: const EdgeInsets.all(20), - barrierColor: Colors.grey[200].withOpacity(0.8), + barrierColor: Colors.grey[200].withValues(alpha: 0.8), titleStyle: theme.typography.title, bodyStyle: theme.typography.body, ); diff --git a/lib/src/controls/surfaces/tooltip.dart b/lib/src/controls/surfaces/tooltip.dart index 7b22bbc87..bbfeee4e3 100644 --- a/lib/src/controls/surfaces/tooltip.dart +++ b/lib/src/controls/surfaces/tooltip.dart @@ -717,7 +717,7 @@ class TooltipThemeData with Diagnosticable { final radius = BorderRadius.circular(4.0); final shadow = [ BoxShadow( - color: Colors.black.withOpacity(0.2), + color: Colors.black.withValues(alpha: 0.2), offset: const Offset(1, 1), blurRadius: 10.0, ), diff --git a/lib/src/styles/acrylic.dart b/lib/src/styles/acrylic.dart index fe60349c0..e89091efa 100644 --- a/lib/src/styles/acrylic.dart +++ b/lib/src/styles/acrylic.dart @@ -154,12 +154,12 @@ class _AcrylicState extends State { shadows: [ /* The shadows were taken from the official FluentUI design kit on Figma */ BoxShadow( - color: shadowColor.withOpacity(0.13), + color: shadowColor.withValues(alpha: 0.13), blurRadius: 0.9 * widget.elevation, offset: Offset(0, 0.4 * widget.elevation), ), BoxShadow( - color: shadowColor.withOpacity(0.11), + color: shadowColor.withValues(alpha: 0.11), blurRadius: 0.225 * widget.elevation, offset: Offset(0, 0.085 * widget.elevation), ), @@ -382,7 +382,7 @@ class _AcrylicGuts extends StatelessWidget { clipper: ShapeBorderClipper(shape: properties.shape), child: CustomPaint( painter: _AcrylicPainter( - tintColor: disabled ? tint.withOpacity(1.0) : tint, + tintColor: disabled ? tint.withValues(alpha: 1.0) : tint, luminosityColor: AcrylicHelper.getLuminosityColor( tint, disabled ? 1.0 : properties.luminosityAlpha, @@ -422,9 +422,9 @@ class _AcrylicGuts extends StatelessWidget { } class _AcrylicPainter extends CustomPainter { - static final Color red = const Color(0xFFFF0000).withOpacity(0.12); - static final Color blue = const Color(0xFF00FF00).withOpacity(0.12); - static final Color green = const Color(0xFF0000FF).withOpacity(0.12); + static final Color red = const Color(0xFFFF0000).withValues(alpha: 0.12); + static final Color blue = const Color(0xFF00FF00).withValues(alpha: 0.12); + static final Color green = const Color(0xFF0000FF).withValues(alpha: 0.12); final Color luminosityColor; final Color tintColor; @@ -443,7 +443,7 @@ class _AcrylicPainter extends CustomPainter { ..drawColor(green, BlendMode.saturation) ..drawColor( tintColor, - tintColor.opacity == 1 ? BlendMode.srcIn : BlendMode.color, + tintColor.a == 1 ? BlendMode.srcIn : BlendMode.color, ); } @@ -459,18 +459,13 @@ class AcrylicHelper { static Color getEffectiveTintColor(Color color, double opacity) { // Update tintColor's alpha with the combined opacity value // If LuminosityOpacity was specified, we don't intervene into users parameters - return color.withOpacity(opacity); + return color.withValues(alpha: opacity); } static Color getLuminosityColor(Color tintColor, double? luminosityOpacity) { // If luminosity opacity is specified, just use the values as is if (luminosityOpacity != null) { - return Color.fromRGBO( - tintColor.red, - tintColor.green, - tintColor.blue, - luminosityOpacity.clamp(0.0, 1.0), - ); + return tintColor.withValues(alpha: luminosityOpacity.clamp(0.0, 1.0)); } else { // To create the Luminosity blend input color without luminosity opacity, // we're taking the TintColor input, converting to HSV, and clamping the V between these values @@ -492,15 +487,11 @@ class AcrylicHelper { const luminosityOpacityRangeMax = maxLuminosityOpacity - minLuminosityOpacity; var mappedTintOpacity = - ((tintColor.alpha / 255.0) * luminosityOpacityRangeMax) + + ((tintColor.a / 255.0) * luminosityOpacityRangeMax) + minLuminosityOpacity; - // Finally, combine the luminosity opacity and the HsvV-clamped tint color - return Color.fromRGBO( - rgbLuminosityColor.red, - rgbLuminosityColor.green, - rgbLuminosityColor.blue, - math.min(mappedTintOpacity, 1.0), + return rgbLuminosityColor.withValues( + alpha: math.min(mappedTintOpacity, 1.0), ); } } diff --git a/lib/src/styles/color.dart b/lib/src/styles/color.dart index 63282e6fc..26ead81ab 100644 --- a/lib/src/styles/color.dart +++ b/lib/src/styles/color.dart @@ -1,3 +1,5 @@ +import 'package:flutter/foundation.dart'; + import 'package:fluent_ui/fluent_ui.dart'; /// A set of predefined colors used by Fluent UI widgets. @@ -190,8 +192,8 @@ class ShadedColor extends ColorSwatch { const ShadedColor(super.primary, super.swatch); @override - Color operator [](int index) { - return super[index]!; + Color operator [](int key) { + return super[key]!; } } @@ -221,25 +223,28 @@ class AccentColor extends ColorSwatch { /// Creates a new accent color. AccentColor(this.primary, this.swatch) - : super(swatch[primary]!.value, swatch); + : super( + swatch[primary]!.colorValue, + swatch, + ); /// Creates a new accent color based on a swatch AccentColor.swatch(this.swatch) : primary = 'normal', - super(swatch['normal']!.value, swatch); + super(swatch['normal']!.colorValue, swatch); /// The darkest shade of the color. - Color get darkest => swatch['darkest'] ?? darker.withOpacity(0.7); + Color get darkest => swatch['darkest'] ?? darker.withValues(alpha: 0.7); /// The darker shade of the color. /// /// Usually used for shadows - Color get darker => swatch['darker'] ?? dark.withOpacity(0.8); + Color get darker => swatch['darker'] ?? dark.withValues(alpha: 0.8); /// The dark shade of the color. /// /// Usually used for the mouse press effect; - Color get dark => swatch['dark'] ?? normal.withOpacity(0.9); + Color get dark => swatch['dark'] ?? normal.withValues(alpha: 0.9); /// The default shade of the color. Color get normal => swatch['normal']!; @@ -247,15 +252,15 @@ class AccentColor extends ColorSwatch { /// The light shade of the color. /// /// Usually used for the mouse hover effect - Color get light => swatch['light'] ?? normal.withOpacity(0.9); + Color get light => swatch['light'] ?? normal.withValues(alpha: 0.9); /// The lighter shade of the color. /// /// Usually used for shadows - Color get lighter => swatch['lighter'] ?? light.withOpacity(0.8); + Color get lighter => swatch['lighter'] ?? light.withValues(alpha: 0.8); /// The lighest shade of the color - Color get lightest => swatch['lightest'] ?? lighter.withOpacity(0.7); + Color get lightest => swatch['lightest'] ?? lighter.withValues(alpha: 0.7); /// Lerp between two accent colors. static AccentColor lerp(AccentColor a, AccentColor b, double t) { @@ -294,7 +299,7 @@ class AccentColor extends ColorSwatch { /// See also: /// * Color secondaryBrushFor(Brightness brightness) { - return defaultBrushFor(brightness).withOpacity(0.9); + return defaultBrushFor(brightness).withValues(alpha: 0.9); } /// Get the tertiary brush for this accent color based on the brightness. @@ -302,8 +307,20 @@ class AccentColor extends ColorSwatch { /// See also: /// * Color tertiaryBrushFor(Brightness brightness) { - return defaultBrushFor(brightness).withOpacity(0.8); + return defaultBrushFor(brightness).withValues(alpha: 0.8); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) return true; + + return other is AccentColor && + other.primary == primary && + mapEquals(other.swatch, swatch); } + + @override + int get hashCode => primary.hashCode ^ swatch.hashCode; } /// Extension methods to help dealing with colors. @@ -360,10 +377,15 @@ extension ColorExtension on Color { Color lerpWith(Color color, double t) { return Color.lerp(this, color, t)!; } -} -class ColorConst extends Color { - const ColorConst.withOpacity(int value, double opacity) - : super(((((opacity * 0xff ~/ 1) & 0xff) << 24) | (0x00ffffff & value)) & - 0xFFFFFFFF); + int get colorValue { + return _floatToInt8(a) << 24 | + _floatToInt8(r) << 16 | + _floatToInt8(g) << 8 | + _floatToInt8(b) << 0; + } + + static int _floatToInt8(double x) { + return (x * 255.0).round() & 0xff; + } } diff --git a/lib/src/styles/focus.dart b/lib/src/styles/focus.dart index 4f7660cca..a6c7df915 100644 --- a/lib/src/styles/focus.dart +++ b/lib/src/styles/focus.dart @@ -162,7 +162,7 @@ class FocusThemeData with Diagnosticable { secondaryBorder: BorderSide( color: theme.resources.focusStrokeColorInner, ), - glowColor: theme.accentColor.withOpacity(0.15), + glowColor: theme.accentColor.withValues(alpha: 0.15), glowFactor: 0.0, renderOutside: true, ); diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index 69e1daeeb..000000000 --- a/pubspec.lock +++ /dev/null @@ -1,394 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" - url: "https://pub.dev" - source: hosted - version: "67.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" - url: "https://pub.dev" - source: hosted - version: "6.4.1" - archive: - dependency: transitive - description: - name: archive - sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d - url: "https://pub.dev" - source: hosted - version: "3.6.1" - args: - dependency: transitive - description: - name: args - sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" - url: "https://pub.dev" - source: hosted - version: "2.5.0" - async: - dependency: transitive - description: - name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" - source: hosted - version: "2.11.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - characters: - dependency: transitive - description: - name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" - source: hosted - version: "1.3.0" - clock: - dependency: transitive - description: - name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" - source: hosted - version: "1.1.1" - collection: - dependency: transitive - description: - name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a - url: "https://pub.dev" - source: hosted - version: "1.18.0" - convert: - dependency: transitive - description: - name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" - url: "https://pub.dev" - source: hosted - version: "3.1.1" - crypto: - dependency: transitive - description: - name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab - url: "https://pub.dev" - source: hosted - version: "3.0.3" - dart_style: - dependency: transitive - description: - name: dart_style - sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" - url: "https://pub.dev" - source: hosted - version: "2.3.6" - fake_async: - dependency: transitive - description: - name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - file: - dependency: transitive - description: - name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" - url: "https://pub.dev" - source: hosted - version: "7.0.0" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c" - url: "https://pub.dev" - source: hosted - version: "4.0.0" - flutter_localizations: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - glob: - dependency: transitive - description: - name: glob - sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - http: - dependency: transitive - description: - name: http - sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" - url: "https://pub.dev" - source: hosted - version: "1.2.1" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" - source: hosted - version: "4.0.2" - intl: - dependency: "direct main" - description: - name: intl - sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf - url: "https://pub.dev" - source: hosted - version: "0.19.0" - intl_utils: - dependency: "direct dev" - description: - name: intl_utils - sha256: c2b1f5c72c25512cbeef5ab015c008fc50fe7e04813ba5541c25272300484bf4 - url: "https://pub.dev" - source: hosted - version: "2.8.7" - leak_tracker: - dependency: transitive - description: - name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" - url: "https://pub.dev" - source: hosted - version: "10.0.5" - leak_tracker_flutter_testing: - dependency: transitive - description: - name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" - url: "https://pub.dev" - source: hosted - version: "3.0.5" - leak_tracker_testing: - dependency: transitive - description: - name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" - url: "https://pub.dev" - source: hosted - version: "3.0.1" - lints: - dependency: transitive - description: - name: lints - sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235" - url: "https://pub.dev" - source: hosted - version: "4.0.0" - matcher: - dependency: transitive - description: - name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb - url: "https://pub.dev" - source: hosted - version: "0.12.16+1" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec - url: "https://pub.dev" - source: hosted - version: "0.11.1" - math_expressions: - dependency: "direct main" - description: - name: math_expressions - sha256: db0b72d867491c4e53a1c773e2708d5d6e94bbe06be07080fc9f896766b9cd3d - url: "https://pub.dev" - source: hosted - version: "2.5.0" - meta: - dependency: transitive - description: - name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 - url: "https://pub.dev" - source: hosted - version: "1.15.0" - package_config: - dependency: transitive - description: - name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - path: - dependency: transitive - description: - name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" - url: "https://pub.dev" - source: hosted - version: "1.9.0" - petitparser: - dependency: transitive - description: - name: petitparser - sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 - url: "https://pub.dev" - source: hosted - version: "6.0.2" - pub_semver: - dependency: transitive - description: - name: pub_semver - sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - recase: - dependency: "direct main" - description: - name: recase - sha256: e4eb4ec2dcdee52dcf99cb4ceabaffc631d7424ee55e56f280bc039737f89213 - url: "https://pub.dev" - source: hosted - version: "4.1.0" - scroll_pos: - dependency: "direct main" - description: - name: scroll_pos - sha256: cebf602b2dd939de6832bb902ffefb574608d1b84f420b82b381a4007d3c1e1b - url: "https://pub.dev" - source: hosted - version: "0.5.0" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" - url: "https://pub.dev" - source: hosted - version: "1.10.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" - url: "https://pub.dev" - source: hosted - version: "1.11.1" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 - url: "https://pub.dev" - source: hosted - version: "2.1.2" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - test_api: - dependency: transitive - description: - name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" - url: "https://pub.dev" - source: hosted - version: "0.7.2" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://pub.dev" - source: hosted - version: "1.3.2" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" - url: "https://pub.dev" - source: hosted - version: "14.2.5" - watcher: - dependency: transitive - description: - name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - web: - dependency: transitive - description: - name: web - sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" - url: "https://pub.dev" - source: hosted - version: "0.5.1" - yaml: - dependency: transitive - description: - name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" - url: "https://pub.dev" - source: hosted - version: "3.1.2" -sdks: - dart: ">=3.3.0 <4.0.0" - flutter: ">=3.19.0" diff --git a/pubspec.yaml b/pubspec.yaml index 2114f71b8..2cc952d2d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,13 +1,13 @@ name: fluent_ui description: Implements Windows UI in Flutter. Based on the official documentation -version: 4.9.2 +version: 4.10.0 homepage: https://bdlukaa.github.io/fluent_ui/#/ repository: https://github.com/bdlukaa/fluent_ui issue_tracker: https://github.com/bdlukaa/fluent_ui/issues environment: sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.19.0" + flutter: ">=3.27.0" topics: - windows diff --git a/test/color_picker_test.dart b/test/color_picker_test.dart index d2e0399ad..17d861933 100644 --- a/test/color_picker_test.dart +++ b/test/color_picker_test.dart @@ -8,7 +8,7 @@ void main() { testWidgets( 'ColorPicker - verifies initial state and preview visibility', (WidgetTester tester) async { - Color currentColor = Colors.blue; + Color currentColor = Colors.blue.normal; await tester.pumpWidget( StatefulBuilder( @@ -32,7 +32,7 @@ void main() { // Check if initial color is preserved final initialColorState = currentColor; - expect(initialColorState, Colors.blue); + expect(initialColorState, Colors.blue.normal); // Find color preview container final preview = find.descendant( @@ -47,8 +47,11 @@ void main() { await tester.pump(const Duration(seconds: 1)); // Verify the color value matches initial blue color - expect(currentColor.value, equals(Colors.blue.value), - reason: 'Color value should match initial blue color'); + expect( + currentColor, + equals(Colors.blue.normal), + reason: 'Color value should match initial blue color', + ); }, ); diff --git a/test/color_test.dart b/test/color_test.dart index 440b93de7..4c04276e2 100644 --- a/test/color_test.dart +++ b/test/color_test.dart @@ -14,19 +14,19 @@ const primaryKeys = [ void main() { test('All accent colors are opaque and equal their primary color', () { for (final color in Colors.accentColors) { - expect(color.value, color.normal.value); + expect(color.r, color.normal.r); + expect(color.g, color.normal.g); + expect(color.b, color.normal.b); for (final key in primaryKeys) { - expect(color[key]!.alpha, 0xFF); + expect(color[key]!.a, 1.0); } } - - expect(Colors.blue.value, Colors.blue.normal.value); }); test('All grey variants are opaque', () { var currentValue = 210; for (var i = currentValue; i > 0; i -= 10) { - expect(Colors.grey[i].alpha, 0xFF); + expect(Colors.grey[i].a, 1.0); } }); }