From d2a8602782b876ea1be855dd3488f0b8b55bcbe1 Mon Sep 17 00:00:00 2001 From: Rydmike Date: Fri, 8 Jul 2022 20:17:40 +0300 Subject: [PATCH] More version 5.1.0 features and fixes (#57) * Deprecated m3TextTheme and use SDK built in Typography instead * Deprcate: FlexSubThemes.buttonTheme * Bump package versions * Update to use super.params, new in Dart 2.17 * Update LinkTextSpan to use Uri instead of deprecated url * Dep updates * Add larg FAB to theme showcase * Make Example custom themed Cards, also respect useMaterial3 * Add surfaceTint color to SchemeColor enum and functions * Add basic support for surfaceTint * Three more panel M3 useMaterial3 behavior added * Fix lint * Typo/comment corrections * Add support for Flutter 3.0 Theme Extensions * iOs and macOS * Bump package versions * DroidSans font not available anymore in Google Fons 3.0.0 package, replace with Fira Mono * Update change log and TODOs * Bump example version info * Opt-in sub theme toggleables now default to primary instead of secondary * Playground: Toggleable colors and efault text update. Add M3 switch to UI. * Playground: FAB fix of default text when using M3 * Remove not needed TODOs * Correct FAB color behavior when useMaterail3 is true * Doc and typo fixes * Playground app: Workaround for issue https://github.com/flutter/flutter/issues/103864 * FAB component theme color indicator fix for useM3 * PopupMenu style change * M3 defaults support for NavigationBar * Fix Material theme showcase when using M3 * Themes Playground - update M3 presentation of Card * Update CHANGELOG.md * Doc updates * Doc updates * Doc updates * FIX NavigationRail M3 defaults * FIX test for new default rail size 14-12dp * Playground intro text update. Flutter version info update. * Doc updates * Doc updates * Doc updates * Add full support for surfaceTint color, so it is also used as FCS blend color. Needs tests! * Custom surfaceTint and surface blends support in Playground * Example fixes * Update CHANGELOG.md * Cleaning: Hashcode algo changed. Remove not needed finals. * Lint: Remove not needed finals. * HasCode: Change to Object.hash (used jenkins deprecated in master). * Set defaultUseMaterial3 = false due to Flutter issue 107190 To avoid having this issue visible as default in Theme Playground we default useMaterial3 until it is fixed or behaves better https://github.com/flutter/flutter/issues/107190 * Initial/early support for M3 TextField style. * Update flex_theme_mode_switch.dart * Fix InputDecorator test. Update changelog date --- CHANGELOG.md | 177 +++++++++++++++++- example/lib/example1/main.dart | 11 ++ example/lib/example2/main.dart | 11 ++ example/lib/example3/main.dart | 11 ++ example/lib/example4/main.dart | 11 ++ .../component_themes/component_themes.dart | 2 +- .../text_field_settings.dart | 4 +- .../widgets/shared/color_picker_inkwell.dart | 7 - example/lib/main.dart | 10 + example/lib/shared/const/store.dart | 2 +- example/pubspec.lock | 6 +- example/pubspec.yaml | 4 +- lib/src/flex_color_scheme.dart | 28 +-- lib/src/flex_constants.dart | 18 +- lib/src/flex_key_color.dart | 22 +-- lib/src/flex_scheme_color.dart | 12 +- lib/src/flex_scheme_data.dart | 12 +- lib/src/flex_scheme_on_colors.dart | 2 +- lib/src/flex_sub_themes.dart | 10 +- lib/src/flex_sub_themes_data.dart | 2 +- lib/src/flex_theme_mode_switch.dart | 102 +++++----- lib/src/flex_tones.dart | 2 +- pubspec.lock | 30 +-- test/flex_key_color_test.dart | 7 +- test/flex_scheme_color_test.dart | 7 +- test/flex_scheme_data_test.dart | 7 +- test/flex_scheme_on_colors_test.dart | 7 +- test/flex_scheme_surface_colors_test.dart | 7 +- test/flex_sub_themes_test.dart | 40 ++-- test/flex_tones_test.dart | 5 - 30 files changed, 381 insertions(+), 195 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64079589..feb5ba75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,176 @@ # Changelog -All notable changes to the **FlexColorScheme** package are documented here. +All notable changes to the **FlexColorScheme** (FCS) package are documented here. + +## v5.1.0 - July 8, 2022 + +* Updated to support Flutter 3.0.0, Dart 2.17 and latest Flutter package dependencies in + example apps. Requires at least Flutter 3.0.0 and Dart 2.17.0. + +**NEW** + +* **Added** full support for in Flutter 3.0.0 new `ColorScheme.surfaceTint` color. It is set to + `ColorScheme.primary` color by default, as Flutter and Material 3 does. If a custom `surfaceTint` + color is provided, it is also used as the blend color, instead of `primary` color, for + FlexColorScheme's surface blend feature. + +* **Added** pass through API for using Flutter 3.0.0 theme extensions directly via FlexColorScheme + API. It was added as a convenience feature in order to avoid having to add theme extensions with a + `copyWith` on FlexColorScheme produced ThemeData. With the `FlexColorScheme.extensions` and + `FlexThemeData.extensions` properties you can add custom theme extensions directly. + +**DEPRECATED** + +* **Deprecated:** `FlexColorScheme.m3TextTheme`. The custom M3 text theme is no longer needed after + Flutter 3.0.0 release that includes the new M3 Typography in addition to its earlier released + `TextTheme`. You can opt in on using the new M3 style TextTheme as before by setting + `FlexColorScheme.subThemesData.useTextTheme` to true **or** by setting + `FlexColorScheme.useMaterial3` to true. Using either does however come with known issue + [#103864](https://github.com/flutter/flutter/issues/103864), where dynamically switching + Typography, e.g. from 2014 or 2018, to M3 2021 Typography, triggers the mentioned assert in issue + [#103864](https://github.com/flutter/flutter/issues/103864). This issue has always existed in + Flutter SDK ThemeData when dynamically changing between different Typography. + Before FlexColorScheme avoided triggering this issue by only using Typography 2018, also when + opting in on M3 TextTheme, that before used 2018 based Typography to make a custom M3 like + `TextTheme`. Avoiding this issue is no longer possible when opting in on M3, that now correctly + uses its own and different Typography from M2. This exposes this issue if you dynamically + change ThemeData from one to another Typography. + To avoid this Flutter SDK issue, use the same Typography for all your themes in your app and don't + dynamically switch theme between ThemeData objects that uses different Typography in your + application. The use cases for doing this are few, but it is still a Flutter SDK limitation to be + aware about. + +* **Deprecated:** `FlexSubThemes.buttonTheme` that creates an opinionated `ButtonThemeData`. + The ButtonThemeData is marked as obsolete in Flutter SDK, but not yet deprecated in + Flutter version 3.0.0. FlexColorscheme now marks it as **deprecated**. It will be + removed in a future FlexColorScheme release when Flutter SDK deprecates `ButtonThemeData`. + +**M3 STYLE FIXES AND CHANGES** + +* **FAB M3 defaults change**: Floating Action Button background color, will when opting in on + `ThemeData.useMaterail3`, use color `theme.colorScheme.primaryContainer`, + otherwise `theme.colorScheme.secondary` is used. + +* **Input Decorator default change**: The `TextField` and its `InputDecorator` border radius + default value was changed from 20dp to 16dp when using opinionated component themes. + If opting in on Material 3, the default value for M3 design is used, which is only 4dp. + See specification https://m3.material.io/components/text-fields/specs. + Flutter 3.0.x does not yet implement the new M3 TextField style, but via this change when + opting in on M3, FlexColorScheme offers an early approximation of it. + +* **NavigationBar M3 defaults change**: Default colors of `NavigationBar` when opting in on + `useMaterial3` and not using opinionated component themes will now match M3 default colors. + The background color will follow M3 style also by default when component themes are enabled and + `useMaterial3` is true. This style is difficult to replicate with a single color otherwise. + The difference is subtle for FCS surface tinted background colors. You can still set it to + `background` color to replicate past FCS default color when sub-themes were enabled. + For other properties, if opinionated component themes are not used, FCS will use default M3 + theme styles on `NavigationBar` when `useMaterial3` is true. If opting in + on opinionated component themes, FCS uses its own custom opinionated default style. Which can be + modified to be the same as default M3 style too, just as before. The change also includes a + default font size change for FCS opinionated styled navigation bar, from 11dp to 12dp. This change + was done to harmonize it with its M3 style. + +* **NavigationRail M3 defaults change**: Default colors of `NavigationRail` when opting in on + `useMaterial3` and not using opinionated component themes will now match M3 default colors. + If opinionated component themes are not used, FCS will use default M3 theme styles on + `NavigationRail` when `useMaterial3` is true. If opting in on opinionated component themes, + FCS uses its own custom opinionated default style. Which can be modified to be the same as + default M3 style too, just as before. The change also includes a default font + size change for FCS opinionated styled rail, from 14dp to 12dp. This change was + done to harmonize it with its M3 style. + +* **Toggleable M3 style change:** Default color of toggles (Switch, CheckBox and Radio) are now + using `primary` color as default themed color when opting in on opinionated component themes or + setting `ThemeData.useMaterail3` to true. The Switch, CheckBox and Radio themes then use a style + that match the M3 color design intent. In it, + switches and toggles are mostly primary color based. In M3 color design, the secondary color is a + poor choice for switches and toggles, and it is therefore not used as their default color. It + does not look nice with M3 based ColorSchemes, created e.g. using M3 color seeding. If you use a + custom M3 color design, where secondary color is still prominent, you can of course still use it. + +* **Fixed lint:** "Avoid using private types in public APIs". See tweet + [discussion](https://twitter.com/RydMike/status/1533788260320923649) about why and when you + might run into this lint being triggered by older Stateful Widgets. The lint warning was + addressed in the package and examples. + +**EXAMPLE UPDATES** + +* Added a **Theme Extensions** example to the default example app, i.e. the "Hot Reload Playground". + +* Themes Playground: Updated the default style info labels for Switch, CheckBox and Radio. + +* Themes Playground: To the top row theme selector, where the FlexColorScheme and component themes + switches are, added the "Use Material 3" toggle. Previously this toggle was only available on the + introduction panel. The availability in the header makes it easy to toggle it ON and OFF at + any time, to see what impact it has on widgets. + +* Themes Playground: Updated the default style info labels for the NavigationBar. The logic to display + default color labels in different config modes (M2/M3/FCS/FCS+M2/FCS+M3) is quite involved, please + report any issues. + +* Themes Playground: Updated the default style info labels for the NavigationRail. The logic to display + default color labels in different config modes (M2/M3/FCS/FCS+M2/FCS+M3) is quite involved, please + report any issues. + +* Themes Playground: Due to issue [#107190](https://github.com/flutter/flutter/issues/107190), the + Playground previous default to use Material 3 was changed to false. + +* Added support in Themes Playground to customize the `surfaceTint` color. It controls both the + elevation color used for elevated `Material` surfaces in M3. Plus for FlexColorScheme it is also + used as the surface blend color. By default, the `surfaceTint` color equals `ColorScheme.primary` + color. Generally there are not many good design reasons to change the color, but it is now + possible to do so. A good graphical designer can use it to create subtle difference from the + standard surface elevation color branding effects. Used poorly, it mostly creates not so + appealing visual and coloring results. + +**KNOWN FLUTTER SDK ISSUES** + +The issues below in the Flutter SDK itself, are known to impact FlexColorScheme and Flutter +theming in general. + +* Switching Typography dynamically in Flutter SDK ThemeData is broken, see + issue [#103864](https://github.com/flutter/flutter/issues/103864) for more information. + If it is done and the error ignored, an app doing so eventually become unstable. + +* The Themes Playground app contains a workaround to + avoid issue [#103864](https://github.com/flutter/flutter/issues/103864). The workaround + is done by always using 2021 Typography, but simulating 2018 Typography. This is done by using + a custom TextTheme that looks like 2018 Typography is used when using M2 theme mode. The + Playground App actually always stays in 2021 Typography, but looks + like it switches it. Which it does by applying a custom `TextTheme` in 2021 Typography, that looks + like 2018 Typography is used. All other examples also avoid the issue by only using the + M3 2021 Typography and not even mimicking a switch between M2 and M3 Typography. + + The above workaround is needed because the Playground app has toggles that switches Typography + frequently, without the workaround it will eventually crash. With this workaround it never + switches Typography, it just looks like it does, but app stays in 2021 Typography all the time. + The by Themes Playground generated ThemeData config will use the actual real effective + Typography. This is also fine, since an app using the theme will likely never switch used + Typography. However, if it does, it will face the same issue the Playground app did. The issue + is a Flutter SDK issue that FlexColorScheme cannot fix. Most likely 99% of apps will never run + into this issue. + +* In Flutter SDK 3.0.x, when opting in on `useMaterial3:true`, the `Material` widget and other SDK + widgets built on it, gets no elevation when only the `elevation` property is defined. It is + required to also define `shadowColor` and/or `surfaceTintColor` to get any elevation effect. + When using the `Material` widget itself this is easy to address. However, widgets like + `Drawer`, `PopupMenuButton`, `BottomNavigationBar`, `NavigationRail`, `Dialog`, `AlertDialog`, + `TimePickerDialog`, `DatePickerDialog`, `MaterialBanner` and `BottomSheet` do not expose these + `Material` properties and cannot be elevated. + + The issue is reported and tracked here [#107190](https://github.com/flutter/flutter/issues/107190) + and also mentioned in the `FlexColorScheme` repo here + [#54](https://github.com/rydmike/flex_color_scheme/issues/54). There are no good workarounds + for using elevation on these widgets when `useMaterial3` is true. The options are to not use + M3, if such elevations are important to your app design. One working fix is to wrap those widgets + in a theme where `useMaterial3` is false, then te rest of your app can still use it. This is + however a rather tedious workaround fix. Due to current SDK `Material` elevation issues when + `useMaterial3` is true, it is recommended to not use it yet. + +* This regression in master channel impacts AppBar icon colors when using Material 3 + [#107305](https://github.com/flutter/flutter/issues/107305). It has not yet landed in stable + channel Flutter 3.0.4, but if you use master channel it is something to be aware of. ## v5.1.0 - July 5, 2022 @@ -1792,9 +1962,8 @@ tracked [here](https://github.com/rydmike/flex_color_scheme/projects/1). ## PLANNED -- All past planned features have been done and delivered with version 5, - and much more actually. Future planned topics will be listed in - the documentation. +- All past planned features have been done and delivered with version 5. + Future planned topics will be listed in the documentation or repo discussions. ## DONE diff --git a/example/lib/example1/main.dart b/example/lib/example1/main.dart index d9b2817a..1b225802 100644 --- a/example/lib/example1/main.dart +++ b/example/lib/example1/main.dart @@ -1,4 +1,5 @@ import 'package:flex_color_scheme/flex_color_scheme.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import '../shared/utils/app_scroll_behavior.dart'; @@ -42,12 +43,22 @@ class _DemoAppState extends State { scheme: usedScheme, // Use very subtly themed app bar elevation in light mode. appBarElevation: 0.5, + // Use predefined M3 typography while this issue is in effect: + // https://github.com/flutter/flutter/issues/103864 + typography: Typography.material2021( + platform: defaultTargetPlatform, + ), ), // Same definition for the dark theme, but using FlexThemeData.dark(). darkTheme: FlexThemeData.dark( scheme: usedScheme, // Use a bit more themed elevated app bar in dark mode. appBarElevation: 2, + // Use predefined M3 typography while this issue is in effect: + // https://github.com/flutter/flutter/issues/103864 + typography: Typography.material2021( + platform: defaultTargetPlatform, + ), ), // Use the above dark or light theme based on active themeMode. themeMode: themeMode, diff --git a/example/lib/example2/main.dart b/example/lib/example2/main.dart index 771a8eea..45765a36 100644 --- a/example/lib/example2/main.dart +++ b/example/lib/example2/main.dart @@ -1,4 +1,5 @@ import 'package:flex_color_scheme/flex_color_scheme.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -151,6 +152,11 @@ class DemoApp extends StatelessWidget { // textTheme and primaryTextTheme in FlexThemeData. This is // just how you would use it with ThemeData too. fontFamily: GoogleFonts.notoSans().fontFamily, + // Use predefined M3 typography while this issue is in effect: + // https://github.com/flutter/flutter/issues/103864 + typography: Typography.material2021( + platform: defaultTargetPlatform, + ), ), // Same setup for the dark theme, but using FlexThemeData.dark(). darkTheme: FlexThemeData.dark( @@ -161,6 +167,11 @@ class DemoApp extends StatelessWidget { appBarElevation: 1, visualDensity: VisualDensity.standard, fontFamily: GoogleFonts.notoSans().fontFamily, + // Use predefined M3 typography while this issue is in effect: + // https://github.com/flutter/flutter/issues/103864 + typography: Typography.material2021( + platform: defaultTargetPlatform, + ), ), // Use the dark or light theme, based on theme controller setting. themeMode: themeController.themeMode, diff --git a/example/lib/example3/main.dart b/example/lib/example3/main.dart index c6d0054a..756c0bac 100644 --- a/example/lib/example3/main.dart +++ b/example/lib/example3/main.dart @@ -1,4 +1,5 @@ import 'package:flex_color_scheme/flex_color_scheme.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -174,6 +175,11 @@ class DemoApp extends StatelessWidget { // not as large as on hand held devices. visualDensity: FlexColorScheme.comfortablePlatformDensity, fontFamily: GoogleFonts.notoSans().fontFamily, + // Use predefined M3 typography while this issue is in effect: + // https://github.com/flutter/flutter/issues/103864 + typography: Typography.material2021( + platform: defaultTargetPlatform, + ), ), // We make an equivalent definition for the dark theme, but using // FlexThemeData.dark() and the dark FlexSchemeColors instead. @@ -199,6 +205,11 @@ class DemoApp extends StatelessWidget { ), visualDensity: FlexColorScheme.comfortablePlatformDensity, fontFamily: GoogleFonts.notoSans().fontFamily, + // Use predefined M3 typography while this issue is in effect: + // https://github.com/flutter/flutter/issues/103864 + typography: Typography.material2021( + platform: defaultTargetPlatform, + ), ), // Use the dark or light theme, based on controller setting. themeMode: themeController.themeMode, diff --git a/example/lib/example4/main.dart b/example/lib/example4/main.dart index cf732689..a39d6882 100644 --- a/example/lib/example4/main.dart +++ b/example/lib/example4/main.dart @@ -1,4 +1,5 @@ import 'package:flex_color_scheme/flex_color_scheme.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import '../shared/const/app_color.dart'; @@ -166,6 +167,11 @@ class DemoApp extends StatelessWidget { // from a single static source, so we can change it easily there. visualDensity: AppData.visualDensity, fontFamily: AppData.font, + // Use predefined M3 typography while this issue is in effect: + // https://github.com/flutter/flutter/issues/103864 + typography: Typography.material2021( + platform: defaultTargetPlatform, + ), ), // We do the exact same definition for the dark theme, but using // FlexThemeData.dark() and the dark FlexSchemeColors in our @@ -191,6 +197,11 @@ class DemoApp extends StatelessWidget { : null, visualDensity: AppData.visualDensity, fontFamily: AppData.font, + // Use predefined M3 typography while this issue is in effect: + // https://github.com/flutter/flutter/issues/103864 + typography: Typography.material2021( + platform: defaultTargetPlatform, + ), ), // Use the dark or light theme based on controller setting. themeMode: themeController.themeMode, diff --git a/example/lib/example5/widgets/panels/component_themes/component_themes.dart b/example/lib/example5/widgets/panels/component_themes/component_themes.dart index ecc61b89..83fa8592 100644 --- a/example/lib/example5/widgets/panels/component_themes/component_themes.dart +++ b/example/lib/example5/widgets/panels/component_themes/component_themes.dart @@ -62,7 +62,7 @@ class ComponentThemes extends StatelessWidget { ListTile( enabled: controller.useSubThemes && controller.useFlexColorScheme, title: const Text('Global border radius on components'), - subtitle: const Text('Default setting uses Material 3 design ' + subtitle: const Text('Default setting uses mostly Material 3 design ' 'values, where radius spec varies per component. ' 'Material 2 design uses 4 on all components. ' 'If you set a value, all components will use it. ' diff --git a/example/lib/example5/widgets/panels/text_field_settings/text_field_settings.dart b/example/lib/example5/widgets/panels/text_field_settings/text_field_settings.dart index c546183f..657c6fe1 100644 --- a/example/lib/example5/widgets/panels/text_field_settings/text_field_settings.dart +++ b/example/lib/example5/widgets/panels/text_field_settings/text_field_settings.dart @@ -16,7 +16,9 @@ class TextFieldSettings extends StatelessWidget { final String decoratorRadiusDefaultLabel = controller.inputDecoratorBorderRadius == null && controller.defaultRadius == null - ? 'default 20' + ? controller.useMaterial3 + ? 'default 4' + : 'default 16' : controller.inputDecoratorBorderRadius == null && controller.defaultRadius != null ? 'global ${controller.defaultRadius!.toStringAsFixed(0)}' diff --git a/example/lib/example5/widgets/shared/color_picker_inkwell.dart b/example/lib/example5/widgets/shared/color_picker_inkwell.dart index bcbd0fb3..ec1b7e2d 100644 --- a/example/lib/example5/widgets/shared/color_picker_inkwell.dart +++ b/example/lib/example5/widgets/shared/color_picker_inkwell.dart @@ -225,13 +225,6 @@ class ColorPickerInkWell extends StatelessWidget { final bool isLight = Theme.of(context).brightness == Brightness.light; return InkWell( - // TODO(rydmike): Remove this commented customized InkWell style. - // We want a bit more pronounced hover color for this case than normally. - // hoverColor: isLight ? const Color(0x40BCBCBC):const Color(0x30FFFFFF), - // splashColor: isLight ? const Color(0x40BCBCBC):const Color(0x30FFFFFF), - // focusColor: isLight ? const Color(0x40BCBCBC):const Color(0x30FFFFFF), - // highlightColor: - // isLight ? const Color(0x40BCBCBC) : const Color(0x30FFFFFF), onHover: (bool value) { onHover?.call(value); }, diff --git a/example/lib/main.dart b/example/lib/main.dart index 3fa9db27..a5e0d92b 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -636,6 +636,11 @@ class _DemoAppState extends State { subThemesData: _useSubThemes ? _subThemesData : null, visualDensity: _visualDensity, platform: _platform, + // Use predefined M3 typography while this issue is in effect: + // https://github.com/flutter/flutter/issues/103864 + typography: Typography.material2021( + platform: _platform, + ), // Add all our custom theme extensions, in this case we only have one. extensions: >{ lightBrandTheme, @@ -709,6 +714,11 @@ class _DemoAppState extends State { subThemesData: _useSubThemes ? _subThemesData : null, visualDensity: _visualDensity, platform: _platform, + // Use predefined M3 typography while this issue is in effect: + // https://github.com/flutter/flutter/issues/103864 + typography: Typography.material2021( + platform: _platform, + ), // Add all our custom theme extensions, in this case we only have one. extensions: >{ darkBrandTheme, diff --git a/example/lib/shared/const/store.dart b/example/lib/shared/const/store.dart index 4c18ac98..c1648521 100644 --- a/example/lib/shared/const/store.dart +++ b/example/lib/shared/const/store.dart @@ -203,7 +203,7 @@ class Store { // Key used to read and save the useMaterial3 value. static const String keyUseMaterial3 = 'useMaterial3'; // Default value for the useMaterial3, also to reset settings. - static const bool defaultUseMaterial3 = true; + static const bool defaultUseMaterial3 = false; // Key used to read and save the useKeyColors value. static const String keyUseKeyColors = 'useKeyColors'; diff --git a/example/pubspec.lock b/example/pubspec.lock index 6c974f1e..b984b40e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -127,7 +127,7 @@ packages: name: hive url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "2.2.3" http: dependency: transitive description: @@ -370,7 +370,7 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.1.3" + version: "6.1.4" url_launcher_android: dependency: transitive description: @@ -405,7 +405,7 @@ packages: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.1.0" url_launcher_web: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 2e0f5383..2c11f52e 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -35,7 +35,7 @@ dependencies: # Hive local storage, by Simon Leir. # https://pub.dev/packages/hive - hive: ^2.2.1 + hive: ^2.2.3 # Material Design Icons, community designed. Used for # icons in the Platform selection popup menu. @@ -58,7 +58,7 @@ dependencies: # Used for launching a WEB URL, by Google flutter.dev. # https://pub.dev/packages/url_launcher - url_launcher: ^6.1.3 + url_launcher: ^6.1.4 dev_dependencies: flutter_test: diff --git a/lib/src/flex_color_scheme.dart b/lib/src/flex_color_scheme.dart index c38a3c4c..07b48bd9 100644 --- a/lib/src/flex_color_scheme.dart +++ b/lib/src/flex_color_scheme.dart @@ -5711,7 +5711,7 @@ class FlexColorScheme with Diagnosticable { // - If neither was given we use the surface color in dark mode and // primary color in light mode, the same logic that Flutter SDK // ThemeData.from factory sets the AppBar background color to. - final Color effectiveAppBarColor = appBarBackground ?? + final Color effectiveAppBarBackgroundColor = appBarBackground ?? (useSubThemes && subTheme.appBarBackgroundSchemeColor != null ? FlexSubThemes.schemeColor( subTheme.appBarBackgroundSchemeColor!, colorScheme) @@ -5719,7 +5719,7 @@ class FlexColorScheme with Diagnosticable { ? colorScheme.surface : colorScheme.primary); final Brightness appBarBrightness = - ThemeData.estimateBrightnessForColor(effectiveAppBarColor); + ThemeData.estimateBrightnessForColor(effectiveAppBarBackgroundColor); Color appBarForeground = appBarBrightness == Brightness.dark ? Colors.white : Colors.black; // Icons are slightly black transparent in light mode! This per SDK. @@ -5729,10 +5729,10 @@ class FlexColorScheme with Diagnosticable { if (useSubThemes && subTheme.blendTextTheme) { if (appBarBrightness == Brightness.dark) { appBarForeground = - FlexColor.lightSurface.blend(effectiveAppBarColor, 12); + FlexColor.lightSurface.blend(effectiveAppBarBackgroundColor, 12); } else { appBarForeground = - FlexColor.darkSurface.blend(effectiveAppBarColor, 12); + FlexColor.darkSurface.blend(effectiveAppBarBackgroundColor, 12); } appBarIconColor = appBarForeground; } @@ -5751,7 +5751,7 @@ class FlexColorScheme with Diagnosticable { ? Colors.black87 : Colors.white; case FlexTabBarStyle.universal: - // TODO(rydmike): Need better FlexTabBarStyle.universal algo some day. + // TODO(rydmike): Chore: Better FlexTabBarStyle.universal algo. return isDark ? colorScheme.primary.blendAlpha(Colors.white, 0xE6) // 90% : colorScheme.primary.blendAlpha(Colors.white, 0xB2); // 50% @@ -5773,9 +5773,9 @@ class FlexColorScheme with Diagnosticable { : colorScheme.onSurface.withAlpha(0x99); // 60% case FlexTabBarStyle.forAppBar: return (appBarBrightness == Brightness.light && - (effectiveAppBarColor == Colors.white || - effectiveAppBarColor == colorScheme.surface || - effectiveAppBarColor == colorScheme.background)) + (effectiveAppBarBackgroundColor == Colors.white || + effectiveAppBarBackgroundColor == colorScheme.surface || + effectiveAppBarBackgroundColor == colorScheme.background)) ? colorScheme.onSurface.withAlpha(0x99) // 60% : selectedTabColor().withAlpha(0xB2); // 70% alpha case FlexTabBarStyle.universal: @@ -5837,7 +5837,9 @@ class FlexColorScheme with Diagnosticable { baseSchemeColor: subTheme.inputDecoratorSchemeColor, radius: subTheme.inputDecoratorRadius ?? subTheme.defaultRadius ?? - kButtonRadius, + (useMaterial3 + ? kInputDecoratorM3Radius + : kInputDecoratorRadius), borderType: subTheme.inputDecoratorBorderType, filled: subTheme.inputDecoratorIsFilled, fillColor: subTheme.inputDecoratorFillColor, @@ -6047,7 +6049,7 @@ class FlexColorScheme with Diagnosticable { // The FlexColorScheme implementation below has been changed to // use these new AppBarTheme features in version 2.0.0. appBarTheme: AppBarTheme( - backgroundColor: effectiveAppBarColor, + backgroundColor: effectiveAppBarBackgroundColor, foregroundColor: appBarForeground, iconTheme: IconThemeData(color: appBarIconColor), actionsIconTheme: IconThemeData(color: appBarIconColor), @@ -6140,7 +6142,7 @@ class FlexColorScheme with Diagnosticable { subTheme.tabBarItemSchemeColor!, colorScheme) .withAlpha(0x99) // 60%, ), - // Set colors for for icons in opted in sub themes. + // Set colors for icons in opted in sub themes. iconTheme: useSubThemes ? IconThemeData(color: effectiveTextTheme.headline6!.color) : null, @@ -6930,7 +6932,7 @@ class FlexColorScheme with Diagnosticable { /// Override for hashcode, dart.ui Jenkins based. @override - int get hashCode => hashList([ + int get hashCode => Object.hashAll([ colorScheme, brightness, primary, @@ -7465,7 +7467,7 @@ class FlexSchemeSurfaceColors with Diagnosticable { /// Override for hashcode, dart.ui Jenkins based. @override - int get hashCode => hashValues( + int get hashCode => Object.hash( surface, surfaceVariant, inverseSurface, diff --git a/lib/src/flex_constants.dart b/lib/src/flex_constants.dart index 3432bdf8..7177c69f 100644 --- a/lib/src/flex_constants.dart +++ b/lib/src/flex_constants.dart @@ -161,16 +161,18 @@ const double kChipRadius = 8; /// https://m3.material.io/components/buttons/specs const double kButtonRadius = 20; -/// Default border radius on input decoration. +/// Default border radius on input decoration when using +/// opinionated component themes. /// -/// Will follows Material M3 guide. -/// https://m3.material.io/components/all-buttons +/// Using a more rounded design 16dp, instead of 4dp which is M3's default. +/// https://m3.material.io/components/text-fields/specs +const double kInputDecoratorRadius = 16; + +/// Default border radius on input decoration when opting in on M3. /// -/// Was not specified in M3 guide what it should be. -/// Will be adjusted when known. Now set to same as button radius (20dp), so -/// it matches them. The M3 design intent may also be that it should -/// be same as FAB and Drawer, ie 16dp. -const double kInputDecoratorRadius = kButtonRadius; +/// Follows Material M3 guide. +/// https://m3.material.io/components/text-fields/specs +const double kInputDecoratorM3Radius = 4; /// Default border radius on top edge of bottom sheet. /// diff --git a/lib/src/flex_key_color.dart b/lib/src/flex_key_color.dart index b12245b5..5ebc71f4 100644 --- a/lib/src/flex_key_color.dart +++ b/lib/src/flex_key_color.dart @@ -1,5 +1,3 @@ -import 'dart:ui'; - import 'package:flutter/foundation.dart'; import 'package:material_color_utilities/material_color_utilities.dart'; @@ -107,15 +105,15 @@ class FlexKeyColors with Diagnosticable { /// FlexColorSchemes, while still passing in a configuration object with /// other properties set, that have no effect if [useKeyColors] is false. const FlexKeyColors({ - final this.useKeyColors = true, - final this.useSecondary = false, - final this.useTertiary = false, - final this.keepPrimary = false, - final this.keepSecondary = false, - final this.keepTertiary = false, - final this.keepPrimaryContainer = false, - final this.keepSecondaryContainer = false, - final this.keepTertiaryContainer = false, + this.useKeyColors = true, + this.useSecondary = false, + this.useTertiary = false, + this.keepPrimary = false, + this.keepSecondary = false, + this.keepTertiary = false, + this.keepPrimaryContainer = false, + this.keepSecondaryContainer = false, + this.keepTertiaryContainer = false, }); /// Turn on using Material 3 key color based [TonalPalette] colors for the @@ -335,7 +333,7 @@ class FlexKeyColors with Diagnosticable { /// Override for hashcode, dart.ui Jenkins based. @override - int get hashCode => hashValues( + int get hashCode => Object.hash( useKeyColors, useSecondary, useTertiary, diff --git a/lib/src/flex_scheme_color.dart b/lib/src/flex_scheme_color.dart index 06556e82..536fbb2d 100644 --- a/lib/src/flex_scheme_color.dart +++ b/lib/src/flex_scheme_color.dart @@ -36,15 +36,15 @@ class FlexSchemeColor with Diagnosticable { /// The appBarColor and error colors are not required, if they /// are null, they will be provided by defaults in theme creation later. const FlexSchemeColor({ - required final this.primary, + required this.primary, Color? primaryContainer, - required final this.secondary, + required this.secondary, Color? secondaryContainer, Color? tertiary, Color? tertiaryContainer, - final this.appBarColor, - final this.error, - final this.errorContainer, + this.appBarColor, + this.error, + this.errorContainer, @Deprecated('Use primaryContainer instead. ' 'In FlexSchemeColor old primaryContainer built-in colors were moved to ' 'the primaryContainer color since their design fitted that role best. ' @@ -619,7 +619,7 @@ class FlexSchemeColor with Diagnosticable { /// Override for hashcode, dart.ui Jenkins based. @override - int get hashCode => hashValues( + int get hashCode => Object.hash( primary, primaryContainer, secondary, diff --git a/lib/src/flex_scheme_data.dart b/lib/src/flex_scheme_data.dart index 9b62e35d..d5a4a523 100644 --- a/lib/src/flex_scheme_data.dart +++ b/lib/src/flex_scheme_data.dart @@ -1,5 +1,3 @@ -import 'dart:ui'; - import 'package:flutter/foundation.dart'; import 'flex_scheme_color.dart'; @@ -27,10 +25,10 @@ class FlexSchemeData with Diagnosticable { /// /// Contains [name], [description] plus [light] and [dark] scheme colors. const FlexSchemeData({ - required final this.name, - required final this.description, - required final this.light, - required final this.dark, + required this.name, + required this.description, + required this.light, + required this.dark, }); /// A short name for the [FlexSchemeData] based color scheme. @@ -74,7 +72,7 @@ class FlexSchemeData with Diagnosticable { /// Override for hashcode, dart.ui Jenkins based. @override - int get hashCode => hashValues( + int get hashCode => Object.hash( name, description, light, diff --git a/lib/src/flex_scheme_on_colors.dart b/lib/src/flex_scheme_on_colors.dart index eb4a5026..05a2e441 100644 --- a/lib/src/flex_scheme_on_colors.dart +++ b/lib/src/flex_scheme_on_colors.dart @@ -303,7 +303,7 @@ class FlexSchemeOnColors with Diagnosticable { /// Override for hashcode, dart.ui Jenkins based. @override - int get hashCode => hashValues( + int get hashCode => Object.hash( onPrimary, onPrimaryContainer, onSecondary, diff --git a/lib/src/flex_sub_themes.dart b/lib/src/flex_sub_themes.dart index 297e8307..3881458d 100644 --- a/lib/src/flex_sub_themes.dart +++ b/lib/src/flex_sub_themes.dart @@ -1357,12 +1357,10 @@ class FlexSubThemes { /// The decorated input fields corner border radius. /// - /// If not defined, defaults to [kInputDecoratorRadius] 20dp. - /// - /// Was not specified in M3 guide what it should be. - /// Will be adjusted when known. Now set to same as button radius (20dp), so - /// it matches them. The M3 design intent may also be that it should - /// be same as FAB and Drawer, ie 16dp. + /// If not defined, defaults to [kInputDecoratorRadius] 16dp. + /// When opting in on using Material3 with `useMaterial3` set to true, + /// FlexColorScheme will [kInputDecoratorM3Radius] is value is not + /// otherwise specified. final double? radius, /// Selects input border type. diff --git a/lib/src/flex_sub_themes_data.dart b/lib/src/flex_sub_themes_data.dart index ea311dbe..ab007c12 100644 --- a/lib/src/flex_sub_themes_data.dart +++ b/lib/src/flex_sub_themes_data.dart @@ -2298,7 +2298,7 @@ class FlexSubThemesData with Diagnosticable { /// Override for hashcode, dart.ui Jenkins based. @override - int get hashCode => hashList([ + int get hashCode => Object.hashAll([ interactionEffects, blendOnLevel, blendOnColors, diff --git a/lib/src/flex_theme_mode_switch.dart b/lib/src/flex_theme_mode_switch.dart index e4fc63c4..49550807 100644 --- a/lib/src/flex_theme_mode_switch.dart +++ b/lib/src/flex_theme_mode_switch.dart @@ -46,34 +46,34 @@ class FlexThemeModeSwitch extends StatelessWidget { /// Default constructor. const FlexThemeModeSwitch({ super.key, - required final this.themeMode, - required final this.onThemeModeChanged, - required final this.flexSchemeData, - final this.title, - final this.hasTitle = true, - final this.labelLight = 'LIGHT', - final this.labelDark = 'DARK', - final this.labelSystem = 'SYSTEM', - final this.showSystemMode = true, - final this.buttonOrder = FlexThemeModeButtonOrder.lightDarkSystem, - final this.selectedLabelStyle, - final this.unselectedLabelStyle, - final this.labelAbove = true, - final this.backgroundLight, - final this.backgroundDark, - final this.backgroundSystem, - final this.selectedBorder, - final this.unselectedBorder, - final this.selectedElevation = 0, - final this.unselectedElevation = 0, - final this.optionButtonPadding, - final this.optionButtonMargin, - final this.optionButtonBorderRadius = 5, - final this.height = 24, - final this.width = 24, - final this.borderRadius = 4, - final this.padding, - final this.hoverColor, + required this.themeMode, + required this.onThemeModeChanged, + required this.flexSchemeData, + this.title, + this.hasTitle = true, + this.labelLight = 'LIGHT', + this.labelDark = 'DARK', + this.labelSystem = 'SYSTEM', + this.showSystemMode = true, + this.buttonOrder = FlexThemeModeButtonOrder.lightDarkSystem, + this.selectedLabelStyle, + this.unselectedLabelStyle, + this.labelAbove = true, + this.backgroundLight, + this.backgroundDark, + this.backgroundSystem, + this.selectedBorder, + this.unselectedBorder, + this.selectedElevation = 0, + this.unselectedElevation = 0, + this.optionButtonPadding, + this.optionButtonMargin, + this.optionButtonBorderRadius = 5, + this.height = 24, + this.width = 24, + this.borderRadius = 4, + this.padding, + this.hoverColor, }) : assert(selectedElevation >= 0.0, 'Selected elevation must be >= 0.0'), assert( unselectedElevation >= 0.0, 'Unselected elevation must be >= 0.0'); @@ -342,24 +342,24 @@ class FlexThemeModeOptionButton extends StatelessWidget { /// Default constructor. const FlexThemeModeOptionButton({ super.key, - required final this.flexSchemeColor, - final this.backgroundColor, - final this.label, - final this.labelStyle, - final this.labelAbove = true, - required final this.selected, - final this.onSelect, - final this.selectedBorder, - final this.unselectedBorder, - final this.elevation = 0, - final this.optionButtonPadding, - final this.optionButtonMargin, - final this.optionButtonBorderRadius = 5, - final this.height = 24, - final this.width = 24, - final this.borderRadius = 4, - final this.padding, - final this.hoverColor, + required this.flexSchemeColor, + this.backgroundColor, + this.label, + this.labelStyle, + this.labelAbove = true, + required this.selected, + this.onSelect, + this.selectedBorder, + this.unselectedBorder, + this.elevation = 0, + this.optionButtonPadding, + this.optionButtonMargin, + this.optionButtonBorderRadius = 5, + this.height = 24, + this.width = 24, + this.borderRadius = 4, + this.padding, + this.hoverColor, }) : assert(elevation >= 0.0, 'Elevation must be >= 0.0'); /// The scheme colors used to colorize the option button's four colors. @@ -551,11 +551,11 @@ class FlexThemeModeOptionButton extends StatelessWidget { class _SchemeColorBox extends StatelessWidget { /// Default constructor. const _SchemeColorBox({ - required final this.color, - final this.height = 24, - final this.width = 24, - final this.borderRadius = 4, - final this.padding, + required this.color, + this.height = 24, + this.width = 24, + this.borderRadius = 4, + this.padding, }); /// The background color used to draw an individual scheme color box. diff --git a/lib/src/flex_tones.dart b/lib/src/flex_tones.dart index 2e999860..d1cc2b12 100644 --- a/lib/src/flex_tones.dart +++ b/lib/src/flex_tones.dart @@ -676,7 +676,7 @@ class FlexTones with Diagnosticable { /// Override for hashcode, dart.ui Jenkins based. @override - int get hashCode => hashList([ + int get hashCode => Object.hashAll([ primaryTone, onPrimaryTone, primaryContainerTone, diff --git a/pubspec.lock b/pubspec.lock index f861269e..6eb80a62 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "39.0.0" + version: "41.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "4.2.0" args: dependency: transitive description: @@ -70,14 +70,14 @@ packages: name: convert url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" coverage: dependency: transitive description: name: coverage url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.3.2" crypto: dependency: transitive description: @@ -115,28 +115,28 @@ packages: name: frontend_server_client url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.3" glob: dependency: transitive description: name: glob url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.0" http_multi_server: dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "3.2.0" + version: "3.2.1" http_parser: dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "4.0.1" io: dependency: transitive description: @@ -199,7 +199,7 @@ packages: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.0" path: dependency: transitive description: @@ -213,7 +213,7 @@ packages: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.5.0" + version: "1.5.1" pub_semver: dependency: transitive description: @@ -227,28 +227,28 @@ packages: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.1" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" shelf_static: dependency: transitive description: name: shelf_static url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" shelf_web_socket: dependency: transitive description: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" sky_engine: dependency: transitive description: flutter @@ -365,7 +365,7 @@ packages: name: webkit_inspection_protocol url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.1.0" yaml: dependency: transitive description: diff --git a/test/flex_key_color_test.dart b/test/flex_key_color_test.dart index 8273795e..629aad97 100644 --- a/test/flex_key_color_test.dart +++ b/test/flex_key_color_test.dart @@ -149,12 +149,7 @@ void main() { test('FKCS1.12: Test hashCode has value.', () { expect(m1.hashCode, isNotNull); }); - // This happens to always equal now in tests, if it start failing, test - // 14 is actually enough. - test('FKCS1.13: Test hashCode exact value.', () { - expect(m1.hashCode, 385085668); - }); - test('FKCS1.14: Test hashCode copyWith has same exact value.', () { + test('FKCS1.13: Test hashCode copyWith has same exact value.', () { expect(m1.hashCode, equals(m1.copyWith().hashCode)); }); }); diff --git a/test/flex_scheme_color_test.dart b/test/flex_scheme_color_test.dart index 5eff6a27..76b122d4 100644 --- a/test/flex_scheme_color_test.dart +++ b/test/flex_scheme_color_test.dart @@ -1150,12 +1150,7 @@ void main() { test('FSC1.38: Test hashCode has value.', () { expect(m1.hashCode, isNotNull); }); - // This happens to be always equal now in tests, if it start failing, test - // 28 is actually enough. - test('FSC1.39: Test hashCode exact value.', () { - expect(m1.hashCode, 423560097); - }); - test('FSC1.40: Test hashCode copyWith has same exact value.', () { + test('FSC1.39: Test hashCode copyWith has same exact value.', () { expect(m1.hashCode, equals(m1.copyWith().hashCode)); }); }); diff --git a/test/flex_scheme_data_test.dart b/test/flex_scheme_data_test.dart index d78dec9c..e26a1ef4 100644 --- a/test/flex_scheme_data_test.dart +++ b/test/flex_scheme_data_test.dart @@ -253,12 +253,7 @@ void main() { test('FSD1.13a: Test hashCode has value.', () { expect(m1.hashCode, isNotNull); }); - // This happens to always equal now in tests, if it start failing, test - // 13c is actually enough. - test('FSD1.13b: Test hashCode exact value.', () { - expect(m1.hashCode, 406187442); - }); - test('FSD1.13c: Test hashCode copyWith has same exact value.', () { + test('FSD1.13b: Test hashCode copyWith has same exact value.', () { expect(m1.hashCode, equals(m1.copyWith().hashCode)); }); }); diff --git a/test/flex_scheme_on_colors_test.dart b/test/flex_scheme_on_colors_test.dart index 227b5f39..fd074d9f 100644 --- a/test/flex_scheme_on_colors_test.dart +++ b/test/flex_scheme_on_colors_test.dart @@ -359,12 +359,7 @@ void main() { test('FSOC1.08a: Test hashCode has value.', () { expect(m7a.hashCode, isNotNull); }); - // This happens to always equal now in tests, if it start failing, test - // 08c is actually enough. - test('FSOC1.08b: Test hashCode exact value.', () { - expect(m7a.hashCode, 391411255); - }); - test('FSOC1.08c: Test hashCode copyWith has same exact value.', () { + test('FSOC1.08b Test hashCode copyWith has same exact value.', () { expect(m7a.hashCode, equals(m7a.copyWith().hashCode)); }); }); diff --git a/test/flex_scheme_surface_colors_test.dart b/test/flex_scheme_surface_colors_test.dart index 7756431a..bb936e01 100644 --- a/test/flex_scheme_surface_colors_test.dart +++ b/test/flex_scheme_surface_colors_test.dart @@ -136,12 +136,7 @@ void main() { test('FSSC1.18a: Test hashCode has value.', () { expect(m1.hashCode, isNotNull); }); - // This happens to always equal now in tests, if it start failing, test - // 18c is actually enough. - test('FSSC1.18b: Test hashCode exact value.', () { - expect(m1.hashCode, 165231232); - }); - test('FSSC1.18c: Test hashCode copyWith has same exact value.', () { + test('FSSC1.18b: Test hashCode copyWith has same exact value.', () { expect(m1.hashCode, equals(m1.copyWith().hashCode)); }); diff --git a/test/flex_sub_themes_test.dart b/test/flex_sub_themes_test.dart index b6b7a23a..24d6ce41 100644 --- a/test/flex_sub_themes_test.dart +++ b/test/flex_sub_themes_test.dart @@ -674,21 +674,21 @@ void main() { hoverColor: colorScheme.primary.withAlpha(0x0D), focusColor: colorScheme.primary.withAlpha(0x26), focusedBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.primary, width: 2, ), ), enabledBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.primary.withAlpha(0xA7), width: 1.5, ), ), disabledBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.primary .blendAlpha(colorScheme.onSurface, 0x66) @@ -697,14 +697,14 @@ void main() { ), ), focusedErrorBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.error, width: 2, ), ), errorBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.error.withAlpha(0xA7), width: 1.5, @@ -749,21 +749,21 @@ void main() { hoverColor: colorScheme.primary.withAlpha(0x0D), focusColor: colorScheme.primary.withAlpha(0x26), focusedBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.primary, width: 2, ), ), enabledBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.onSurface.withOpacity(0.38), width: 1.5, ), ), disabledBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.primary .blendAlpha(colorScheme.onSurface, 0x66) @@ -772,14 +772,14 @@ void main() { ), ), focusedErrorBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.error, width: 2, ), ), errorBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.error.withAlpha(0xA7), width: 1.5, @@ -822,21 +822,21 @@ void main() { hoverColor: colorScheme.primary.withAlpha(0x0D), focusColor: colorScheme.primary.withAlpha(0x26), focusedBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.primary, width: 2, ), ), enabledBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.primary.withAlpha(0xA7), width: 1.5, ), ), disabledBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.primary .blendAlpha(colorScheme.onSurface, 0x66) @@ -845,14 +845,14 @@ void main() { ), ), focusedErrorBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.error, width: 2, ), ), errorBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.error.withAlpha(0xA7), width: 1.5, @@ -897,21 +897,21 @@ void main() { hoverColor: colorScheme.primary.withAlpha(0x0D), focusColor: colorScheme.primary.withAlpha(0x26), focusedBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.primary, width: 2, ), ), enabledBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.onSurface.withOpacity(0.38), width: 1.5, ), ), disabledBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.primary .blendAlpha(colorScheme.onSurface, 0x66) @@ -920,14 +920,14 @@ void main() { ), ), focusedErrorBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.error, width: 2, ), ), errorBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(20)), + borderRadius: const BorderRadius.all(Radius.circular(16)), borderSide: BorderSide( color: colorScheme.error.withAlpha(0xA7), width: 1.5, diff --git a/test/flex_tones_test.dart b/test/flex_tones_test.dart index 90f2ff6d..b1ec619c 100644 --- a/test/flex_tones_test.dart +++ b/test/flex_tones_test.dart @@ -182,11 +182,6 @@ void main() { test('FTO1.12: Test hashCode has value.', () { expect(m1.hashCode, isNotNull); }); - // This happens to always equal now in tests, if it start failing, test - // 14 is actually enough. - test('FTO1.13: Test hashCode exact value.', () { - expect(m1.hashCode, 279578120); - }); test('FTO1.14: Test hashCode copyWith has same exact value.', () { expect(m1.hashCode, equals(m1.copyWith().hashCode)); });