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/macos/Podfile.lock b/example/macos/Podfile.lock index be4112eb..179dfac5 100644 --- a/example/macos/Podfile.lock +++ b/example/macos/Podfile.lock @@ -24,7 +24,7 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos SPEC CHECKSUMS: - FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 + FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811 path_provider_macos: 3c0c3b4b0d4a76d2bf989a913c2de869c5641a19 shared_preferences_macos: a64dc611287ed6cbe28fd1297898db1336975727 url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3 diff --git a/lib/src/flex_color_scheme.dart b/lib/src/flex_color_scheme.dart index c38a3c4c..88ecc6e2 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: @@ -6047,7 +6047,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 +6140,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 +6930,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 +7465,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_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_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_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)); });