diff --git a/.github/workflows/dart_code_metrics.yaml b/.github/workflows/dart_code_metrics.yaml deleted file mode 100644 index 03336a6a..00000000 --- a/.github/workflows/dart_code_metrics.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Dart Code Metrics -on: [pull_request, workflow_dispatch] - -jobs: - dart-code-metrics: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Install Flutter - uses: subosito/flutter-action@v2 - with: - channel: stable - - - name: Set Up DCM - run: flutter pub get - - uses: CQLabs/setup-dcm@v1.0.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - - - run: dcm analyze --ci-key="${{ secrets.DCM_CI_KEY }}" --email="${{ secrets.DCM_EMAIL }}" lib diff --git a/.github/workflows/flutter_analysis.yml b/.github/workflows/flutter_analysis.yml index fba04aa4..5612680f 100644 --- a/.github/workflows/flutter_analysis.yml +++ b/.github/workflows/flutter_analysis.yml @@ -34,3 +34,11 @@ jobs: - name: Analyze code run: flutter analyze --fatal-infos . + + - name: Install DCM + uses: CQLabs/setup-dcm@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Run DCM + run: dcm analyze . diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ca49845..770f8875 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [2.2.0+1] +* Support Dart 3.9.2 +* Update dependencies +* Address lints + ## [2.2.0] ### ✨ New ✨ * Add support for Swift package manager. diff --git a/README.md b/README.md index e2666826..5e8271f6 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Guides, codelabs, and other documentation can be found at https://macosui.dev ### Flutter channel `macos_ui` is developed against Flutter's `stable` channel. To ensure a smooth development experience with `macos_ui`, you should build your application on Flutter's `stable` channel. -### Platform Compatibility +### 🖥️ Platform Compatibility pub.dev shows that `macos_ui` only supports macOS. This is because `macos_ui` calls some native code, and therefore specifies macOS as a plugin platform in the `pubspec.yaml` file. @@ -33,6 +33,12 @@ The features of `macos_ui` that will _not_ work on platforms other than macOS du * The `MacosColors.controlAccentColor()` function * The `MacosColorWell` widget +### Flutter Compatibility + +Starting with version `2.2.0+1`, `macos_ui` requires Flutter `3.35.0` or higher due to a depredation in Flutter 3.35.0. If you use an older Flutter version along with `macos_ui` version `2.2.0+1`, only version `2.2.0` will be available to you when you run `flutter pub get`. + +**We therefore strongly recommend that you use Flutter `3.35.0` or higher if developing with `macos_ui` so that you gain access to the latest features and fixes.** + ### Popups & window resizing Since at this time Flutter does not allow UI elements to overflow the bounds of the window, popups are constrained to diff --git a/example/lib/pages/buttons_page.dart b/example/lib/pages/buttons_page.dart index 26952d90..ccedfd48 100644 --- a/example/lib/pages/buttons_page.dart +++ b/example/lib/pages/buttons_page.dart @@ -115,7 +115,7 @@ class _ButtonsPageState extends State { startSize: 200, windowBreakpoint: 700, resizableSide: ResizableSide.left, - builder: (_, __) { + builder: (_, _) { return const Center( child: Text('Resizable Pane'), ); @@ -159,7 +159,7 @@ class _ButtonsPageState extends State { startSize: 200, windowBreakpoint: 700, resizableSide: ResizableSide.left, - builder: (_, __) { + builder: (_, _) { return const Center( child: Text('Resizable Pane'), ); @@ -203,7 +203,7 @@ class _ButtonsPageState extends State { startSize: 200, windowBreakpoint: 700, resizableSide: ResizableSide.left, - builder: (_, __) { + builder: (_, _) { return const Center( child: Text('Resizable Pane'), ); @@ -293,7 +293,7 @@ class _ButtonsPageState extends State { startSize: 200, windowBreakpoint: 700, resizableSide: ResizableSide.left, - builder: (_, __) { + builder: (_, _) { return const Center( child: Text('Resizable Pane'), ); @@ -338,7 +338,7 @@ class _ButtonsPageState extends State { startSize: 200, windowBreakpoint: 700, resizableSide: ResizableSide.left, - builder: (_, __) { + builder: (_, _) { return const Center( child: Text('Resizable Pane'), ); @@ -383,7 +383,7 @@ class _ButtonsPageState extends State { startSize: 200, windowBreakpoint: 700, resizableSide: ResizableSide.left, - builder: (_, __) { + builder: (_, _) { return const Center( child: Text('Resizable Pane'), ); diff --git a/example/lib/pages/resizable_pane_page.dart b/example/lib/pages/resizable_pane_page.dart index 78ed3320..9f2f77bc 100644 --- a/example/lib/pages/resizable_pane_page.dart +++ b/example/lib/pages/resizable_pane_page.dart @@ -42,14 +42,14 @@ class _ResizablePanePageState extends State { startSize: 200, windowBreakpoint: 700, resizableSide: ResizableSide.right, - builder: (_, __) { + builder: (_, _) { return const Center( child: Text('Left Resizable Pane'), ); }, ), ContentArea( - builder: (_, __) { + builder: (_, _) { return Column( children: [ const Flexible( @@ -62,7 +62,7 @@ class _ResizablePanePageState extends State { minSize: 50, startSize: 200, //windowBreakpoint: 600, - builder: (_, __) { + builder: (_, _) { return const Center( child: Text('Bottom Resizable Pane'), ); diff --git a/example/lib/pages/sliver_toolbar_page.dart b/example/lib/pages/sliver_toolbar_page.dart index be2e680c..5099ddc7 100644 --- a/example/lib/pages/sliver_toolbar_page.dart +++ b/example/lib/pages/sliver_toolbar_page.dart @@ -1,5 +1,4 @@ import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; import 'package:macos_ui/macos_ui.dart'; class SliverToolbarPage extends StatefulWidget { diff --git a/example/macos/Podfile.lock b/example/macos/Podfile.lock index 9a6ee8c2..b40e00de 100644 --- a/example/macos/Podfile.lock +++ b/example/macos/Podfile.lock @@ -2,27 +2,46 @@ PODS: - appkit_ui_element_colors (1.0.0): - FlutterMacOS - FlutterMacOS (1.0.0) + - macos_ui (0.1.0): + - FlutterMacOS - macos_window_utils (1.0.0): - FlutterMacOS + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS + - url_launcher_macos (0.0.1): + - FlutterMacOS DEPENDENCIES: - appkit_ui_element_colors (from `Flutter/ephemeral/.symlinks/plugins/appkit_ui_element_colors/macos`) - FlutterMacOS (from `Flutter/ephemeral`) + - macos_ui (from `Flutter/ephemeral/.symlinks/plugins/macos_ui/macos`) - macos_window_utils (from `Flutter/ephemeral/.symlinks/plugins/macos_window_utils/macos`) + - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) + - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) EXTERNAL SOURCES: appkit_ui_element_colors: :path: Flutter/ephemeral/.symlinks/plugins/appkit_ui_element_colors/macos FlutterMacOS: :path: Flutter/ephemeral + macos_ui: + :path: Flutter/ephemeral/.symlinks/plugins/macos_ui/macos macos_window_utils: :path: Flutter/ephemeral/.symlinks/plugins/macos_window_utils/macos + path_provider_foundation: + :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin + url_launcher_macos: + :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos SPEC CHECKSUMS: - appkit_ui_element_colors: 711e7a2aa027790964e6fd90c78a666efe631432 - FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 - macos_window_utils: 3bca8603c2a1cf2257351dfe6bbccc9accf739fd + appkit_ui_element_colors: bb247a2d02b8313cc47e1b83be48d996034c4001 + FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1 + macos_ui: 50a2048b7ef82bde42570e2775f50907537a0eeb + macos_window_utils: 721df4da91cb4bde7b2b7b6ae93cdead4851118f + path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 + url_launcher_macos: c82c93949963e55b228a30115bd219499a6fe404 PODFILE CHECKSUM: ff0a9a3ce75ee73f200ca7e2f47745698c917ef9 -COCOAPODS: 1.16.2 +COCOAPODS: 1.15.2 diff --git a/example/pubspec.lock b/example/pubspec.lock index 2d691556..bba2fc75 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -98,10 +98,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c" + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "6.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -116,18 +116,18 @@ packages: dependency: "direct main" description: name: google_fonts - sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82 + sha256: "517b20870220c48752eafa0ba1a797a092fb22df0d89535fd9991e86ee2cdd9c" url: "https://pub.dev" source: hosted - version: "6.2.1" + version: "6.3.2" gradient_borders: dependency: transitive description: name: gradient_borders - sha256: b1cd969552c83f458ff755aa68e13a0327d09f06c3f42f471b423b01427f21f8 + sha256: "492bc88ab8d88a4117a7f00e525a669b65f19973bea7ee677f9d9de7603bf037" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.2" http: dependency: transitive description: @@ -148,49 +148,49 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.9" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: name: lints - sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235" + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "6.0.0" macos_ui: dependency: "direct main" description: path: ".." relative: true source: path - version: "2.2.0" + version: "2.2.0+1" macos_window_utils: dependency: transitive description: name: macos_window_utils - sha256: "4e683da162825018580c7341d9e926a6fa39a869a3504c2e5471618553bd55cd" + sha256: d4df3501fd32ac0d2d7590cb6a8e4758337d061c8fa0db816fdd636be63a8438 url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.9.0" matcher: dependency: transitive description: @@ -352,10 +352,10 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.6" typed_data: dependency: transitive description: @@ -368,10 +368,10 @@ packages: dependency: "direct main" description: name: url_launcher - sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603" + sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8 url: "https://pub.dev" source: hosted - version: "6.3.1" + version: "6.3.2" url_launcher_android: dependency: transitive description: @@ -432,10 +432,10 @@ packages: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: @@ -461,5 +461,5 @@ packages: source: hosted version: "1.1.0" sdks: - dart: ">=3.7.0 <4.0.0" - flutter: ">=3.27.0" + dart: ">=3.9.2 <4.0.0" + flutter: ">=3.29.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 22e45eb8..d57e3877 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: '>=3.5.3 <4.0.0' + sdk: '>=3.9.2 <4.0.0' dependencies: flutter: @@ -13,14 +13,14 @@ dependencies: cupertino_icons: ^1.0.8 macos_ui: path: .. - provider: ^6.1.2 - google_fonts: ^6.2.1 - url_launcher: ^6.3.0 + provider: ^6.1.5 + google_fonts: ^6.3.2 + url_launcher: ^6.3.2 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^4.0.0 + flutter_lints: ^6.0.0 flutter: assets: diff --git a/lib/macos_ui.dart b/lib/macos_ui.dart index 94ea1e8c..e0a5adcc 100644 --- a/lib/macos_ui.dart +++ b/lib/macos_ui.dart @@ -12,7 +12,7 @@ /// * [yaru_icons](https://pub.dev/packages/yaru_icons) /// * [yaru_colors](https://pub.dev/packages/yaru_colors) -library macos_ui; +library; export 'package:macos_window_utils/macos/ns_window_delegate.dart'; export 'package:macos_window_utils/macos_window_utils.dart'; diff --git a/lib/src/buttons/checkbox.dart b/lib/src/buttons/checkbox.dart index f0f3a9b8..9c966447 100644 --- a/lib/src/buttons/checkbox.dart +++ b/lib/src/buttons/checkbox.dart @@ -58,19 +58,19 @@ class MacosCheckbox extends StatelessWidget { @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); - properties.add(StringProperty( - 'state', - isMixed - ? 'mixed' - : value! - ? 'checked' - : 'unchecked', - )); - properties.add(FlagProperty( - 'disabled', - value: isDisabled, - ifFalse: 'enabled', - )); + properties.add( + StringProperty( + 'state', + isMixed + ? 'mixed' + : value! + ? 'checked' + : 'unchecked', + ), + ); + properties.add( + FlagProperty('disabled', value: isDisabled, ifFalse: 'enabled'), + ); properties.add(DoubleProperty('size', size)); properties.add(ColorProperty('activeColor', activeColor)); properties.add(ColorProperty('disabledColor', disabledColor)); @@ -84,49 +84,50 @@ class MacosCheckbox extends StatelessWidget { final MacosThemeData theme = MacosTheme.of(context); bool isLight = !theme.brightness.isDark; return StreamBuilder( - stream: AccentColorListener.instance.onChanged, - builder: (context, _) { - return StreamBuilder( - stream: WindowMainStateListener.instance.onChanged, - builder: (context, _) { - final accentColor = - MacosTheme.of(context).accentColor ?? AccentColor.blue; - final isMainWindow = - MacosTheme.of(context).isMainWindow ?? true; - - return GestureDetector( - onTap: () { - if (value == null || value == false) { - onChanged?.call(true); - } else { - onChanged?.call(false); - } - }, - child: Semantics( - // value == true because [value] can be null - checked: value == true, - label: semanticLabel, - child: Container( - height: size, - width: size, - alignment: Alignment.center, - child: SizedBox.expand( - child: _DecoratedContainer( - accentColor: accentColor, - isDisabled: isDisabled, - isLight: isLight, - isMainWindow: isMainWindow, - value: value, - isMixed: isMixed, - theme: theme, - size: size, - ), - ), + stream: AccentColorListener.instance.onChanged, + builder: (context, _) { + return StreamBuilder( + stream: WindowMainStateListener.instance.onChanged, + builder: (context, _) { + final accentColor = + MacosTheme.of(context).accentColor ?? AccentColor.blue; + final isMainWindow = MacosTheme.of(context).isMainWindow ?? true; + + return GestureDetector( + onTap: () { + if (value == null || value == false) { + onChanged?.call(true); + } else { + onChanged?.call(false); + } + }, + child: Semantics( + // value == true because [value] can be null + checked: value == true, + label: semanticLabel, + child: Container( + height: size, + width: size, + alignment: Alignment.center, + child: SizedBox.expand( + child: _DecoratedContainer( + accentColor: accentColor, + isDisabled: isDisabled, + isLight: isLight, + isMainWindow: isMainWindow, + value: value, + isMixed: isMixed, + theme: theme, + size: size, ), ), - ); - }); - }); + ), + ), + ); + }, + ); + }, + ); } } @@ -197,15 +198,12 @@ class _CheckboxStack extends StatelessWidget { final icon = value == false ? null : isMixed - ? CupertinoIcons.minus - : CupertinoIcons.checkmark; + ? CupertinoIcons.minus + : CupertinoIcons.checkmark; return Stack( children: [ - _InnerDropShadow( - value: value, - isEnabled: !isDisabled, - ), + _InnerDropShadow(value: value, isEnabled: !isDisabled), Center( child: Icon( icon, @@ -217,22 +215,22 @@ class _CheckboxStack extends StatelessWidget { ); } - _getCheckmarkColor() { + Color _getCheckmarkColor() { if (isDisabled) { return const MacosColor.fromRGBO(172, 172, 172, 1.0); } if (theme.brightness.isDark) { return theme.accentColor == AccentColor.graphite && isMainWindow - ? CupertinoColors.black - : CupertinoColors.white; + ? MacosColors.black + : MacosColors.white; } if (theme.isMainWindow == false) { - return CupertinoColors.black; + return MacosColors.black; } - return CupertinoColors.white; + return MacosColors.white; } } @@ -245,10 +243,7 @@ class _InnerDropShadow extends StatelessWidget { final bool isEnabled; /// Creates a widget that paints an inner drop shadow for a checkbox. - const _InnerDropShadow({ - required this.value, - required this.isEnabled, - }); + const _InnerDropShadow({required this.value, required this.isEnabled}); @override Widget build(BuildContext context) { @@ -310,10 +305,7 @@ class _BoxDecorationBuilder { MacosColor.fromRGBO(74, 74, 74, 1.0 * isEnabledFactor), MacosColor.fromRGBO(101, 101, 101, 1.0 * isEnabledFactor), ] - : const [ - MacosColors.transparent, - MacosColors.transparent, - ]; + : const [MacosColors.transparent, MacosColors.transparent]; } if (isDarkModeEnabled) { @@ -437,7 +429,7 @@ class _BoxDecorationBuilder { spreadRadius: -0.5, offset: Offset(0.0, 0.5), blurStyle: BlurStyle.outer, - ) + ), ] : const []; diff --git a/lib/src/icon/macos_icon.dart b/lib/src/icon/macos_icon.dart index 5c41628e..26beecaa 100644 --- a/lib/src/icon/macos_icon.dart +++ b/lib/src/icon/macos_icon.dart @@ -1,6 +1,7 @@ import 'package:flutter/foundation.dart'; import 'package:macos_ui/macos_ui.dart'; import 'package:macos_ui/src/library.dart'; +import 'package:vector_math/vector_math_64.dart'; /// An Icon widget that respects a macOS icon theme. class MacosIcon extends StatelessWidget { @@ -85,10 +86,7 @@ class MacosIcon extends StatelessWidget { if (icon == null) { return Semantics( label: semanticLabel, - child: SizedBox( - width: iconSize, - height: iconSize, - ), + child: SizedBox(width: iconSize, height: iconSize), ); } @@ -117,7 +115,8 @@ class MacosIcon extends StatelessWidget { switch (textDirection) { case TextDirection.rtl: iconWidget = Transform( - transform: Matrix4.identity()..scale(-1.0, 1.0, 1.0), + transform: Matrix4.identity() + ..scaleByVector3(Vector3(-1.0, 1.0, 1.0)), alignment: Alignment.center, transformHitTests: false, child: iconWidget, @@ -134,9 +133,7 @@ class MacosIcon extends StatelessWidget { child: SizedBox( width: iconSize, height: iconSize, - child: Center( - child: iconWidget, - ), + child: Center(child: iconWidget), ), ), ); @@ -145,12 +142,9 @@ class MacosIcon extends StatelessWidget { @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); - properties.add(IconDataProperty( - 'icon', - icon, - ifNull: '', - showName: false, - )); + properties.add( + IconDataProperty('icon', icon, ifNull: '', showName: false), + ); properties.add(DoubleProperty('size', size, defaultValue: null)); properties.add(ColorProperty('color', color, defaultValue: null)); } diff --git a/lib/src/layout/tab_view/tab_view.dart b/lib/src/layout/tab_view/tab_view.dart index cca58d2a..fd0348d0 100644 --- a/lib/src/layout/tab_view/tab_view.dart +++ b/lib/src/layout/tab_view/tab_view.dart @@ -26,6 +26,7 @@ enum MacosTabPosition { /// {@template macosTabView} /// A multipage interface that displays one page at a time. /// +// ignore: unintended_html_in_doc_comment /// /// /// A tab view contains a row of navigational items, [tabs], that move the diff --git a/pubspec.lock b/pubspec.lock index 69534238..bc4e7b02 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: "direct main" description: name: appkit_ui_element_colors - sha256: c3e50f900aae314d339de489535736238627071457c4a4a2dbbb1545b4f04f22 + sha256: b88a7c35d440fa3ac75222d0e2b7e3259200e531e33b5d2468e358119f3481dc url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.1" async: dependency: transitive description: @@ -53,10 +53,10 @@ packages: dependency: "direct main" description: name: equatable - sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 + sha256: "567c64b3cb4cf82397aac55f4f0cbd3ca20d77c6c03bedbc4ceaddc08904aef7" url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "2.0.7" fake_async: dependency: transitive description: @@ -74,10 +74,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c" + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "6.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -87,50 +87,50 @@ packages: dependency: "direct main" description: name: gradient_borders - sha256: b1cd969552c83f458ff755aa68e13a0327d09f06c3f42f471b423b01427f21f8 + sha256: "492bc88ab8d88a4117a7f00e525a669b65f19973bea7ee677f9d9de7603bf037" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.2" leak_tracker: dependency: transitive description: name: leak_tracker - sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.9" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: name: lints - sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235" + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "6.0.0" macos_window_utils: dependency: "direct main" description: name: macos_window_utils - sha256: "230be594d26f6dee92c5a1544f4242d25138a5bfb9f185b27f14de3949ef0be8" + sha256: d4df3501fd32ac0d2d7590cb6a8e4758337d061c8fa0db816fdd636be63a8438 url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "1.9.0" matcher: dependency: transitive description: @@ -228,18 +228,18 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.6" vector_math: - dependency: transitive + dependency: "direct main" description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: @@ -249,5 +249,5 @@ packages: source: hosted version: "15.0.0" sdks: - dart: ">=3.7.0-0 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + dart: ">=3.9.2 <4.0.0" + flutter: ">=3.35.0" diff --git a/pubspec.yaml b/pubspec.yaml index 2c9badb9..9d6605f3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,25 +1,26 @@ name: macos_ui description: Flutter widgets and themes implementing the current macOS design language. -version: 2.2.0 +version: 2.2.0+1 homepage: "https://macosui.dev" repository: "https://github.com/GroovinChip/macos_ui" environment: - sdk: ">=3.5.3 <4.0.0" - flutter: ">=1.20.0" + sdk: ">=3.9.2 <4.0.0" + flutter: ">=3.35.0" dependencies: flutter: sdk: flutter - macos_window_utils: ^1.5.0 - gradient_borders: ^1.0.1 - appkit_ui_element_colors: ^1.0.0 - equatable: ^2.0.5 + macos_window_utils: ^1.9.0 + gradient_borders: ^1.0.2 + appkit_ui_element_colors: ^1.0.1 + equatable: ^2.0.7 + vector_math: ^2.2.0 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^4.0.0 + flutter_lints: ^6.0.0 mocktail: ^1.0.4 flutter: diff --git a/test/buttons/checkbox_test.dart b/test/buttons/checkbox_test.dart index 7ba24553..cb7ca980 100644 --- a/test/buttons/checkbox_test.dart +++ b/test/buttons/checkbox_test.dart @@ -57,17 +57,14 @@ void main() { .map((node) => node.toString()) .toList(); - expect( - description, - [ - 'state: "unchecked"', - 'enabled', - 'size: 14.0', - 'activeColor: null', - 'disabledColor: quaternaryLabel(*color = Color(0x2d3c3c43)*, darkColor = Color(0x28ebebf5), highContrastColor = Color(0x423c3c43), darkHighContrastColor = Color(0x3debebf5), resolved by: UNRESOLVED)', - 'offBorderColor: tertiaryLabel(*color = Color(0x4c3c3c43)*, darkColor = Color(0x4cebebf5), highContrastColor = Color(0x603c3c43), darkHighContrastColor = Color(0x60ebebf5), resolved by: UNRESOLVED)', - 'semanticLabel: null', - ], - ); + expect(description, [ + 'state: "unchecked"', + 'enabled', + 'size: 14.0', + 'activeColor: null', + 'disabledColor: quaternaryLabel(*color = Color(alpha: 0.1765, red: 0.2353, green: 0.2353, blue: 0.2627, colorSpace: ColorSpace.sRGB)*, darkColor = Color(alpha: 0.1569, red: 0.9216, green: 0.9216, blue: 0.9608, colorSpace: ColorSpace.sRGB), highContrastColor = Color(alpha: 0.2588, red: 0.2353, green: 0.2353, blue: 0.2627, colorSpace: ColorSpace.sRGB), darkHighContrastColor = Color(alpha: 0.2392, red: 0.9216, green: 0.9216, blue: 0.9608, colorSpace: ColorSpace.sRGB), resolved by: UNRESOLVED)', + 'offBorderColor: tertiaryLabel(*color = Color(alpha: 0.2980, red: 0.2353, green: 0.2353, blue: 0.2627, colorSpace: ColorSpace.sRGB)*, darkColor = Color(alpha: 0.2980, red: 0.9216, green: 0.9216, blue: 0.9608, colorSpace: ColorSpace.sRGB), highContrastColor = Color(alpha: 0.3765, red: 0.2353, green: 0.2353, blue: 0.2627, colorSpace: ColorSpace.sRGB), darkHighContrastColor = Color(alpha: 0.3765, red: 0.9216, green: 0.9216, blue: 0.9608, colorSpace: ColorSpace.sRGB), resolved by: UNRESOLVED)', + 'semanticLabel: null', + ]); }); } diff --git a/test/buttons/radio_button_test.dart b/test/buttons/radio_button_test.dart index 7d878d1c..b1518122 100644 --- a/test/buttons/radio_button_test.dart +++ b/test/buttons/radio_button_test.dart @@ -3,11 +3,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:macos_ui/macos_ui.dart'; import 'package:macos_ui/src/library.dart'; -enum TestOptions { - first, - second, - third, -} +enum TestOptions { first, second, third } Type typeOf() => T; @@ -93,16 +89,13 @@ void main() { .map((node) => node.toString()) .toList(); - expect( - description, - [ - 'enabled', - 'size: 16.0', - 'onColor: null', - 'offColor: tertiaryLabel(*color = Color(0x4c3c3c43)*, darkColor = Color(0x4cebebf5), highContrastColor = Color(0x603c3c43), darkHighContrastColor = Color(0x60ebebf5), resolved by: UNRESOLVED)', - 'innerColor: null', - 'semanticLabel: null', - ], - ); + expect(description, [ + 'enabled', + 'size: 16.0', + 'onColor: null', + 'offColor: tertiaryLabel(*color = Color(alpha: 0.2980, red: 0.2353, green: 0.2353, blue: 0.2627, colorSpace: ColorSpace.sRGB)*, darkColor = Color(alpha: 0.2980, red: 0.9216, green: 0.9216, blue: 0.9608, colorSpace: ColorSpace.sRGB), highContrastColor = Color(alpha: 0.3765, red: 0.2353, green: 0.2353, blue: 0.2627, colorSpace: ColorSpace.sRGB), darkHighContrastColor = Color(alpha: 0.3765, red: 0.9216, green: 0.9216, blue: 0.9608, colorSpace: ColorSpace.sRGB), resolved by: UNRESOLVED)', + 'innerColor: null', + 'semanticLabel: null', + ]); }); } diff --git a/test/indicators/capacity_indicators_test.dart b/test/indicators/capacity_indicators_test.dart index 1780a362..9373ce74 100644 --- a/test/indicators/capacity_indicators_test.dart +++ b/test/indicators/capacity_indicators_test.dart @@ -11,27 +11,22 @@ import '../mock_canvas.dart'; void main() { testWidgets('debugFillProperties', (tester) async { final builder = DiagnosticPropertiesBuilder(); - const CapacityIndicator( - value: 50, - ).debugFillProperties(builder); + const CapacityIndicator(value: 50).debugFillProperties(builder); final description = builder.properties .where((node) => !node.isFiltered(DiagnosticLevel.info)) .map((node) => node.toString()) .toList(); - expect( - description, - [ - 'value: 50.0', - 'continuous', - 'splits: 10', - 'color: systemGreen(*color = Color(0xff34c759)*, darkColor = Color(0xff30d158), highContrastColor = Color(0xff248a3d), darkHighContrastColor = Color(0xff30db5b), resolved by: UNRESOLVED)', - 'backgroundColor: tertiarySystemGroupedBackground(*color = Color(0xfff2f2f7)*, darkColor = Color(0xff2c2c2e), highContrastColor = Color(0xffebebf0), darkHighContrastColor = Color(0xff363638), *elevatedColor = Color(0xfff2f2f7)*, darkElevatedColor = Color(0xff3a3a3c), highContrastElevatedColor = Color(0xffebebf0), darkHighContrastElevatedColor = Color(0xff444446), resolved by: UNRESOLVED)', - 'borderColor: tertiaryLabel(*color = Color(0x4c3c3c43)*, darkColor = Color(0x4cebebf5), highContrastColor = Color(0x603c3c43), darkHighContrastColor = Color(0x60ebebf5), resolved by: UNRESOLVED)', - 'semanticLabel: null', - ], - ); + expect(description, [ + 'value: 50.0', + 'continuous', + 'splits: 10', + 'color: systemGreen(*color = Color(alpha: 1.0000, red: 0.2039, green: 0.7804, blue: 0.3490, colorSpace: ColorSpace.sRGB)*, darkColor = Color(alpha: 1.0000, red: 0.1882, green: 0.8196, blue: 0.3451, colorSpace: ColorSpace.sRGB), highContrastColor = Color(alpha: 1.0000, red: 0.1412, green: 0.5412, blue: 0.2392, colorSpace: ColorSpace.sRGB), darkHighContrastColor = Color(alpha: 1.0000, red: 0.1882, green: 0.8588, blue: 0.3569, colorSpace: ColorSpace.sRGB), resolved by: UNRESOLVED)', + 'backgroundColor: tertiarySystemGroupedBackground(*color = Color(alpha: 1.0000, red: 0.9490, green: 0.9490, blue: 0.9686, colorSpace: ColorSpace.sRGB)*, darkColor = Color(alpha: 1.0000, red: 0.1725, green: 0.1725, blue: 0.1804, colorSpace: ColorSpace.sRGB), highContrastColor = Color(alpha: 1.0000, red: 0.9216, green: 0.9216, blue: 0.9412, colorSpace: ColorSpace.sRGB), darkHighContrastColor = Color(alpha: 1.0000, red: 0.2118, green: 0.2118, blue: 0.2196, colorSpace: ColorSpace.sRGB), *elevatedColor = Color(alpha: 1.0000, red: 0.9490, green: 0.9490, blue: 0.9686, colorSpace: ColorSpace.sRGB)*, darkElevatedColor = Color(alpha: 1.0000, red: 0.2275, green: 0.2275, blue: 0.2353, colorSpace: ColorSpace.sRGB), highContrastElevatedColor = Color(alpha: 1.0000, red: 0.9216, green: 0.9216, blue: 0.9412, colorSpace: ColorSpace.sRGB), darkHighContrastElevatedColor = Color(alpha: 1.0000, red: 0.2667, green: 0.2667, blue: 0.2745, colorSpace: ColorSpace.sRGB), resolved by: UNRESOLVED)', + 'borderColor: tertiaryLabel(*color = Color(alpha: 0.2980, red: 0.2353, green: 0.2353, blue: 0.2627, colorSpace: ColorSpace.sRGB)*, darkColor = Color(alpha: 0.2980, red: 0.9216, green: 0.9216, blue: 0.9608, colorSpace: ColorSpace.sRGB), highContrastColor = Color(alpha: 0.3765, red: 0.2353, green: 0.2353, blue: 0.2627, colorSpace: ColorSpace.sRGB), darkHighContrastColor = Color(alpha: 0.3765, red: 0.9216, green: 0.9216, blue: 0.9608, colorSpace: ColorSpace.sRGB), resolved by: UNRESOLVED)', + 'semanticLabel: null', + ]); }); testWidgets('debugFillProperties with discrete splits = 20', (tester) async { @@ -47,45 +42,37 @@ void main() { .map((node) => node.toString()) .toList(); - expect( - description, - [ - 'value: 50.0', - 'splits: 20', - 'color: systemGreen(*color = Color(0xff34c759)*, darkColor = Color(0xff30d158), highContrastColor = Color(0xff248a3d), darkHighContrastColor = Color(0xff30db5b), resolved by: UNRESOLVED)', - 'backgroundColor: tertiarySystemGroupedBackground(*color = Color(0xfff2f2f7)*, darkColor = Color(0xff2c2c2e), highContrastColor = Color(0xffebebf0), darkHighContrastColor = Color(0xff363638), *elevatedColor = Color(0xfff2f2f7)*, darkElevatedColor = Color(0xff3a3a3c), highContrastElevatedColor = Color(0xffebebf0), darkHighContrastElevatedColor = Color(0xff444446), resolved by: UNRESOLVED)', - 'borderColor: tertiaryLabel(*color = Color(0x4c3c3c43)*, darkColor = Color(0x4cebebf5), highContrastColor = Color(0x603c3c43), darkHighContrastColor = Color(0x60ebebf5), resolved by: UNRESOLVED)', - 'semanticLabel: null', - ], - ); + expect(description, [ + 'value: 50.0', + 'splits: 20', + 'color: systemGreen(*color = Color(alpha: 1.0000, red: 0.2039, green: 0.7804, blue: 0.3490, colorSpace: ColorSpace.sRGB)*, darkColor = Color(alpha: 1.0000, red: 0.1882, green: 0.8196, blue: 0.3451, colorSpace: ColorSpace.sRGB), highContrastColor = Color(alpha: 1.0000, red: 0.1412, green: 0.5412, blue: 0.2392, colorSpace: ColorSpace.sRGB), darkHighContrastColor = Color(alpha: 1.0000, red: 0.1882, green: 0.8588, blue: 0.3569, colorSpace: ColorSpace.sRGB), resolved by: UNRESOLVED)', + 'backgroundColor: tertiarySystemGroupedBackground(*color = Color(alpha: 1.0000, red: 0.9490, green: 0.9490, blue: 0.9686, colorSpace: ColorSpace.sRGB)*, darkColor = Color(alpha: 1.0000, red: 0.1725, green: 0.1725, blue: 0.1804, colorSpace: ColorSpace.sRGB), highContrastColor = Color(alpha: 1.0000, red: 0.9216, green: 0.9216, blue: 0.9412, colorSpace: ColorSpace.sRGB), darkHighContrastColor = Color(alpha: 1.0000, red: 0.2118, green: 0.2118, blue: 0.2196, colorSpace: ColorSpace.sRGB), *elevatedColor = Color(alpha: 1.0000, red: 0.9490, green: 0.9490, blue: 0.9686, colorSpace: ColorSpace.sRGB)*, darkElevatedColor = Color(alpha: 1.0000, red: 0.2275, green: 0.2275, blue: 0.2353, colorSpace: ColorSpace.sRGB), highContrastElevatedColor = Color(alpha: 1.0000, red: 0.9216, green: 0.9216, blue: 0.9412, colorSpace: ColorSpace.sRGB), darkHighContrastElevatedColor = Color(alpha: 1.0000, red: 0.2667, green: 0.2667, blue: 0.2745, colorSpace: ColorSpace.sRGB), resolved by: UNRESOLVED)', + 'borderColor: tertiaryLabel(*color = Color(alpha: 0.2980, red: 0.2353, green: 0.2353, blue: 0.2627, colorSpace: ColorSpace.sRGB)*, darkColor = Color(alpha: 0.2980, red: 0.9216, green: 0.9216, blue: 0.9608, colorSpace: ColorSpace.sRGB), highContrastColor = Color(alpha: 0.3765, red: 0.2353, green: 0.2353, blue: 0.2627, colorSpace: ColorSpace.sRGB), darkHighContrastColor = Color(alpha: 0.3765, red: 0.9216, green: 0.9216, blue: 0.9608, colorSpace: ColorSpace.sRGB), resolved by: UNRESOLVED)', + 'semanticLabel: null', + ]); }); - testWidgets( - 'CapacityIndicator paints the correct number of segments', - (WidgetTester tester) async { - await tester.pumpWidget( - const Directionality( - textDirection: TextDirection.ltr, - child: Center( - child: SizedBox( - width: 200.0, - child: CapacityIndicator( - value: 50, - splits: 20, - discrete: true, - ), - ), + testWidgets('CapacityIndicator paints the correct number of segments', ( + WidgetTester tester, + ) async { + await tester.pumpWidget( + const Directionality( + textDirection: TextDirection.ltr, + child: Center( + child: SizedBox( + width: 200.0, + child: CapacityIndicator(value: 50, splits: 20, discrete: true), ), ), - ); + ), + ); - expect( - find.byType(CapacityIndicator), - // each discrete segment is drawn 3 times, two times with fill, last time with stroke - paintedExactlyCountTimes(#drawRRect, 20 * 3), - ); - }, - ); + expect( + find.byType(CapacityIndicator), + // each discrete segment is drawn 3 times, two times with fill, last time with stroke + paintedExactlyCountTimes(#drawRRect, 20 * 3), + ); + }); testWidgets( 'CapacityIndicator paints two filled segments for value=10 and 20 segments', @@ -96,11 +83,7 @@ void main() { child: Center( child: SizedBox( width: 200.0, - child: CapacityIndicator( - value: 10, - splits: 20, - discrete: true, - ), + child: CapacityIndicator(value: 10, splits: 20, discrete: true), ), ), ), diff --git a/test/indicators/slider_test.dart b/test/indicators/slider_test.dart index 99f963ff..0d0a866f 100644 --- a/test/indicators/slider_test.dart +++ b/test/indicators/slider_test.dart @@ -16,21 +16,18 @@ void main() { .map((node) => node.toString()) .toList(); - expect( - description, - [ - 'value: 0.5', - 'has onChanged', - 'min: 0.0', - 'max: 1.0', - 'color: systemBlue(*color = Color(0xff007aff)*, darkColor = Color(0xff0a84ff), highContrastColor = Color(0xff0040dd), darkHighContrastColor = Color(0xff409cff), resolved by: UNRESOLVED)', - 'backgroundColor: CupertinoDynamicColor(*color = Color(0x19000000)*, darkColor = Color(0x19ffffff), resolved by: UNRESOLVED)', - 'tickBackgroundColor: CupertinoDynamicColor(*color = Color(0xffdcdcdc)*, darkColor = Color(0xff464646), resolved by: UNRESOLVED)', - 'thumbColor: CupertinoDynamicColor(*color = Color(0xffffffff)*, darkColor = Color(0xff98989d), resolved by: UNRESOLVED)', - 'splits: 15', - 'semanticLabel: null', - ], - ); + expect(description, [ + 'value: 0.5', + 'has onChanged', + 'min: 0.0', + 'max: 1.0', + 'color: systemBlue(*color = Color(alpha: 1.0000, red: 0.0000, green: 0.4784, blue: 1.0000, colorSpace: ColorSpace.sRGB)*, darkColor = Color(alpha: 1.0000, red: 0.0392, green: 0.5176, blue: 1.0000, colorSpace: ColorSpace.sRGB), highContrastColor = Color(alpha: 1.0000, red: 0.0000, green: 0.2510, blue: 0.8667, colorSpace: ColorSpace.sRGB), darkHighContrastColor = Color(alpha: 1.0000, red: 0.2510, green: 0.6118, blue: 1.0000, colorSpace: ColorSpace.sRGB), resolved by: UNRESOLVED)', + 'backgroundColor: CupertinoDynamicColor(*color = Color(alpha: 0.1000, red: 0.0000, green: 0.0000, blue: 0.0000, colorSpace: ColorSpace.sRGB)*, darkColor = Color(alpha: 0.1000, red: 1.0000, green: 1.0000, blue: 1.0000, colorSpace: ColorSpace.sRGB), resolved by: UNRESOLVED)', + 'tickBackgroundColor: CupertinoDynamicColor(*color = Color(alpha: 1.0000, red: 0.8627, green: 0.8627, blue: 0.8627, colorSpace: ColorSpace.sRGB)*, darkColor = Color(alpha: 1.0000, red: 0.2745, green: 0.2745, blue: 0.2745, colorSpace: ColorSpace.sRGB), resolved by: UNRESOLVED)', + 'thumbColor: CupertinoDynamicColor(*color = Color(alpha: 1.0000, red: 1.0000, green: 1.0000, blue: 1.0000, colorSpace: ColorSpace.sRGB)*, darkColor = Color(alpha: 1.0000, red: 0.5961, green: 0.5961, blue: 0.6157, colorSpace: ColorSpace.sRGB), resolved by: UNRESOLVED)', + 'splits: 15', + 'semanticLabel: null', + ]); }); testWidgets('Continuous slider can move when tapped', (tester) async { diff --git a/test/theme/help_button_theme_test.dart b/test/theme/help_button_theme_test.dart index 1e127f80..dddff003 100644 --- a/test/theme/help_button_theme_test.dart +++ b/test/theme/help_button_theme_test.dart @@ -42,13 +42,10 @@ void main() { .map((node) => node.toString()) .toList(); - expect( - description, - [ - 'color: MacosColor(0xff0433ff)', - 'disabledColor: MacosColor(0xff8e8e93)', - ], - ); + expect(description, [ + 'color: MacosColor(alpha: 1.0000, red: 0.0157, green: 0.2000, blue: 1.0000, colorSpace: ColorSpace.sRGB)', + 'disabledColor: MacosColor(alpha: 1.0000, red: 0.5569, green: 0.5569, blue: 0.5765, colorSpace: ColorSpace.sRGB)', + ]); }); testWidgets('Default values in widget tree', (tester) async { diff --git a/test/theme/icon_button_theme_test.dart b/test/theme/icon_button_theme_test.dart index 7d42593e..065e3f5e 100644 --- a/test/theme/icon_button_theme_test.dart +++ b/test/theme/icon_button_theme_test.dart @@ -44,18 +44,15 @@ void main() { .map((node) => node.toString()) .toList(); - expect( - description, - [ - 'backgroundColor: null', - 'disabledColor: null', - 'hoverColor: null', - 'shape: null', - 'borderRadius: null', - 'boxConstraints: null', - 'padding: null', - ], - ); + expect(description, [ + 'backgroundColor: null', + 'disabledColor: null', + 'hoverColor: null', + 'shape: null', + 'borderRadius: null', + 'boxConstraints: null', + 'padding: null', + ]); }); testWidgets('Default values in widget tree', (tester) async { diff --git a/test/theme/icon_theme_test.dart b/test/theme/icon_theme_test.dart index 7efe67fa..108b8ce0 100644 --- a/test/theme/icon_theme_test.dart +++ b/test/theme/icon_theme_test.dart @@ -48,14 +48,11 @@ void main() { .map((node) => node.toString()) .toList(); - expect( - description, - [ - 'MacosColor: MacosColor(0xffffffff)', - 'opacity: 0.0', - 'size: 20.0', - ], - ); + expect(description, [ + 'MacosColor: MacosColor(alpha: 1.0000, red: 1.0000, green: 1.0000, blue: 1.0000, colorSpace: ColorSpace.sRGB)', + 'opacity: 0.0', + 'size: 20.0', + ]); }); testWidgets('Default values in widget tree', (tester) async { @@ -81,7 +78,7 @@ void main() { ); final theme = MacosIconTheme.of(capturedContext); - expect(theme.color, const MacosColor(0xbe0981ff)); + expect(theme.color, const MacosColor.fromRGBO(9, 129, 255, 0.749)); expect(theme.size, 20); }); } diff --git a/test/theme/popup_button_theme_test.dart b/test/theme/popup_button_theme_test.dart index f704da09..b1510879 100644 --- a/test/theme/popup_button_theme_test.dart +++ b/test/theme/popup_button_theme_test.dart @@ -51,14 +51,11 @@ void main() { .map((node) => node.toString()) .toList(); - expect( - description, - [ - 'highlightColor: MacosColor(0xff8e8e93)', - 'backgroundColor: MacosColor(0xff0433ff)', - 'popupColor: Color(0x19000000)', - ], - ); + expect(description, [ + 'highlightColor: MacosColor(alpha: 1.0000, red: 0.5569, green: 0.5569, blue: 0.5765, colorSpace: ColorSpace.sRGB)', + 'backgroundColor: MacosColor(alpha: 1.0000, red: 0.0157, green: 0.2000, blue: 1.0000, colorSpace: ColorSpace.sRGB)', + 'popupColor: Color(alpha: 0.1000, red: 0.0000, green: 0.0000, blue: 0.0000, colorSpace: ColorSpace.sRGB)', + ]); }); testWidgets('Default values in widget tree', (tester) async { @@ -96,7 +93,10 @@ void main() { final theme = MacosPopupButtonTheme.of(capturedContext); expect(theme.backgroundColor, const Color(0xffffffff)); - expect(theme.highlightColor, const MacosColor(0xbe0981ff)); + expect( + theme.highlightColor, + const MacosColor.fromRGBO(9, 129, 255, 0.749), + ); expect(theme.popupColor, const Color(0xfff2f2f7)); }); }); diff --git a/test/theme/pulldown_button_theme_test.dart b/test/theme/pulldown_button_theme_test.dart index a082b42e..27b05bb6 100644 --- a/test/theme/pulldown_button_theme_test.dart +++ b/test/theme/pulldown_button_theme_test.dart @@ -50,15 +50,12 @@ void main() { .map((node) => node.toString()) .toList(); - expect( - description, - [ - 'highlightColor: MacosColor(0xff8e8e93)', - 'backgroundColor: MacosColor(0xff0433ff)', - 'pulldownColor: Color(0x19000000)', - 'iconColor: MacosColor(0xff00f900)', - ], - ); + expect(description, [ + 'highlightColor: MacosColor(alpha: 1.0000, red: 0.5569, green: 0.5569, blue: 0.5765, colorSpace: ColorSpace.sRGB)', + 'backgroundColor: MacosColor(alpha: 1.0000, red: 0.0157, green: 0.2000, blue: 1.0000, colorSpace: ColorSpace.sRGB)', + 'pulldownColor: Color(alpha: 0.1000, red: 0.0000, green: 0.0000, blue: 0.0000, colorSpace: ColorSpace.sRGB)', + 'iconColor: MacosColor(alpha: 1.0000, red: 0.0000, green: 0.9765, blue: 0.0000, colorSpace: ColorSpace.sRGB)', + ]); }); testWidgets('Default values in widget tree', (tester) async { @@ -97,7 +94,10 @@ void main() { final theme = MacosPulldownButtonTheme.of(capturedContext); expect(theme.backgroundColor, const Color(0xffffffff)); - expect(theme.highlightColor, const MacosColor(0xbe0981ff)); + expect( + theme.highlightColor, + const MacosColor.fromRGBO(9, 129, 255, 0.749), + ); expect(theme.pulldownColor, const Color(0xfff2f2f7)); }); }); diff --git a/test/theme/search_field_theme_test.dart b/test/theme/search_field_theme_test.dart index 39aa577f..bb7294b2 100644 --- a/test/theme/search_field_theme_test.dart +++ b/test/theme/search_field_theme_test.dart @@ -48,13 +48,10 @@ void main() { .map((node) => node.toString()) .toList(); - expect( - description, - [ - 'highlightColor: Color(0xff007aff)', - 'resultsBackgroundColor: Color(0xfff2f2f7)', - ], - ); + expect(description, [ + 'highlightColor: Color(alpha: 1.0000, red: 0.0000, green: 0.4784, blue: 1.0000, colorSpace: ColorSpace.sRGB)', + 'resultsBackgroundColor: Color(alpha: 1.0000, red: 0.9490, green: 0.9490, blue: 0.9686, colorSpace: ColorSpace.sRGB)', + ]); }); testWidgets('Default values in widget tree', (tester) async { @@ -68,9 +65,7 @@ void main() { ContentArea( builder: (context, _) { capturedContext = context; - return const Center( - child: MacosSearchField(), - ); + return const Center(child: MacosSearchField()); }, ), ], @@ -80,7 +75,10 @@ void main() { ); final theme = MacosSearchFieldTheme.of(capturedContext); - expect(theme.highlightColor, const MacosColor(0xbe0981ff)); + expect( + theme.highlightColor, + const MacosColor.fromRGBO(9, 129, 255, 0.749), + ); expect(theme.resultsBackgroundColor, const Color(0xfff2f2f7)); }); });