From 871d59221c67c148264ca38586bab08a36db1092 Mon Sep 17 00:00:00 2001 From: Qun Cheng <36861262+QuncCccccc@users.noreply.github.com> Date: Tue, 27 Feb 2024 20:21:14 +0000 Subject: [PATCH] Reland - Introduce tone-based surfaces and accent color add-ons - Part 2 (#144001) Reverts flutter/flutter#143973 This is a reland for #138521 with an updated g3fix(cl/605555997). Local test: cl/609608958. --- .../lib/src/web/material3.dart | 8 +- .../lib/demo/calculator/home.dart | 2 +- .../lib/demo/material/chip_demo.dart | 2 +- .../flutter_gallery/lib/demo/shrine/app.dart | 2 - .../flutter_gallery/lib/gallery/themes.dart | 2 +- dev/tools/gen_defaults/data/badge.json | 2 +- dev/tools/gen_defaults/data/banner.json | 5 +- .../gen_defaults/data/bottom_app_bar.json | 7 +- .../gen_defaults/data/button_elevated.json | 8 +- .../gen_defaults/data/button_filled.json | 5 +- .../data/button_filled_tonal.json | 5 +- .../gen_defaults/data/button_outlined.json | 5 +- dev/tools/gen_defaults/data/button_text.json | 5 +- .../gen_defaults/data/card_elevated.json | 8 +- dev/tools/gen_defaults/data/card_filled.json | 7 +- .../gen_defaults/data/card_outlined.json | 6 +- .../gen_defaults/data/carousel_item.json | 5 +- dev/tools/gen_defaults/data/checkbox.json | 5 +- dev/tools/gen_defaults/data/chip_assist.json | 8 +- dev/tools/gen_defaults/data/chip_filter.json | 8 +- dev/tools/gen_defaults/data/chip_input.json | 5 +- .../gen_defaults/data/chip_suggestion.json | 8 +- dev/tools/gen_defaults/data/color_dark.json | 6 +- dev/tools/gen_defaults/data/color_light.json | 6 +- .../gen_defaults/data/date_picker_docked.json | 5 +- .../data/date_picker_input_modal.json | 5 +- .../gen_defaults/data/date_picker_modal.json | 5 +- dev/tools/gen_defaults/data/dialog.json | 5 +- .../gen_defaults/data/dialog_fullscreen.json | 4 +- dev/tools/gen_defaults/data/divider.json | 2 +- dev/tools/gen_defaults/data/elevation.json | 2 +- .../data/fab_extended_primary.json | 5 +- .../gen_defaults/data/fab_large_primary.json | 5 +- dev/tools/gen_defaults/data/fab_primary.json | 5 +- .../gen_defaults/data/fab_small_primary.json | 5 +- dev/tools/gen_defaults/data/icon_button.json | 8 +- .../gen_defaults/data/icon_button_filled.json | 10 +- .../data/icon_button_filled_tonal.json | 10 +- .../data/icon_button_outlined.json | 8 +- dev/tools/gen_defaults/data/list.json | 11 +- dev/tools/gen_defaults/data/menu.json | 13 +- dev/tools/gen_defaults/data/motion.json | 2 +- .../gen_defaults/data/navigation_bar.json | 8 +- .../gen_defaults/data/navigation_drawer.json | 9 +- .../gen_defaults/data/navigation_rail.json | 13 +- .../data/navigation_tab_primary.json | 7 +- .../data/navigation_tab_secondary.json | 9 +- dev/tools/gen_defaults/data/palette.json | 46 +- .../data/progress_indicator_circular.json | 2 +- .../data/progress_indicator_linear.json | 4 +- dev/tools/gen_defaults/data/radio_button.json | 2 +- dev/tools/gen_defaults/data/search_bar.json | 8 +- dev/tools/gen_defaults/data/search_view.json | 5 +- .../data/segmented_button_outlined.json | 5 +- dev/tools/gen_defaults/data/shape.json | 2 +- dev/tools/gen_defaults/data/sheet_bottom.json | 11 +- dev/tools/gen_defaults/data/slider.json | 4 +- dev/tools/gen_defaults/data/snackbar.json | 2 +- dev/tools/gen_defaults/data/state.json | 6 +- dev/tools/gen_defaults/data/switch.json | 25 +- .../gen_defaults/data/text_field_filled.json | 5 +- .../data/text_field_outlined.json | 5 +- dev/tools/gen_defaults/data/text_style.json | 2 +- dev/tools/gen_defaults/data/time_picker.json | 9 +- .../gen_defaults/data/top_app_bar_large.json | 3 +- .../gen_defaults/data/top_app_bar_medium.json | 3 +- .../gen_defaults/data/top_app_bar_small.json | 4 +- dev/tools/gen_defaults/data/typeface.json | 2 +- .../gen_defaults/generated/used_tokens.csv | 69 +-- .../lib/action_chip_template.dart | 4 +- .../gen_defaults/lib/banner_template.dart | 2 +- .../lib/bottom_app_bar_template.dart | 2 +- .../lib/bottom_sheet_template.dart | 2 +- .../lib/color_scheme_template.dart | 38 ++ .../gen_defaults/lib/drawer_template.dart | 2 +- .../lib/filter_chip_template.dart | 2 +- .../lib/icon_button_template.dart | 6 +- dev/tools/gen_defaults/lib/menu_template.dart | 7 +- .../lib/navigation_drawer_template.dart | 2 +- .../gen_defaults/lib/popup_menu_template.dart | 2 +- .../gen_defaults/lib/search_bar_template.dart | 11 +- .../lib/segmented_button_template.dart | 8 +- dev/tools/gen_defaults/lib/tabs_template.dart | 12 +- .../material/color_scheme/color_scheme.0.dart | 309 +++++++++++ .../color_scheme/dynamic_content_color.0.dart | 15 +- .../draggable_scrollable_sheet.0.dart | 2 +- .../lib/widgets/page_view/page_view.0.dart | 2 +- .../api/test/material/app/app.0_test.dart | 12 +- .../api/test/material/card/card.2_test.dart | 10 +- .../color_scheme/color_scheme.0_test.dart | 41 ++ .../toggle_buttons/toggle_buttons.0_test.dart | 6 +- .../fix_material/fix_color_scheme.yaml | 429 +++++++++++++++ .../flutter/lib/src/material/action_chip.dart | 6 +- .../flutter/lib/src/material/app_bar.dart | 22 +- packages/flutter/lib/src/material/banner.dart | 15 +- .../lib/src/material/bottom_app_bar.dart | 22 +- .../lib/src/material/bottom_sheet.dart | 9 +- packages/flutter/lib/src/material/card.dart | 23 +- .../flutter/lib/src/material/checkbox.dart | 12 +- packages/flutter/lib/src/material/chip.dart | 11 +- .../flutter/lib/src/material/choice_chip.dart | 4 +- .../lib/src/material/color_scheme.dart | 493 +++++++++++++----- .../lib/src/material/date_picker_theme.dart | 29 +- packages/flutter/lib/src/material/dialog.dart | 14 +- packages/flutter/lib/src/material/drawer.dart | 14 +- .../lib/src/material/elevated_button.dart | 18 +- .../lib/src/material/filled_button.dart | 14 +- .../flutter/lib/src/material/filter_chip.dart | 4 +- .../src/material/floating_action_button.dart | 13 +- .../flutter/lib/src/material/icon_button.dart | 54 +- .../lib/src/material/input_decorator.dart | 2 +- .../flutter/lib/src/material/menu_anchor.dart | 12 +- .../lib/src/material/navigation_bar.dart | 13 +- .../lib/src/material/navigation_drawer.dart | 15 +- .../lib/src/material/outlined_button.dart | 12 +- .../flutter/lib/src/material/popup_menu.dart | 15 +- .../lib/src/material/progress_indicator.dart | 2 +- packages/flutter/lib/src/material/radio.dart | 20 +- .../lib/src/material/search_anchor.dart | 26 +- .../lib/src/material/segmented_button.dart | 16 +- packages/flutter/lib/src/material/slider.dart | 10 +- .../flutter/lib/src/material/snack_bar.dart | 2 +- packages/flutter/lib/src/material/switch.dart | 28 +- packages/flutter/lib/src/material/tabs.dart | 42 +- .../flutter/lib/src/material/text_button.dart | 12 +- .../flutter/lib/src/material/theme_data.dart | 62 ++- .../flutter/lib/src/material/time_picker.dart | 12 +- .../lib/src/material/time_picker_theme.dart | 6 +- packages/flutter/lib/src/widgets/routes.dart | 2 +- .../test/material/action_chip_test.dart | 10 +- packages/flutter/test/material/app_test.dart | 14 +- .../test/material/banner_theme_test.dart | 12 +- .../test/material/bottom_app_bar_test.dart | 7 +- .../material/bottom_app_bar_theme_test.dart | 2 +- .../test/material/bottom_sheet_test.dart | 3 +- .../material/bottom_sheet_theme_test.dart | 4 +- packages/flutter/test/material/card_test.dart | 8 +- .../test/material/card_theme_test.dart | 6 +- .../flutter/test/material/checkbox_test.dart | 10 +- .../test/material/choice_chip_test.dart | 18 +- .../test/material/color_scheme_test.dart | 211 ++++++-- .../test/material/date_picker_test.dart | 6 +- .../test/material/date_picker_theme_test.dart | 20 +- .../test/material/date_range_picker_test.dart | 8 +- .../test/material/drawer_theme_test.dart | 8 +- .../test/material/dropdown_menu_test.dart | 4 +- .../material/dropdown_menu_theme_test.dart | 4 +- .../test/material/elevated_button_test.dart | 4 +- .../material/elevated_button_theme_test.dart | 4 +- .../test/material/filled_button_test.dart | 8 +- .../material/filled_button_theme_test.dart | 4 +- .../test/material/filter_chip_test.dart | 18 +- .../floating_action_button_theme_test.dart | 2 +- .../test/material/icon_button_test.dart | 14 +- .../test/material/icon_button_theme_test.dart | 4 +- .../flutter/test/material/list_tile_test.dart | 4 +- .../test/material/menu_anchor_test.dart | 16 +- .../test/material/navigation_bar_test.dart | 4 +- .../test/material/navigation_drawer_test.dart | 4 +- .../test/material/navigation_rail_test.dart | 2 +- .../test/material/outlined_button_test.dart | 4 +- .../material/outlined_button_theme_test.dart | 4 +- .../test/material/popup_menu_theme_test.dart | 4 +- .../flutter/test/material/radio_test.dart | 14 +- .../test/material/search_anchor_test.dart | 14 +- .../test/material/segmented_button_test.dart | 2 +- .../flutter/test/material/slider_test.dart | 30 +- .../test/material/slider_theme_test.dart | 6 +- .../flutter/test/material/switch_test.dart | 22 +- .../test/material/tab_bar_theme_test.dart | 8 +- packages/flutter/test/material/tabs_test.dart | 34 +- .../test/material/text_button_test.dart | 4 +- .../test/material/text_button_theme_test.dart | 4 +- .../test/material/theme_data_test.dart | 308 +++++++---- .../flutter/test/material/theme_test.dart | 4 +- .../test/material/time_picker_test.dart | 4 +- .../test/material/time_picker_theme_test.dart | 16 +- .../test_fixes/material/color_scheme.dart | 18 + .../material/color_scheme.dart.expect | 18 + .../material/theme_data.dart.expect | 32 +- .../flutter_test/test/accessibility_test.dart | 4 +- 181 files changed, 2520 insertions(+), 999 deletions(-) create mode 100644 examples/api/lib/material/color_scheme/color_scheme.0.dart create mode 100644 examples/api/test/material/color_scheme/color_scheme.0_test.dart diff --git a/dev/benchmarks/macrobenchmarks/lib/src/web/material3.dart b/dev/benchmarks/macrobenchmarks/lib/src/web/material3.dart index 58ad37060769a..728fdf8bb9939 100644 --- a/dev/benchmarks/macrobenchmarks/lib/src/web/material3.dart +++ b/dev/benchmarks/macrobenchmarks/lib/src/web/material3.dart @@ -443,7 +443,7 @@ class Cards extends StatelessWidget { SizedBox( width: cardWidth, child: Card( - color: Theme.of(context).colorScheme.surfaceVariant, + color: Theme.of(context).colorScheme.surfaceContainerHighest, elevation: 0, child: Container( padding: const EdgeInsets.fromLTRB(10, 5, 5, 10), @@ -1279,7 +1279,7 @@ class _IconToggleButtonState extends State { ButtonStyle enabledFilledButtonStyle(bool selected, ColorScheme colors) { return IconButton.styleFrom( foregroundColor: selected ? colors.onPrimary : colors.primary, - backgroundColor: selected ? colors.primary : colors.surfaceVariant, + backgroundColor: selected ? colors.primary : colors.surfaceContainerHighest, disabledForegroundColor: colors.onSurface.withOpacity(0.38), disabledBackgroundColor: colors.onSurface.withOpacity(0.12), hoverColor: selected @@ -1306,7 +1306,7 @@ ButtonStyle enabledFilledTonalButtonStyle(bool selected, ColorScheme colors) { foregroundColor: selected ? colors.onSecondaryContainer : colors.onSurfaceVariant, backgroundColor: - selected ? colors.secondaryContainer : colors.surfaceVariant, + selected ? colors.secondaryContainer : colors.surfaceContainerHighest, hoverColor: selected ? colors.onSecondaryContainer.withOpacity(0.08) : colors.onSurfaceVariant.withOpacity(0.08), @@ -2350,7 +2350,7 @@ class ComponentGroupDecoration extends StatelessWidget { child: Card( margin: EdgeInsets.zero, elevation: 0, - color: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.3), + color: Theme.of(context).colorScheme.surfaceContainerHighest.withOpacity(0.3), child: Padding( padding: const EdgeInsets.symmetric(vertical: 20.0), child: Center( diff --git a/dev/integration_tests/flutter_gallery/lib/demo/calculator/home.dart b/dev/integration_tests/flutter_gallery/lib/demo/calculator/home.dart index 239526c1c667b..58adcb570defd 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/calculator/home.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/calculator/home.dart @@ -202,7 +202,7 @@ class KeyPad extends StatelessWidget { ), Expanded( child: Material( - color: themeData.colorScheme.background, + color: themeData.colorScheme.surface, child: Column( children: [ CalcKey('\u232B', calcState!.handleDelTap), diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/chip_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/chip_demo.dart index 19188dc24444a..ba561bc955c35 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/chip_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/chip_demo.dart @@ -203,7 +203,7 @@ class _ChipDemoState extends State { assert(name.length > 1); final int hash = name.hashCode & 0xffff; final double hue = (360.0 * hash / (1 << 15)) % 360.0; - final double themeValue = HSVColor.fromColor(theme.colorScheme.background).value; + final double themeValue = HSVColor.fromColor(theme.colorScheme.surface).value; return HSVColor.fromAHSV(1.0, hue, 0.4, themeValue).toColor(); } diff --git a/dev/integration_tests/flutter_gallery/lib/demo/shrine/app.dart b/dev/integration_tests/flutter_gallery/lib/demo/shrine/app.dart index 0b4ff755f49a7..c825b0ba3e11a 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/shrine/app.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/shrine/app.dart @@ -114,12 +114,10 @@ const ColorScheme kShrineColorScheme = ColorScheme( primary: kShrinePink100, secondary: kShrinePink50, surface: kShrineSurfaceWhite, - background: kShrineBackgroundWhite, error: kShrineErrorRed, onPrimary: kShrineBrown900, onSecondary: kShrineBrown900, onSurface: kShrineBrown900, - onBackground: kShrineBrown900, onError: kShrineSurfaceWhite, brightness: Brightness.light, ); diff --git a/dev/integration_tests/flutter_gallery/lib/gallery/themes.dart b/dev/integration_tests/flutter_gallery/lib/gallery/themes.dart index dbaefed98cbde..2c0e475a4c942 100644 --- a/dev/integration_tests/flutter_gallery/lib/gallery/themes.dart +++ b/dev/integration_tests/flutter_gallery/lib/gallery/themes.dart @@ -23,7 +23,7 @@ ThemeData _buildDarkTheme() { secondary: secondaryColor, onPrimary: Colors.white, error: const Color(0xFFB00020), - background: const Color(0xFF202124), + surface: const Color(0xFF202124), ); final ThemeData base = ThemeData( useMaterial3: false, diff --git a/dev/tools/gen_defaults/data/badge.json b/dev/tools/gen_defaults/data/badge.json index 471707bd88fd5..06ca3ef70784a 100644 --- a/dev/tools/gen_defaults/data/badge.json +++ b/dev/tools/gen_defaults/data/badge.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.badge.color": "error", "md.comp.badge.large.color": "error", diff --git a/dev/tools/gen_defaults/data/banner.json b/dev/tools/gen_defaults/data/banner.json index 728016c2954a8..34077c6eae804 100644 --- a/dev/tools/gen_defaults/data/banner.json +++ b/dev/tools/gen_defaults/data/banner.json @@ -1,10 +1,9 @@ { - "version": "v0_162", + "version": "v0_206", - "md.comp.banner.container.color": "surface", + "md.comp.banner.container.color": "surfaceContainerLow", "md.comp.banner.container.elevation": "md.sys.elevation.level1", "md.comp.banner.container.shape": "md.sys.shape.corner.none", - "md.comp.banner.container.surface-tint-layer.color": "surfaceTint", "md.comp.banner.desktop.with-single-line.container.height": 52.0, "md.comp.banner.desktop.with-three-lines.container.height": 90.0, "md.comp.banner.desktop.with-two-lines.with-image.container.height": 72.0, diff --git a/dev/tools/gen_defaults/data/bottom_app_bar.json b/dev/tools/gen_defaults/data/bottom_app_bar.json index 1d515d3db2fe3..7270ab747e98f 100644 --- a/dev/tools/gen_defaults/data/bottom_app_bar.json +++ b/dev/tools/gen_defaults/data/bottom_app_bar.json @@ -1,9 +1,8 @@ { - "version": "v0_162", + "version": "v0_206", - "md.comp.bottom-app-bar.container.color": "surface", + "md.comp.bottom-app-bar.container.color": "surfaceContainer", "md.comp.bottom-app-bar.container.elevation": "md.sys.elevation.level2", "md.comp.bottom-app-bar.container.height": 80.0, - "md.comp.bottom-app-bar.container.shape": "md.sys.shape.corner.none", - "md.comp.bottom-app-bar.container.surface-tint-layer.color": "surfaceTint" + "md.comp.bottom-app-bar.container.shape": "md.sys.shape.corner.none" } diff --git a/dev/tools/gen_defaults/data/button_elevated.json b/dev/tools/gen_defaults/data/button_elevated.json index abac970538787..88a9708a9fcdc 100644 --- a/dev/tools/gen_defaults/data/button_elevated.json +++ b/dev/tools/gen_defaults/data/button_elevated.json @@ -1,18 +1,20 @@ { - "version": "v0_162", + "version": "v0_206", - "md.comp.elevated-button.container.color": "surface", + "md.comp.elevated-button.container.color": "surfaceContainerLow", "md.comp.elevated-button.container.elevation": "md.sys.elevation.level1", "md.comp.elevated-button.container.height": 40.0, "md.comp.elevated-button.container.shadow-color": "shadow", "md.comp.elevated-button.container.shape": "md.sys.shape.corner.full", - "md.comp.elevated-button.container.surface-tint-layer.color": "surfaceTint", "md.comp.elevated-button.disabled.container.color": "onSurface", "md.comp.elevated-button.disabled.container.elevation": "md.sys.elevation.level0", "md.comp.elevated-button.disabled.container.opacity": 0.12, "md.comp.elevated-button.disabled.label-text.color": "onSurface", "md.comp.elevated-button.disabled.label-text.opacity": 0.38, "md.comp.elevated-button.focus.container.elevation": "md.sys.elevation.level1", + "md.comp.elevated-button.focus.indicator.color": "secondary", + "md.comp.elevated-button.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.elevated-button.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.elevated-button.focus.label-text.color": "primary", "md.comp.elevated-button.focus.state-layer.color": "primary", "md.comp.elevated-button.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", diff --git a/dev/tools/gen_defaults/data/button_filled.json b/dev/tools/gen_defaults/data/button_filled.json index 3720b26198945..b0e5b01d4d29b 100644 --- a/dev/tools/gen_defaults/data/button_filled.json +++ b/dev/tools/gen_defaults/data/button_filled.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.filled-button.container.color": "primary", "md.comp.filled-button.container.elevation": "md.sys.elevation.level0", @@ -12,6 +12,9 @@ "md.comp.filled-button.disabled.label-text.color": "onSurface", "md.comp.filled-button.disabled.label-text.opacity": 0.38, "md.comp.filled-button.focus.container.elevation": "md.sys.elevation.level0", + "md.comp.filled-button.focus.indicator.color": "secondary", + "md.comp.filled-button.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.filled-button.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.filled-button.focus.label-text.color": "onPrimary", "md.comp.filled-button.focus.state-layer.color": "onPrimary", "md.comp.filled-button.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", diff --git a/dev/tools/gen_defaults/data/button_filled_tonal.json b/dev/tools/gen_defaults/data/button_filled_tonal.json index badbe27aa333b..a084860e3ee11 100644 --- a/dev/tools/gen_defaults/data/button_filled_tonal.json +++ b/dev/tools/gen_defaults/data/button_filled_tonal.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.filled-tonal-button.container.color": "secondaryContainer", "md.comp.filled-tonal-button.container.elevation": "md.sys.elevation.level0", @@ -12,6 +12,9 @@ "md.comp.filled-tonal-button.disabled.label-text.color": "onSurface", "md.comp.filled-tonal-button.disabled.label-text.opacity": 0.38, "md.comp.filled-tonal-button.focus.container.elevation": "md.sys.elevation.level0", + "md.comp.filled-tonal-button.focus.indicator.color": "secondary", + "md.comp.filled-tonal-button.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.filled-tonal-button.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.filled-tonal-button.focus.label-text.color": "onSecondaryContainer", "md.comp.filled-tonal-button.focus.state-layer.color": "onSecondaryContainer", "md.comp.filled-tonal-button.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", diff --git a/dev/tools/gen_defaults/data/button_outlined.json b/dev/tools/gen_defaults/data/button_outlined.json index 897b0aaea1d00..ffe6b2b05e395 100644 --- a/dev/tools/gen_defaults/data/button_outlined.json +++ b/dev/tools/gen_defaults/data/button_outlined.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.outlined-button.container.height": 40.0, "md.comp.outlined-button.container.shape": "md.sys.shape.corner.full", @@ -7,6 +7,9 @@ "md.comp.outlined-button.disabled.label-text.opacity": 0.38, "md.comp.outlined-button.disabled.outline.color": "onSurface", "md.comp.outlined-button.disabled.outline.opacity": 0.12, + "md.comp.outlined-button.focus.indicator.color": "secondary", + "md.comp.outlined-button.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.outlined-button.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.outlined-button.focus.label-text.color": "primary", "md.comp.outlined-button.focus.outline.color": "primary", "md.comp.outlined-button.focus.state-layer.color": "primary", diff --git a/dev/tools/gen_defaults/data/button_text.json b/dev/tools/gen_defaults/data/button_text.json index 4d05e24462596..24d527cb372ef 100644 --- a/dev/tools/gen_defaults/data/button_text.json +++ b/dev/tools/gen_defaults/data/button_text.json @@ -1,10 +1,13 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.text-button.container.height": 40.0, "md.comp.text-button.container.shape": "md.sys.shape.corner.full", "md.comp.text-button.disabled.label-text.color": "onSurface", "md.comp.text-button.disabled.label-text.opacity": 0.38, + "md.comp.text-button.focus.indicator.color": "secondary", + "md.comp.text-button.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.text-button.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.text-button.focus.label-text.color": "primary", "md.comp.text-button.focus.state-layer.color": "primary", "md.comp.text-button.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", diff --git a/dev/tools/gen_defaults/data/card_elevated.json b/dev/tools/gen_defaults/data/card_elevated.json index 7d071f21f10b8..7178e188ddfa1 100644 --- a/dev/tools/gen_defaults/data/card_elevated.json +++ b/dev/tools/gen_defaults/data/card_elevated.json @@ -1,11 +1,10 @@ { - "version": "v0_162", + "version": "v0_206", - "md.comp.elevated-card.container.color": "surface", + "md.comp.elevated-card.container.color": "surfaceContainerLow", "md.comp.elevated-card.container.elevation": "md.sys.elevation.level1", "md.comp.elevated-card.container.shadow-color": "shadow", "md.comp.elevated-card.container.shape": "md.sys.shape.corner.medium", - "md.comp.elevated-card.container.surface-tint-layer.color": "surfaceTint", "md.comp.elevated-card.disabled.container.color": "surface", "md.comp.elevated-card.disabled.container.elevation": "md.sys.elevation.level1", "md.comp.elevated-card.disabled.container.opacity": 0.38, @@ -13,6 +12,9 @@ "md.comp.elevated-card.dragged.state-layer.color": "onSurface", "md.comp.elevated-card.dragged.state-layer.opacity": "md.sys.state.dragged.state-layer-opacity", "md.comp.elevated-card.focus.container.elevation": "md.sys.elevation.level1", + "md.comp.elevated-card.focus.indicator.color": "secondary", + "md.comp.elevated-card.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.elevated-card.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.elevated-card.focus.state-layer.color": "onSurface", "md.comp.elevated-card.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", "md.comp.elevated-card.hover.container.elevation": "md.sys.elevation.level2", diff --git a/dev/tools/gen_defaults/data/card_filled.json b/dev/tools/gen_defaults/data/card_filled.json index aac015e44eb6d..aaba4abc25b03 100644 --- a/dev/tools/gen_defaults/data/card_filled.json +++ b/dev/tools/gen_defaults/data/card_filled.json @@ -1,7 +1,7 @@ { - "version": "v0_162", + "version": "v0_206", - "md.comp.filled-card.container.color": "surfaceVariant", + "md.comp.filled-card.container.color": "surfaceContainerHighest", "md.comp.filled-card.container.elevation": "md.sys.elevation.level0", "md.comp.filled-card.container.shadow-color": "shadow", "md.comp.filled-card.container.shape": "md.sys.shape.corner.medium", @@ -12,6 +12,9 @@ "md.comp.filled-card.dragged.state-layer.color": "onSurface", "md.comp.filled-card.dragged.state-layer.opacity": "md.sys.state.dragged.state-layer-opacity", "md.comp.filled-card.focus.container.elevation": "md.sys.elevation.level0", + "md.comp.filled-card.focus.indicator.color": "secondary", + "md.comp.filled-card.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.filled-card.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.filled-card.focus.state-layer.color": "onSurface", "md.comp.filled-card.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", "md.comp.filled-card.hover.container.elevation": "md.sys.elevation.level1", diff --git a/dev/tools/gen_defaults/data/card_outlined.json b/dev/tools/gen_defaults/data/card_outlined.json index 8e895966ef701..e257d4759d11b 100644 --- a/dev/tools/gen_defaults/data/card_outlined.json +++ b/dev/tools/gen_defaults/data/card_outlined.json @@ -1,11 +1,10 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.outlined-card.container.color": "surface", "md.comp.outlined-card.container.elevation": "md.sys.elevation.level0", "md.comp.outlined-card.container.shadow-color": "shadow", "md.comp.outlined-card.container.shape": "md.sys.shape.corner.medium", - "md.comp.outlined-card.container.surface-tint-layer.color": "surfaceTint", "md.comp.outlined-card.disabled.container.elevation": "md.sys.elevation.level0", "md.comp.outlined-card.disabled.outline.color": "outline", "md.comp.outlined-card.disabled.outline.opacity": 0.12, @@ -14,6 +13,9 @@ "md.comp.outlined-card.dragged.state-layer.color": "onSurface", "md.comp.outlined-card.dragged.state-layer.opacity": "md.sys.state.dragged.state-layer-opacity", "md.comp.outlined-card.focus.container.elevation": "md.sys.elevation.level0", + "md.comp.outlined-card.focus.indicator.color": "secondary", + "md.comp.outlined-card.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.outlined-card.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.outlined-card.focus.outline.color": "onSurface", "md.comp.outlined-card.focus.state-layer.color": "onSurface", "md.comp.outlined-card.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", diff --git a/dev/tools/gen_defaults/data/carousel_item.json b/dev/tools/gen_defaults/data/carousel_item.json index 0339df413ace4..397356ee7ae76 100644 --- a/dev/tools/gen_defaults/data/carousel_item.json +++ b/dev/tools/gen_defaults/data/carousel_item.json @@ -1,5 +1,5 @@ { - "version": "v0_202", + "version": "v0_206", "md.comp.carousel-item.container.color": "surface", "md.comp.carousel-item.container.elevation": "md.sys.elevation.level0", @@ -9,6 +9,9 @@ "md.comp.carousel-item.disabled.container.elevation": "md.sys.elevation.level0", "md.comp.carousel-item.disabled.container.opacity": 0.38, "md.comp.carousel-item.focus.container.elevation": "md.sys.elevation.level0", + "md.comp.carousel-item.focus.indicator.color": "secondary", + "md.comp.carousel-item.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.carousel-item.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.carousel-item.focus.state-layer.color": "onSurface", "md.comp.carousel-item.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", "md.comp.carousel-item.hover.container.elevation": "md.sys.elevation.level1", diff --git a/dev/tools/gen_defaults/data/checkbox.json b/dev/tools/gen_defaults/data/checkbox.json index 365abdc3ebad7..a6432de2fc7c0 100644 --- a/dev/tools/gen_defaults/data/checkbox.json +++ b/dev/tools/gen_defaults/data/checkbox.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.checkbox.container.size": 18.0, "md.comp.checkbox.error.focus.state-layer.color": "error", @@ -8,6 +8,9 @@ "md.comp.checkbox.error.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity", "md.comp.checkbox.error.pressed.state-layer.color": "error", "md.comp.checkbox.error.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity", + "md.comp.checkbox.focus.indicator.color": "secondary", + "md.comp.checkbox.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.checkbox.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.checkbox.icon.size": 18.0, "md.comp.checkbox.selected.container.color": "primary", "md.comp.checkbox.selected.disabled.container.color": "onSurface", diff --git a/dev/tools/gen_defaults/data/chip_assist.json b/dev/tools/gen_defaults/data/chip_assist.json index 25f18ea8fb08d..b8ecc620f9408 100644 --- a/dev/tools/gen_defaults/data/chip_assist.json +++ b/dev/tools/gen_defaults/data/chip_assist.json @@ -1,16 +1,15 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.assist-chip.container.height": 32.0, "md.comp.assist-chip.container.shape": "md.sys.shape.corner.small", - "md.comp.assist-chip.container.surface-tint-layer.color": "surfaceTint", "md.comp.assist-chip.disabled.label-text.color": "onSurface", "md.comp.assist-chip.disabled.label-text.opacity": 0.38, "md.comp.assist-chip.dragged.container.elevation": "md.sys.elevation.level4", "md.comp.assist-chip.dragged.label-text.color": "onSurface", "md.comp.assist-chip.dragged.state-layer.color": "onSurface", "md.comp.assist-chip.dragged.state-layer.opacity": "md.sys.state.dragged.state-layer-opacity", - "md.comp.assist-chip.elevated.container.color": "surface", + "md.comp.assist-chip.elevated.container.color": "surfaceContainerLow", "md.comp.assist-chip.elevated.container.elevation": "md.sys.elevation.level1", "md.comp.assist-chip.elevated.container.shadow-color": "shadow", "md.comp.assist-chip.elevated.disabled.container.color": "onSurface", @@ -25,6 +24,9 @@ "md.comp.assist-chip.flat.focus.outline.color": "onSurface", "md.comp.assist-chip.flat.outline.color": "outline", "md.comp.assist-chip.flat.outline.width": 1.0, + "md.comp.assist-chip.focus.indicator.color": "secondary", + "md.comp.assist-chip.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.assist-chip.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.assist-chip.focus.label-text.color": "onSurface", "md.comp.assist-chip.focus.state-layer.color": "onSurface", "md.comp.assist-chip.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", diff --git a/dev/tools/gen_defaults/data/chip_filter.json b/dev/tools/gen_defaults/data/chip_filter.json index 094f037e88fce..7d351069ee850 100644 --- a/dev/tools/gen_defaults/data/chip_filter.json +++ b/dev/tools/gen_defaults/data/chip_filter.json @@ -1,9 +1,8 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.filter-chip.container.height": 32.0, "md.comp.filter-chip.container.shape": "md.sys.shape.corner.small", - "md.comp.filter-chip.container.surface-tint-layer.color": "surfaceTint", "md.comp.filter-chip.disabled.label-text.color": "onSurface", "md.comp.filter-chip.disabled.label-text.opacity": 0.38, "md.comp.filter-chip.dragged.container.elevation": "md.sys.elevation.level4", @@ -16,7 +15,7 @@ "md.comp.filter-chip.elevated.hover.container.elevation": "md.sys.elevation.level2", "md.comp.filter-chip.elevated.pressed.container.elevation": "md.sys.elevation.level1", "md.comp.filter-chip.elevated.selected.container.color": "secondaryContainer", - "md.comp.filter-chip.elevated.unselected.container.color": "surface", + "md.comp.filter-chip.elevated.unselected.container.color": "surfaceContainerLow", "md.comp.filter-chip.flat.container.elevation": "md.sys.elevation.level0", "md.comp.filter-chip.flat.disabled.selected.container.color": "onSurface", "md.comp.filter-chip.flat.disabled.selected.container.opacity": 0.12, @@ -33,6 +32,9 @@ "md.comp.filter-chip.flat.unselected.outline.color": "outline", "md.comp.filter-chip.flat.unselected.outline.width": 1.0, "md.comp.filter-chip.flat.unselected.pressed.container.elevation": "md.sys.elevation.level0", + "md.comp.filter-chip.focus.indicator.color": "secondary", + "md.comp.filter-chip.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.filter-chip.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.filter-chip.label-text.text-style": "labelLarge", "md.comp.filter-chip.selected.dragged.label-text.color": "onSecondaryContainer", "md.comp.filter-chip.selected.dragged.state-layer.color": "onSecondaryContainer", diff --git a/dev/tools/gen_defaults/data/chip_input.json b/dev/tools/gen_defaults/data/chip_input.json index 260cab06a696a..80b42b47dd3a0 100644 --- a/dev/tools/gen_defaults/data/chip_input.json +++ b/dev/tools/gen_defaults/data/chip_input.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.input-chip.container.elevation": "md.sys.elevation.level0", "md.comp.input-chip.container.height": 32.0, @@ -11,6 +11,9 @@ "md.comp.input-chip.disabled.unselected.outline.color": "onSurface", "md.comp.input-chip.disabled.unselected.outline.opacity": 0.12, "md.comp.input-chip.dragged.container.elevation": "md.sys.elevation.level4", + "md.comp.input-chip.focus.indicator.color": "secondary", + "md.comp.input-chip.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.input-chip.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.input-chip.label-text.text-style": "labelLarge", "md.comp.input-chip.selected.container.color": "secondaryContainer", "md.comp.input-chip.selected.dragged.label-text.color": "onSecondaryContainer", diff --git a/dev/tools/gen_defaults/data/chip_suggestion.json b/dev/tools/gen_defaults/data/chip_suggestion.json index baac7a41a33c2..e9c1ecb139502 100644 --- a/dev/tools/gen_defaults/data/chip_suggestion.json +++ b/dev/tools/gen_defaults/data/chip_suggestion.json @@ -1,16 +1,15 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.suggestion-chip.container.height": 32.0, "md.comp.suggestion-chip.container.shape": "md.sys.shape.corner.small", - "md.comp.suggestion-chip.container.surface-tint-layer.color": "surfaceTint", "md.comp.suggestion-chip.disabled.label-text.color": "onSurface", "md.comp.suggestion-chip.disabled.label-text.opacity": 0.38, "md.comp.suggestion-chip.dragged.container.elevation": "md.sys.elevation.level4", "md.comp.suggestion-chip.dragged.label-text.color": "onSurfaceVariant", "md.comp.suggestion-chip.dragged.state-layer.color": "onSurfaceVariant", "md.comp.suggestion-chip.dragged.state-layer.opacity": "md.sys.state.dragged.state-layer-opacity", - "md.comp.suggestion-chip.elevated.container.color": "surface", + "md.comp.suggestion-chip.elevated.container.color": "surfaceContainerLow", "md.comp.suggestion-chip.elevated.container.elevation": "md.sys.elevation.level1", "md.comp.suggestion-chip.elevated.container.shadow-color": "shadow", "md.comp.suggestion-chip.elevated.disabled.container.color": "onSurface", @@ -25,6 +24,9 @@ "md.comp.suggestion-chip.flat.focus.outline.color": "onSurfaceVariant", "md.comp.suggestion-chip.flat.outline.color": "outline", "md.comp.suggestion-chip.flat.outline.width": 1.0, + "md.comp.suggestion-chip.focus.indicator.color": "secondary", + "md.comp.suggestion-chip.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.suggestion-chip.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.suggestion-chip.focus.label-text.color": "onSurfaceVariant", "md.comp.suggestion-chip.focus.state-layer.color": "onSurfaceVariant", "md.comp.suggestion-chip.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", diff --git a/dev/tools/gen_defaults/data/color_dark.json b/dev/tools/gen_defaults/data/color_dark.json index e36a9ccceecfe..bed87ae9cb4fa 100644 --- a/dev/tools/gen_defaults/data/color_dark.json +++ b/dev/tools/gen_defaults/data/color_dark.json @@ -1,7 +1,7 @@ { - "version": "v0_162", + "version": "v0_206", - "md.sys.color.background": "md.ref.palette.neutral10", + "md.sys.color.background": "md.ref.palette.neutral6", "md.sys.color.error": "md.ref.palette.error80", "md.sys.color.error-container": "md.ref.palette.error30", "md.sys.color.inverse-on-surface": "md.ref.palette.neutral20", @@ -36,7 +36,7 @@ "md.sys.color.secondary-fixed": "md.ref.palette.secondary90", "md.sys.color.secondary-fixed-dim": "md.ref.palette.secondary80", "md.sys.color.shadow": "md.ref.palette.neutral0", - "md.sys.color.surface": "md.ref.palette.neutral10", + "md.sys.color.surface": "md.ref.palette.neutral6", "md.sys.color.surface-bright": "md.ref.palette.neutral24", "md.sys.color.surface-container": "md.ref.palette.neutral12", "md.sys.color.surface-container-high": "md.ref.palette.neutral17", diff --git a/dev/tools/gen_defaults/data/color_light.json b/dev/tools/gen_defaults/data/color_light.json index fd7be56a13a67..5ca7bdcb2a22d 100644 --- a/dev/tools/gen_defaults/data/color_light.json +++ b/dev/tools/gen_defaults/data/color_light.json @@ -1,7 +1,7 @@ { - "version": "v0_162", + "version": "v0_206", - "md.sys.color.background": "md.ref.palette.neutral99", + "md.sys.color.background": "md.ref.palette.neutral98", "md.sys.color.error": "md.ref.palette.error40", "md.sys.color.error-container": "md.ref.palette.error90", "md.sys.color.inverse-on-surface": "md.ref.palette.neutral95", @@ -36,7 +36,7 @@ "md.sys.color.secondary-fixed": "md.ref.palette.secondary90", "md.sys.color.secondary-fixed-dim": "md.ref.palette.secondary80", "md.sys.color.shadow": "md.ref.palette.neutral0", - "md.sys.color.surface": "md.ref.palette.neutral99", + "md.sys.color.surface": "md.ref.palette.neutral98", "md.sys.color.surface-bright": "md.ref.palette.neutral98", "md.sys.color.surface-container": "md.ref.palette.neutral94", "md.sys.color.surface-container-high": "md.ref.palette.neutral92", diff --git a/dev/tools/gen_defaults/data/date_picker_docked.json b/dev/tools/gen_defaults/data/date_picker_docked.json index 4ab28db36c1c5..a8812e75876f1 100644 --- a/dev/tools/gen_defaults/data/date_picker_docked.json +++ b/dev/tools/gen_defaults/data/date_picker_docked.json @@ -1,11 +1,10 @@ { - "version": "v0_162", + "version": "v0_206", - "md.comp.date-picker.docked.container.color": "surface", + "md.comp.date-picker.docked.container.color": "surfaceContainerHigh", "md.comp.date-picker.docked.container.elevation": "md.sys.elevation.level3", "md.comp.date-picker.docked.container.height": 456.0, "md.comp.date-picker.docked.container.shape": "md.sys.shape.corner.large", - "md.comp.date-picker.docked.container.surface-tint-layer.color": "surfaceTint", "md.comp.date-picker.docked.container.width": 360.0, "md.comp.date-picker.docked.date.container.height": 48.0, "md.comp.date-picker.docked.date.container.shape": "md.sys.shape.corner.full", diff --git a/dev/tools/gen_defaults/data/date_picker_input_modal.json b/dev/tools/gen_defaults/data/date_picker_input_modal.json index b6f0faec5055d..96c9bf21fec57 100644 --- a/dev/tools/gen_defaults/data/date_picker_input_modal.json +++ b/dev/tools/gen_defaults/data/date_picker_input_modal.json @@ -1,11 +1,10 @@ { - "version": "v0_162", + "version": "v0_206", - "md.comp.date-input.modal.container.color": "surface", + "md.comp.date-input.modal.container.color": "surfaceContainerHigh", "md.comp.date-input.modal.container.elevation": "md.sys.elevation.level3", "md.comp.date-input.modal.container.height": 512.0, "md.comp.date-input.modal.container.shape": "md.sys.shape.corner.extra-large", - "md.comp.date-input.modal.container.surface-tint-layer.color": "surfaceTint", "md.comp.date-input.modal.container.width": 328.0, "md.comp.date-input.modal.header.container.height": 120.0, "md.comp.date-input.modal.header.container.width": 328.0, diff --git a/dev/tools/gen_defaults/data/date_picker_modal.json b/dev/tools/gen_defaults/data/date_picker_modal.json index 84a3ffae84fc0..259bd8fad33c7 100644 --- a/dev/tools/gen_defaults/data/date_picker_modal.json +++ b/dev/tools/gen_defaults/data/date_picker_modal.json @@ -1,11 +1,10 @@ { - "version": "v0_162", + "version": "v0_206", - "md.comp.date-picker.modal.container.color": "surface", + "md.comp.date-picker.modal.container.color": "surfaceContainerHigh", "md.comp.date-picker.modal.container.elevation": "md.sys.elevation.level3", "md.comp.date-picker.modal.container.height": 568.0, "md.comp.date-picker.modal.container.shape": "md.sys.shape.corner.extra-large", - "md.comp.date-picker.modal.container.surface-tint-layer.color": "surfaceTint", "md.comp.date-picker.modal.container.width": 360.0, "md.comp.date-picker.modal.date.container.height": 40.0, "md.comp.date-picker.modal.date.container.shape": "md.sys.shape.corner.full", diff --git a/dev/tools/gen_defaults/data/dialog.json b/dev/tools/gen_defaults/data/dialog.json index 6fe28cbc6b709..579f2b5379839 100644 --- a/dev/tools/gen_defaults/data/dialog.json +++ b/dev/tools/gen_defaults/data/dialog.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.dialog.action.focus.label-text.color": "primary", "md.comp.dialog.action.focus.state-layer.color": "primary", @@ -12,10 +12,9 @@ "md.comp.dialog.action.pressed.label-text.color": "primary", "md.comp.dialog.action.pressed.state-layer.color": "primary", "md.comp.dialog.action.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity", - "md.comp.dialog.container.color": "surface", + "md.comp.dialog.container.color": "surfaceContainerHigh", "md.comp.dialog.container.elevation": "md.sys.elevation.level3", "md.comp.dialog.container.shape": "md.sys.shape.corner.extra-large", - "md.comp.dialog.container.surface-tint-layer.color": "surfaceTint", "md.comp.dialog.headline.color": "onSurface", "md.comp.dialog.headline.text-style": "headlineSmall", "md.comp.dialog.supporting-text.color": "onSurfaceVariant", diff --git a/dev/tools/gen_defaults/data/dialog_fullscreen.json b/dev/tools/gen_defaults/data/dialog_fullscreen.json index 9eb61d42066ac..66d898d7571ec 100644 --- a/dev/tools/gen_defaults/data/dialog_fullscreen.json +++ b/dev/tools/gen_defaults/data/dialog_fullscreen.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.full-screen-dialog.container.color": "surface", "md.comp.full-screen-dialog.container.elevation": "md.sys.elevation.level0", @@ -18,10 +18,10 @@ "md.comp.full-screen-dialog.header.container.color": "surface", "md.comp.full-screen-dialog.header.container.elevation": "md.sys.elevation.level0", "md.comp.full-screen-dialog.header.container.height": 56.0, - "md.comp.full-screen-dialog.header.container.surface-tint-layer.color": "surfaceTint", "md.comp.full-screen-dialog.header.headline.color": "onSurface", "md.comp.full-screen-dialog.header.headline.text-style": "titleLarge", "md.comp.full-screen-dialog.header.icon.color": "onSurface", "md.comp.full-screen-dialog.header.icon.size": 24.0, + "md.comp.full-screen-dialog.header.on-scroll.container.color": "surfaceContainer", "md.comp.full-screen-dialog.header.on-scroll.container.elevation": "md.sys.elevation.level2" } diff --git a/dev/tools/gen_defaults/data/divider.json b/dev/tools/gen_defaults/data/divider.json index 2f8c946d6a502..58fc1391465e3 100644 --- a/dev/tools/gen_defaults/data/divider.json +++ b/dev/tools/gen_defaults/data/divider.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.divider.color": "outlineVariant", "md.comp.divider.thickness": 1.0 diff --git a/dev/tools/gen_defaults/data/elevation.json b/dev/tools/gen_defaults/data/elevation.json index f1f2939e66fb4..365b6a18e76ea 100644 --- a/dev/tools/gen_defaults/data/elevation.json +++ b/dev/tools/gen_defaults/data/elevation.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.sys.elevation.level0": 0.0, "md.sys.elevation.level1": 1.0, diff --git a/dev/tools/gen_defaults/data/fab_extended_primary.json b/dev/tools/gen_defaults/data/fab_extended_primary.json index 39855aab83a64..3214de762068c 100644 --- a/dev/tools/gen_defaults/data/fab_extended_primary.json +++ b/dev/tools/gen_defaults/data/fab_extended_primary.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.extended-fab.primary.container.color": "primaryContainer", "md.comp.extended-fab.primary.container.elevation": "md.sys.elevation.level3", @@ -8,6 +8,9 @@ "md.comp.extended-fab.primary.container.shape": "md.sys.shape.corner.large", "md.comp.extended-fab.primary.focus.container.elevation": "md.sys.elevation.level3", "md.comp.extended-fab.primary.focus.icon.color": "onPrimaryContainer", + "md.comp.extended-fab.primary.focus.indicator.color": "secondary", + "md.comp.extended-fab.primary.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.extended-fab.primary.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.extended-fab.primary.focus.label-text.color": "onPrimaryContainer", "md.comp.extended-fab.primary.focus.state-layer.color": "onPrimaryContainer", "md.comp.extended-fab.primary.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", diff --git a/dev/tools/gen_defaults/data/fab_large_primary.json b/dev/tools/gen_defaults/data/fab_large_primary.json index e0c71251b10b4..aadbb96d1d45f 100644 --- a/dev/tools/gen_defaults/data/fab_large_primary.json +++ b/dev/tools/gen_defaults/data/fab_large_primary.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.fab.primary.large.container.color": "primaryContainer", "md.comp.fab.primary.large.container.elevation": "md.sys.elevation.level3", @@ -9,6 +9,9 @@ "md.comp.fab.primary.large.container.width": 96.0, "md.comp.fab.primary.large.focus.container.elevation": "md.sys.elevation.level3", "md.comp.fab.primary.large.focus.icon.color": "onPrimaryContainer", + "md.comp.fab.primary.large.focus.indicator.color": "secondary", + "md.comp.fab.primary.large.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.fab.primary.large.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.fab.primary.large.focus.state-layer.color": "onPrimaryContainer", "md.comp.fab.primary.large.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", "md.comp.fab.primary.large.hover.container.elevation": "md.sys.elevation.level4", diff --git a/dev/tools/gen_defaults/data/fab_primary.json b/dev/tools/gen_defaults/data/fab_primary.json index f5e3d5adb87a1..82da7e3b76d96 100644 --- a/dev/tools/gen_defaults/data/fab_primary.json +++ b/dev/tools/gen_defaults/data/fab_primary.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.fab.primary.container.color": "primaryContainer", "md.comp.fab.primary.container.elevation": "md.sys.elevation.level3", @@ -9,6 +9,9 @@ "md.comp.fab.primary.container.width": 56.0, "md.comp.fab.primary.focus.container.elevation": "md.sys.elevation.level3", "md.comp.fab.primary.focus.icon.color": "onPrimaryContainer", + "md.comp.fab.primary.focus.indicator.color": "secondary", + "md.comp.fab.primary.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.fab.primary.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.fab.primary.focus.state-layer.color": "onPrimaryContainer", "md.comp.fab.primary.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", "md.comp.fab.primary.hover.container.elevation": "md.sys.elevation.level4", diff --git a/dev/tools/gen_defaults/data/fab_small_primary.json b/dev/tools/gen_defaults/data/fab_small_primary.json index bde0cd640bae8..03aa08f2ff8f9 100644 --- a/dev/tools/gen_defaults/data/fab_small_primary.json +++ b/dev/tools/gen_defaults/data/fab_small_primary.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.fab.primary.small.container.color": "primaryContainer", "md.comp.fab.primary.small.container.elevation": "md.sys.elevation.level3", @@ -9,6 +9,9 @@ "md.comp.fab.primary.small.container.width": 40.0, "md.comp.fab.primary.small.focus.container.elevation": "md.sys.elevation.level3", "md.comp.fab.primary.small.focus.icon.color": "onPrimaryContainer", + "md.comp.fab.primary.small.focus.indicator.color": "secondary", + "md.comp.fab.primary.small.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.fab.primary.small.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.fab.primary.small.focus.state-layer.color": "onPrimaryContainer", "md.comp.fab.primary.small.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", "md.comp.fab.primary.small.hover.container.elevation": "md.sys.elevation.level4", diff --git a/dev/tools/gen_defaults/data/icon_button.json b/dev/tools/gen_defaults/data/icon_button.json index be7678825adcb..187f534a32e61 100644 --- a/dev/tools/gen_defaults/data/icon_button.json +++ b/dev/tools/gen_defaults/data/icon_button.json @@ -1,8 +1,11 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.icon-button.disabled.icon.color": "onSurface", "md.comp.icon-button.disabled.icon.opacity": 0.38, + "md.comp.icon-button.focus.indicator.color": "secondary", + "md.comp.icon-button.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.icon-button.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.icon-button.icon.size": 24.0, "md.comp.icon-button.selected.focus.icon.color": "primary", "md.comp.icon-button.selected.focus.state-layer.color": "primary", @@ -14,8 +17,9 @@ "md.comp.icon-button.selected.pressed.icon.color": "primary", "md.comp.icon-button.selected.pressed.state-layer.color": "primary", "md.comp.icon-button.selected.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity", + "md.comp.icon-button.state-layer.height": 40.0, "md.comp.icon-button.state-layer.shape": "md.sys.shape.corner.full", - "md.comp.icon-button.state-layer.size": 40.0, + "md.comp.icon-button.state-layer.width": 40.0, "md.comp.icon-button.unselected.focus.icon.color": "onSurfaceVariant", "md.comp.icon-button.unselected.focus.state-layer.color": "onSurfaceVariant", "md.comp.icon-button.unselected.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", diff --git a/dev/tools/gen_defaults/data/icon_button_filled.json b/dev/tools/gen_defaults/data/icon_button_filled.json index eebf003b0fdf3..8d827d75923eb 100644 --- a/dev/tools/gen_defaults/data/icon_button_filled.json +++ b/dev/tools/gen_defaults/data/icon_button_filled.json @@ -1,14 +1,18 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.filled-icon-button.container.color": "primary", + "md.comp.filled-icon-button.container.height": 40.0, "md.comp.filled-icon-button.container.shape": "md.sys.shape.corner.full", - "md.comp.filled-icon-button.container.size": 40.0, + "md.comp.filled-icon-button.container.width": 40.0, "md.comp.filled-icon-button.disabled.container.color": "onSurface", "md.comp.filled-icon-button.disabled.container.opacity": 0.12, "md.comp.filled-icon-button.disabled.icon.color": "onSurface", "md.comp.filled-icon-button.disabled.icon.opacity": 0.38, "md.comp.filled-icon-button.focus.icon.color": "onPrimary", + "md.comp.filled-icon-button.focus.indicator.color": "secondary", + "md.comp.filled-icon-button.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.filled-icon-button.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.filled-icon-button.focus.state-layer.color": "onPrimary", "md.comp.filled-icon-button.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", "md.comp.filled-icon-button.hover.icon.color": "onPrimary", @@ -34,5 +38,5 @@ "md.comp.filled-icon-button.toggle.unselected.icon.color": "primary", "md.comp.filled-icon-button.toggle.unselected.pressed.icon.color": "primary", "md.comp.filled-icon-button.toggle.unselected.pressed.state-layer.color": "primary", - "md.comp.filled-icon-button.unselected.container.color": "surfaceVariant" + "md.comp.filled-icon-button.unselected.container.color": "surfaceContainerHighest" } diff --git a/dev/tools/gen_defaults/data/icon_button_filled_tonal.json b/dev/tools/gen_defaults/data/icon_button_filled_tonal.json index 8d61d263cb76d..9b02d06135db2 100644 --- a/dev/tools/gen_defaults/data/icon_button_filled_tonal.json +++ b/dev/tools/gen_defaults/data/icon_button_filled_tonal.json @@ -1,14 +1,18 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.filled-tonal-icon-button.container.color": "secondaryContainer", + "md.comp.filled-tonal-icon-button.container.height": 40.0, "md.comp.filled-tonal-icon-button.container.shape": "md.sys.shape.corner.full", - "md.comp.filled-tonal-icon-button.container.size": 40.0, + "md.comp.filled-tonal-icon-button.container.width": 40.0, "md.comp.filled-tonal-icon-button.disabled.container.color": "onSurface", "md.comp.filled-tonal-icon-button.disabled.container.opacity": 0.12, "md.comp.filled-tonal-icon-button.disabled.icon.color": "onSurface", "md.comp.filled-tonal-icon-button.disabled.icon.opacity": 0.38, "md.comp.filled-tonal-icon-button.focus.icon.color": "onSecondaryContainer", + "md.comp.filled-tonal-icon-button.focus.indicator.color": "secondary", + "md.comp.filled-tonal-icon-button.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.filled-tonal-icon-button.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.filled-tonal-icon-button.focus.state-layer.color": "onSecondaryContainer", "md.comp.filled-tonal-icon-button.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", "md.comp.filled-tonal-icon-button.hover.icon.color": "onSecondaryContainer", @@ -34,5 +38,5 @@ "md.comp.filled-tonal-icon-button.toggle.unselected.icon.color": "onSurfaceVariant", "md.comp.filled-tonal-icon-button.toggle.unselected.pressed.icon.color": "onSurfaceVariant", "md.comp.filled-tonal-icon-button.toggle.unselected.pressed.state-layer.color": "onSurfaceVariant", - "md.comp.filled-tonal-icon-button.unselected.container.color": "surfaceVariant" + "md.comp.filled-tonal-icon-button.unselected.container.color": "surfaceContainerHighest" } diff --git a/dev/tools/gen_defaults/data/icon_button_outlined.json b/dev/tools/gen_defaults/data/icon_button_outlined.json index 7c0106684a2cf..2edf60d22e559 100644 --- a/dev/tools/gen_defaults/data/icon_button_outlined.json +++ b/dev/tools/gen_defaults/data/icon_button_outlined.json @@ -1,14 +1,18 @@ { - "version": "v0_162", + "version": "v0_206", + "md.comp.outlined-icon-button.container.height": 40.0, "md.comp.outlined-icon-button.container.shape": "md.sys.shape.corner.full", - "md.comp.outlined-icon-button.container.size": 40.0, + "md.comp.outlined-icon-button.container.width": 40.0, "md.comp.outlined-icon-button.disabled.icon.color": "onSurface", "md.comp.outlined-icon-button.disabled.icon.opacity": 0.38, "md.comp.outlined-icon-button.disabled.selected.container.color": "onSurface", "md.comp.outlined-icon-button.disabled.selected.container.opacity": 0.12, "md.comp.outlined-icon-button.disabled.unselected.outline.color": "onSurface", "md.comp.outlined-icon-button.disabled.unselected.outline.opacity": 0.12, + "md.comp.outlined-icon-button.focus.indicator.color": "secondary", + "md.comp.outlined-icon-button.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.outlined-icon-button.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.outlined-icon-button.focus.state-layer.opacity": "md.sys.state.hover.state-layer-opacity", "md.comp.outlined-icon-button.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity", "md.comp.outlined-icon-button.icon.size": 24.0, diff --git a/dev/tools/gen_defaults/data/list.json b/dev/tools/gen_defaults/data/list.json index a557a2da27d93..442b203d521cc 100644 --- a/dev/tools/gen_defaults/data/list.json +++ b/dev/tools/gen_defaults/data/list.json @@ -1,6 +1,11 @@ { - "version": "v0_162", + "version": "v0_206", + "md.comp.list.divider.leading-space": 16.0, + "md.comp.list.divider.trailing-space": 16.0, + "md.comp.list.focus.indicator.color": "secondary", + "md.comp.list.focus.indicator.outline.offset": "md.sys.state.focus-indicator.inner-offset", + "md.comp.list.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.list.list-item.container.color": "surface", "md.comp.list.list-item.container.elevation": "md.sys.elevation.level0", "md.comp.list.list-item.container.shape": "md.sys.shape.corner.none", @@ -37,10 +42,11 @@ "md.comp.list.list-item.leading-avatar.shape": "md.sys.shape.corner.full", "md.comp.list.list-item.leading-avatar.size": 40.0, "md.comp.list.list-item.leading-icon.color": "onSurfaceVariant", - "md.comp.list.list-item.leading-icon.size": 18.0, + "md.comp.list.list-item.leading-icon.size": 24.0, "md.comp.list.list-item.leading-image.height": 56.0, "md.comp.list.list-item.leading-image.shape": "md.sys.shape.corner.none", "md.comp.list.list-item.leading-image.width": 56.0, + "md.comp.list.list-item.leading-space": 16.0, "md.comp.list.list-item.leading-video.shape": "md.sys.shape.corner.none", "md.comp.list.list-item.leading-video.width": 100.0, "md.comp.list.list-item.one-line.container.height": 56.0, @@ -58,6 +64,7 @@ "md.comp.list.list-item.three-line.container.height": 88.0, "md.comp.list.list-item.trailing-icon.color": "onSurfaceVariant", "md.comp.list.list-item.trailing-icon.size": 24.0, + "md.comp.list.list-item.trailing-space": 16.0, "md.comp.list.list-item.trailing-supporting-text.color": "onSurfaceVariant", "md.comp.list.list-item.trailing-supporting-text.text-style": "labelSmall", "md.comp.list.list-item.two-line.container.height": 72.0, diff --git a/dev/tools/gen_defaults/data/menu.json b/dev/tools/gen_defaults/data/menu.json index 979154547703f..76cb65cd0e8a0 100644 --- a/dev/tools/gen_defaults/data/menu.json +++ b/dev/tools/gen_defaults/data/menu.json @@ -1,10 +1,15 @@ { - "version": "v0_162", + "version": "v0_206", - "md.comp.menu.container.color": "surface", + "md.comp.menu.container.color": "surfaceContainer", "md.comp.menu.container.elevation": "md.sys.elevation.level2", "md.comp.menu.container.shadow-color": "shadow", "md.comp.menu.container.shape": "md.sys.shape.corner.extra-small", - "md.comp.menu.container.surface-tint-layer.color": "surfaceTint", - "md.comp.menu.list-item.selected.container.color": "surfaceVariant" + "md.comp.menu.focus.indicator.color": "secondary", + "md.comp.menu.focus.indicator.outline.offset": "md.sys.state.focus-indicator.inner-offset", + "md.comp.menu.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", + "md.comp.menu.list-item.selected.container.color": "secondaryContainer", + "md.comp.menu.list-item.selected.label-text.color": "onSecondaryContainer", + "md.comp.menu.list-item.selected.with-leading-icon.trailing-icon.color": "onSecondaryContainer", + "md.comp.menu.menu-list-item-with-leading-icon-icon-color": "onSecondaryContainer" } diff --git a/dev/tools/gen_defaults/data/motion.json b/dev/tools/gen_defaults/data/motion.json index 90c1fab6ad1dc..4b708de7ea4b6 100644 --- a/dev/tools/gen_defaults/data/motion.json +++ b/dev/tools/gen_defaults/data/motion.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.sys.motion.duration.extra-long1Ms": 700.0, "md.sys.motion.duration.extra-long2Ms": 800.0, diff --git a/dev/tools/gen_defaults/data/navigation_bar.json b/dev/tools/gen_defaults/data/navigation_bar.json index c972fba4ca56b..7803d9fdf4bd0 100644 --- a/dev/tools/gen_defaults/data/navigation_bar.json +++ b/dev/tools/gen_defaults/data/navigation_bar.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.navigation-bar.active.focus.icon.color": "onSecondaryContainer", "md.comp.navigation-bar.active.focus.label-text.color": "onSurface", @@ -16,11 +16,13 @@ "md.comp.navigation-bar.active.pressed.icon.color": "onSecondaryContainer", "md.comp.navigation-bar.active.pressed.label-text.color": "onSurface", "md.comp.navigation-bar.active.pressed.state-layer.color": "onSurface", - "md.comp.navigation-bar.container.color": "surface", + "md.comp.navigation-bar.container.color": "surfaceContainer", "md.comp.navigation-bar.container.elevation": "md.sys.elevation.level2", "md.comp.navigation-bar.container.height": 80.0, "md.comp.navigation-bar.container.shape": "md.sys.shape.corner.none", - "md.comp.navigation-bar.container.surface-tint-layer.color": "surfaceTint", + "md.comp.navigation-bar.focus.indicator.color": "secondary", + "md.comp.navigation-bar.focus.indicator.outline.offset": "md.sys.state.focus-indicator.inner-offset", + "md.comp.navigation-bar.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.navigation-bar.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", "md.comp.navigation-bar.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity", "md.comp.navigation-bar.icon.size": 24.0, diff --git a/dev/tools/gen_defaults/data/navigation_drawer.json b/dev/tools/gen_defaults/data/navigation_drawer.json index c33b58d8d4766..6eda37d009d6f 100644 --- a/dev/tools/gen_defaults/data/navigation_drawer.json +++ b/dev/tools/gen_defaults/data/navigation_drawer.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.navigation-drawer.active.focus.icon.color": "onSecondaryContainer", "md.comp.navigation-drawer.active.focus.label-text.color": "onSecondaryContainer", @@ -17,11 +17,12 @@ "md.comp.navigation-drawer.active.pressed.label-text.color": "onSecondaryContainer", "md.comp.navigation-drawer.active.pressed.state-layer.color": "onSecondaryContainer", "md.comp.navigation-drawer.bottom.container.shape": "md.sys.shape.corner.large.top", - "md.comp.navigation-drawer.container.color": "surface", "md.comp.navigation-drawer.container.height": 100.0, "md.comp.navigation-drawer.container.shape": "md.sys.shape.corner.large.end", - "md.comp.navigation-drawer.container.surface-tint-layer.color": "surfaceTint", "md.comp.navigation-drawer.container.width": 360.0, + "md.comp.navigation-drawer.focus.indicator.color": "secondary", + "md.comp.navigation-drawer.focus.indicator.outline.offset": "md.sys.state.focus-indicator.inner-offset", + "md.comp.navigation-drawer.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.navigation-drawer.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", "md.comp.navigation-drawer.headline.color": "onSurfaceVariant", "md.comp.navigation-drawer.headline.text-style": "titleSmall", @@ -41,7 +42,9 @@ "md.comp.navigation-drawer.label-text.text-style": "labelLarge", "md.comp.navigation-drawer.large-badge-label.color": "onSurfaceVariant", "md.comp.navigation-drawer.large-badge-label.text-style": "labelLarge", + "md.comp.navigation-drawer.modal.container.color": "surfaceContainerLow", "md.comp.navigation-drawer.modal.container.elevation": "md.sys.elevation.level1", "md.comp.navigation-drawer.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity", + "md.comp.navigation-drawer.standard.container.color": "surface", "md.comp.navigation-drawer.standard.container.elevation": "md.sys.elevation.level0" } diff --git a/dev/tools/gen_defaults/data/navigation_rail.json b/dev/tools/gen_defaults/data/navigation_rail.json index 23c164b579106..f58bd1ae5bb23 100644 --- a/dev/tools/gen_defaults/data/navigation_rail.json +++ b/dev/tools/gen_defaults/data/navigation_rail.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.navigation-rail.active.focus.icon.color": "onSecondaryContainer", "md.comp.navigation-rail.active.focus.label-text.color": "onSurface", @@ -35,17 +35,6 @@ "md.comp.navigation-rail.inactive.pressed.label-text.color": "onSurface", "md.comp.navigation-rail.inactive.pressed.state-layer.color": "onSurface", "md.comp.navigation-rail.label-text.text-style": "labelMedium", - "md.comp.navigation-rail.menu.focus.icon.color": "onSurface", - "md.comp.navigation-rail.menu.focus.state-layer.color": "onSurface", - "md.comp.navigation-rail.menu.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", - "md.comp.navigation-rail.menu.hover.icon.color": "onSurface", - "md.comp.navigation-rail.menu.hover.state-layer.color": "onSurface", - "md.comp.navigation-rail.menu.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity", - "md.comp.navigation-rail.menu.icon.color": "onSurfaceVariant", - "md.comp.navigation-rail.menu.icon.size": 24.0, - "md.comp.navigation-rail.menu.pressed.icon.color": "onSurface", - "md.comp.navigation-rail.menu.pressed.state-layer.color": "onSurface", - "md.comp.navigation-rail.menu.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity", "md.comp.navigation-rail.no-label.active-indicator.height": 56.0, "md.comp.navigation-rail.no-label.active-indicator.shape": "md.sys.shape.corner.full", "md.comp.navigation-rail.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity" diff --git a/dev/tools/gen_defaults/data/navigation_tab_primary.json b/dev/tools/gen_defaults/data/navigation_tab_primary.json index 3dc16c3df1a81..d3873d1773802 100644 --- a/dev/tools/gen_defaults/data/navigation_tab_primary.json +++ b/dev/tools/gen_defaults/data/navigation_tab_primary.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.primary-navigation-tab.active.focus.state-layer.color": "primary", "md.comp.primary-navigation-tab.active.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", @@ -13,8 +13,9 @@ "md.comp.primary-navigation-tab.container.elevation": "md.sys.elevation.level0", "md.comp.primary-navigation-tab.container.height": 48.0, "md.comp.primary-navigation-tab.container.shape": "md.sys.shape.corner.none", - "md.comp.primary-navigation-tab.divider.color": "surfaceVariant", - "md.comp.primary-navigation-tab.divider.height": 1.0, + "md.comp.primary-navigation-tab.focus.indicator.color": "secondary", + "md.comp.primary-navigation-tab.focus.indicator.outline.offset": "md.sys.state.focus-indicator.inner-offset", + "md.comp.primary-navigation-tab.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.primary-navigation-tab.inactive.focus.state-layer.color": "onSurface", "md.comp.primary-navigation-tab.inactive.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", "md.comp.primary-navigation-tab.inactive.hover.state-layer.color": "onSurface", diff --git a/dev/tools/gen_defaults/data/navigation_tab_secondary.json b/dev/tools/gen_defaults/data/navigation_tab_secondary.json index ab773d1cee484..3b172c57285f4 100644 --- a/dev/tools/gen_defaults/data/navigation_tab_secondary.json +++ b/dev/tools/gen_defaults/data/navigation_tab_secondary.json @@ -1,14 +1,17 @@ { - "version": "v0_162", + "version": "v0_206", + "md.comp.secondary-navigation-tab.active-indicator.color": "primary", + "md.comp.secondary-navigation-tab.active-indicator.height": 2.0, "md.comp.secondary-navigation-tab.active.label-text.color": "onSurface", "md.comp.secondary-navigation-tab.container.color": "surface", "md.comp.secondary-navigation-tab.container.elevation": "md.sys.elevation.level0", "md.comp.secondary-navigation-tab.container.height": 48.0, "md.comp.secondary-navigation-tab.container.shadow-color": "shadow", "md.comp.secondary-navigation-tab.container.shape": "md.sys.shape.corner.none", - "md.comp.secondary-navigation-tab.divider.color": "surfaceVariant", - "md.comp.secondary-navigation-tab.divider.height": 1.0, + "md.comp.secondary-navigation-tab.focus.indicator.color": "secondary", + "md.comp.secondary-navigation-tab.focus.indicator.outline.offset": "md.sys.state.focus-indicator.inner-offset", + "md.comp.secondary-navigation-tab.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.secondary-navigation-tab.focus.label-text.color": "onSurface", "md.comp.secondary-navigation-tab.focus.state-layer.color": "onSurface", "md.comp.secondary-navigation-tab.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", diff --git a/dev/tools/gen_defaults/data/palette.json b/dev/tools/gen_defaults/data/palette.json index fbdddbf3a1055..89fe3ef8ad382 100644 --- a/dev/tools/gen_defaults/data/palette.json +++ b/dev/tools/gen_defaults/data/palette.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.ref.palette.black": "0xFF000000", "md.ref.palette.error0": "0xFF000000", @@ -16,29 +16,29 @@ "md.ref.palette.error95": "0xFFFCEEEE", "md.ref.palette.error99": "0xFFFFFBF9", "md.ref.palette.neutral0": "0xFF000000", - "md.ref.palette.neutral10": "0xFF1C1B1F", + "md.ref.palette.neutral10": "0xFF1D1B20", "md.ref.palette.neutral100": "0xFFFFFFFF", - "md.ref.palette.neutral12": "0xFF201F23", - "md.ref.palette.neutral17": "0xFF2B292D", - "md.ref.palette.neutral20": "0xFF313033", - "md.ref.palette.neutral22": "0xFF313033", - "md.ref.palette.neutral24": "0xFF313033", - "md.ref.palette.neutral30": "0xFF484649", - "md.ref.palette.neutral4": "0xFF0E0E11", - "md.ref.palette.neutral40": "0xFF605D62", - "md.ref.palette.neutral50": "0xFF787579", - "md.ref.palette.neutral6": "0xFF141317", - "md.ref.palette.neutral60": "0xFF939094", - "md.ref.palette.neutral70": "0xFFAEAAAE", - "md.ref.palette.neutral80": "0xFFC9C5CA", - "md.ref.palette.neutral87": "0xFFDDD8DD", - "md.ref.palette.neutral90": "0xFFE6E1E5", - "md.ref.palette.neutral92": "0xFFECE7EC", - "md.ref.palette.neutral94": "0xFFF1ECF1", - "md.ref.palette.neutral95": "0xFFF4EFF4", - "md.ref.palette.neutral96": "0xFFF7F2F7", - "md.ref.palette.neutral98": "0xFFFDF8FD", - "md.ref.palette.neutral99": "0xFFFFFBFE", + "md.ref.palette.neutral12": "0xFF211F26", + "md.ref.palette.neutral17": "0xFF2B2930", + "md.ref.palette.neutral20": "0xFF322F35", + "md.ref.palette.neutral22": "0xFF36343B", + "md.ref.palette.neutral24": "0xFF3B383E", + "md.ref.palette.neutral30": "0xFF48464C", + "md.ref.palette.neutral4": "0xFF0F0D13", + "md.ref.palette.neutral40": "0xFF605D64", + "md.ref.palette.neutral50": "0xFF79767D", + "md.ref.palette.neutral6": "0xFF141218", + "md.ref.palette.neutral60": "0xFF938F96", + "md.ref.palette.neutral70": "0xFFAEA9B1", + "md.ref.palette.neutral80": "0xFFCAC5CD", + "md.ref.palette.neutral87": "0xFFDED8E1", + "md.ref.palette.neutral90": "0xFFE6E0E9", + "md.ref.palette.neutral92": "0xFFECE6F0", + "md.ref.palette.neutral94": "0xFFF3EDF7", + "md.ref.palette.neutral95": "0xFFF5EFF7", + "md.ref.palette.neutral96": "0xFFF7F2FA", + "md.ref.palette.neutral98": "0xFFFEF7FF", + "md.ref.palette.neutral99": "0xFFFFFBFF", "md.ref.palette.neutral-variant0": "0xFF000000", "md.ref.palette.neutral-variant10": "0xFF1D1A22", "md.ref.palette.neutral-variant100": "0xFFFFFFFF", diff --git a/dev/tools/gen_defaults/data/progress_indicator_circular.json b/dev/tools/gen_defaults/data/progress_indicator_circular.json index 0a78f60ad4fc1..8af3fbfc9f8e1 100644 --- a/dev/tools/gen_defaults/data/progress_indicator_circular.json +++ b/dev/tools/gen_defaults/data/progress_indicator_circular.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.circular-progress-indicator.active-indicator.color": "primary", "md.comp.circular-progress-indicator.active-indicator.shape": "md.sys.shape.corner.none", diff --git a/dev/tools/gen_defaults/data/progress_indicator_linear.json b/dev/tools/gen_defaults/data/progress_indicator_linear.json index 47aaa9b06f659..1f80069d475a1 100644 --- a/dev/tools/gen_defaults/data/progress_indicator_linear.json +++ b/dev/tools/gen_defaults/data/progress_indicator_linear.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.linear-progress-indicator.active-indicator.color": "primary", "md.comp.linear-progress-indicator.active-indicator.height": 4.0, @@ -8,7 +8,7 @@ "md.comp.linear-progress-indicator.four-color.active-indicator.one.color": "primary", "md.comp.linear-progress-indicator.four-color.active-indicator.three.color": "tertiary", "md.comp.linear-progress-indicator.four-color.active-indicator.two.color": "primaryContainer", - "md.comp.linear-progress-indicator.track.color": "surfaceVariant", + "md.comp.linear-progress-indicator.track.color": "surfaceContainerHighest", "md.comp.linear-progress-indicator.track.height": 4.0, "md.comp.linear-progress-indicator.track.shape": "md.sys.shape.corner.none" } diff --git a/dev/tools/gen_defaults/data/radio_button.json b/dev/tools/gen_defaults/data/radio_button.json index b42e69620696e..df8cafa024dc7 100644 --- a/dev/tools/gen_defaults/data/radio_button.json +++ b/dev/tools/gen_defaults/data/radio_button.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.radio-button.disabled.selected.icon.color": "onSurface", "md.comp.radio-button.disabled.selected.icon.opacity": 0.38, diff --git a/dev/tools/gen_defaults/data/search_bar.json b/dev/tools/gen_defaults/data/search_bar.json index 8c3ba0c1d38d4..f329a9c1f41cd 100644 --- a/dev/tools/gen_defaults/data/search_bar.json +++ b/dev/tools/gen_defaults/data/search_bar.json @@ -1,13 +1,15 @@ { - "version": "v0_158", + "version": "v0_206", "md.comp.search-bar.avatar.shape": "md.sys.shape.corner.full", "md.comp.search-bar.avatar.size": 30.0, - "md.comp.search-bar.container.color": "surface", + "md.comp.search-bar.container.color": "surfaceContainerHigh", "md.comp.search-bar.container.elevation": "md.sys.elevation.level3", "md.comp.search-bar.container.height": 56.0, "md.comp.search-bar.container.shape": "md.sys.shape.corner.full", - "md.comp.search-bar.container.surface-tint-layer.color": "surfaceTint", + "md.comp.search-bar.focus.indicator.color": "secondary", + "md.comp.search-bar.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.search-bar.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.search-bar.hover.state-layer.color": "onSurface", "md.comp.search-bar.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity", "md.comp.search-bar.hover.supporting-text.color": "onSurfaceVariant", diff --git a/dev/tools/gen_defaults/data/search_view.json b/dev/tools/gen_defaults/data/search_view.json index 506f5a2a15ad9..a53dd32debf8d 100644 --- a/dev/tools/gen_defaults/data/search_view.json +++ b/dev/tools/gen_defaults/data/search_view.json @@ -1,9 +1,8 @@ { - "version": "v0_158", + "version": "v0_206", - "md.comp.search-view.container.color": "surface", + "md.comp.search-view.container.color": "surfaceContainerHigh", "md.comp.search-view.container.elevation": "md.sys.elevation.level3", - "md.comp.search-view.container.surface-tint-layer.color": "surfaceTint", "md.comp.search-view.divider.color": "outline", "md.comp.search-view.docked.container.shape": "md.sys.shape.corner.extra-large", "md.comp.search-view.docked.header.container.height": 56.0, diff --git a/dev/tools/gen_defaults/data/segmented_button_outlined.json b/dev/tools/gen_defaults/data/segmented_button_outlined.json index b5aed0515a9be..8d3488bac59a4 100644 --- a/dev/tools/gen_defaults/data/segmented_button_outlined.json +++ b/dev/tools/gen_defaults/data/segmented_button_outlined.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.outlined-segmented-button.container.height": 40.0, "md.comp.outlined-segmented-button.disabled.icon.color": "onSurface", @@ -8,6 +8,9 @@ "md.comp.outlined-segmented-button.disabled.label-text.opacity": 0.38, "md.comp.outlined-segmented-button.disabled.outline.color": "onSurface", "md.comp.outlined-segmented-button.disabled.outline.opacity": 0.12, + "md.comp.outlined-segmented-button.focus.indicator.color": "secondary", + "md.comp.outlined-segmented-button.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.outlined-segmented-button.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.outlined-segmented-button.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", "md.comp.outlined-segmented-button.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity", "md.comp.outlined-segmented-button.label-text.text-style": "labelLarge", diff --git a/dev/tools/gen_defaults/data/shape.json b/dev/tools/gen_defaults/data/shape.json index 988cd5be1dcb6..0176c0b06a539 100644 --- a/dev/tools/gen_defaults/data/shape.json +++ b/dev/tools/gen_defaults/data/shape.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.sys.shape.corner.extra-large": { "family": "SHAPE_FAMILY_ROUNDED_CORNERS", diff --git a/dev/tools/gen_defaults/data/sheet_bottom.json b/dev/tools/gen_defaults/data/sheet_bottom.json index 53e4c227e1233..e137916a0e0dc 100644 --- a/dev/tools/gen_defaults/data/sheet_bottom.json +++ b/dev/tools/gen_defaults/data/sheet_bottom.json @@ -1,14 +1,15 @@ { - "version": "v0_162", + "version": "v0_206", - "md.comp.sheet.bottom.docked.container.color": "surface", + "md.comp.sheet.bottom.docked.container.color": "surfaceContainerLow", "md.comp.sheet.bottom.docked.container.shape": "md.sys.shape.corner.extra-large.top", - "md.comp.sheet.bottom.docked.container.surface-tint-layer.color": "surfaceTint", "md.comp.sheet.bottom.docked.drag-handle.color": "onSurfaceVariant", "md.comp.sheet.bottom.docked.drag-handle.height": 4.0, - "md.comp.sheet.bottom.docked.drag-handle.opacity": 0.4, "md.comp.sheet.bottom.docked.drag-handle.width": 32.0, "md.comp.sheet.bottom.docked.minimized.container.shape": "md.sys.shape.corner.none", "md.comp.sheet.bottom.docked.modal.container.elevation": "md.sys.elevation.level1", - "md.comp.sheet.bottom.docked.standard.container.elevation": "md.sys.elevation.level1" + "md.comp.sheet.bottom.docked.standard.container.elevation": "md.sys.elevation.level1", + "md.comp.sheet.bottom.focus.indicator.color": "secondary", + "md.comp.sheet.bottom.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.sheet.bottom.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness" } diff --git a/dev/tools/gen_defaults/data/slider.json b/dev/tools/gen_defaults/data/slider.json index f7d7579e273ed..9dfda742b1468 100644 --- a/dev/tools/gen_defaults/data/slider.json +++ b/dev/tools/gen_defaults/data/slider.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.slider.active.track.color": "primary", "md.comp.slider.active.track.height": 4.0, @@ -23,7 +23,7 @@ "md.comp.slider.hover.handle.color": "primary", "md.comp.slider.hover.state-layer.color": "primary", "md.comp.slider.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity", - "md.comp.slider.inactive.track.color": "surfaceVariant", + "md.comp.slider.inactive.track.color": "surfaceContainerHighest", "md.comp.slider.inactive.track.height": 4.0, "md.comp.slider.inactive.track.shape": "md.sys.shape.corner.full", "md.comp.slider.label.container.color": "primary", diff --git a/dev/tools/gen_defaults/data/snackbar.json b/dev/tools/gen_defaults/data/snackbar.json index 79e059815bf82..e2cfbd2be40bb 100644 --- a/dev/tools/gen_defaults/data/snackbar.json +++ b/dev/tools/gen_defaults/data/snackbar.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.snackbar.action.focus.label-text.color": "inversePrimary", "md.comp.snackbar.action.focus.state-layer.color": "inversePrimary", diff --git a/dev/tools/gen_defaults/data/state.json b/dev/tools/gen_defaults/data/state.json index e7bb1ce8063e3..6556e10b7728b 100644 --- a/dev/tools/gen_defaults/data/state.json +++ b/dev/tools/gen_defaults/data/state.json @@ -1,8 +1,8 @@ { - "version": "v0_162", + "version": "v0_206", "md.sys.state.dragged.state-layer-opacity": 0.16, - "md.sys.state.focus.state-layer-opacity": 0.12, + "md.sys.state.focus.state-layer-opacity": 0.1, "md.sys.state.hover.state-layer-opacity": 0.08, - "md.sys.state.pressed.state-layer-opacity": 0.12 + "md.sys.state.pressed.state-layer-opacity": 0.1 } diff --git a/dev/tools/gen_defaults/data/switch.json b/dev/tools/gen_defaults/data/switch.json index c8c5b511065d8..dd45bed57c85d 100644 --- a/dev/tools/gen_defaults/data/switch.json +++ b/dev/tools/gen_defaults/data/switch.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.switch.disabled.selected.handle.color": "surface", "md.comp.switch.disabled.selected.handle.opacity": 1.0, @@ -9,10 +9,13 @@ "md.comp.switch.disabled.track.opacity": 0.12, "md.comp.switch.disabled.unselected.handle.color": "onSurface", "md.comp.switch.disabled.unselected.handle.opacity": 0.38, - "md.comp.switch.disabled.unselected.icon.color": "surfaceVariant", + "md.comp.switch.disabled.unselected.icon.color": "surfaceContainerHighest", "md.comp.switch.disabled.unselected.icon.opacity": 0.38, - "md.comp.switch.disabled.unselected.track.color": "surfaceVariant", + "md.comp.switch.disabled.unselected.track.color": "surfaceContainerHighest", "md.comp.switch.disabled.unselected.track.outline.color": "onSurface", + "md.comp.switch.focus.indicator.color": "secondary", + "md.comp.switch.focus.indicator.offset": "md.sys.state.focus-indicator.outer-offset", + "md.comp.switch.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.switch.handle.shape": "md.sys.shape.corner.full", "md.comp.switch.pressed.handle.height": 28.0, "md.comp.switch.pressed.handle.width": 28.0, @@ -44,29 +47,29 @@ "md.comp.switch.track.shape": "md.sys.shape.corner.full", "md.comp.switch.track.width": 52.0, "md.comp.switch.unselected.focus.handle.color": "onSurfaceVariant", - "md.comp.switch.unselected.focus.icon.color": "surfaceVariant", + "md.comp.switch.unselected.focus.icon.color": "surfaceContainerHighest", "md.comp.switch.unselected.focus.state-layer.color": "onSurface", "md.comp.switch.unselected.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity", - "md.comp.switch.unselected.focus.track.color": "surfaceVariant", + "md.comp.switch.unselected.focus.track.color": "surfaceContainerHighest", "md.comp.switch.unselected.focus.track.outline.color": "outline", "md.comp.switch.unselected.handle.color": "outline", "md.comp.switch.unselected.handle.height": 16.0, "md.comp.switch.unselected.handle.width": 16.0, "md.comp.switch.unselected.hover.handle.color": "onSurfaceVariant", - "md.comp.switch.unselected.hover.icon.color": "surfaceVariant", + "md.comp.switch.unselected.hover.icon.color": "surfaceContainerHighest", "md.comp.switch.unselected.hover.state-layer.color": "onSurface", "md.comp.switch.unselected.hover.state-layer.opacity": "md.sys.state.hover.state-layer-opacity", - "md.comp.switch.unselected.hover.track.color": "surfaceVariant", + "md.comp.switch.unselected.hover.track.color": "surfaceContainerHighest", "md.comp.switch.unselected.hover.track.outline.color": "outline", - "md.comp.switch.unselected.icon.color": "surfaceVariant", + "md.comp.switch.unselected.icon.color": "surfaceContainerHighest", "md.comp.switch.unselected.icon.size": 16.0, "md.comp.switch.unselected.pressed.handle.color": "onSurfaceVariant", - "md.comp.switch.unselected.pressed.icon.color": "surfaceVariant", + "md.comp.switch.unselected.pressed.icon.color": "surfaceContainerHighest", "md.comp.switch.unselected.pressed.state-layer.color": "onSurface", "md.comp.switch.unselected.pressed.state-layer.opacity": "md.sys.state.pressed.state-layer-opacity", - "md.comp.switch.unselected.pressed.track.color": "surfaceVariant", + "md.comp.switch.unselected.pressed.track.color": "surfaceContainerHighest", "md.comp.switch.unselected.pressed.track.outline.color": "outline", - "md.comp.switch.unselected.track.color": "surfaceVariant", + "md.comp.switch.unselected.track.color": "surfaceContainerHighest", "md.comp.switch.unselected.track.outline.color": "outline", "md.comp.switch.with-icon.handle.height": 24.0, "md.comp.switch.with-icon.handle.width": 24.0 diff --git a/dev/tools/gen_defaults/data/text_field_filled.json b/dev/tools/gen_defaults/data/text_field_filled.json index f0f2f2f393590..d1eb6756623e7 100644 --- a/dev/tools/gen_defaults/data/text_field_filled.json +++ b/dev/tools/gen_defaults/data/text_field_filled.json @@ -1,10 +1,10 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.filled-text-field.active-indicator.color": "onSurfaceVariant", "md.comp.filled-text-field.active-indicator.height": 1.0, "md.comp.filled-text-field.caret.color": "primary", - "md.comp.filled-text-field.container.color": "surfaceVariant", + "md.comp.filled-text-field.container.color": "surfaceContainerHighest", "md.comp.filled-text-field.container.shape": "md.sys.shape.corner.extra-small.top", "md.comp.filled-text-field.disabled.active-indicator.color": "onSurface", "md.comp.filled-text-field.disabled.active-indicator.height": 1.0, @@ -44,6 +44,7 @@ "md.comp.filled-text-field.error.trailing-icon.color": "error", "md.comp.filled-text-field.focus.active-indicator.color": "primary", "md.comp.filled-text-field.focus.active-indicator.height": 2.0, + "md.comp.filled-text-field.focus.active-indicator.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.filled-text-field.focus.input-text.color": "onSurface", "md.comp.filled-text-field.focus.label-text.color": "primary", "md.comp.filled-text-field.focus.leading-icon.color": "onSurfaceVariant", diff --git a/dev/tools/gen_defaults/data/text_field_outlined.json b/dev/tools/gen_defaults/data/text_field_outlined.json index 26f442d47d7ce..44d5ae6ad626d 100644 --- a/dev/tools/gen_defaults/data/text_field_outlined.json +++ b/dev/tools/gen_defaults/data/text_field_outlined.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.outlined-text-field.caret.color": "primary", "md.comp.outlined-text-field.container.shape": "md.sys.shape.corner.extra-small", @@ -17,6 +17,7 @@ "md.comp.outlined-text-field.disabled.trailing-icon.color": "onSurface", "md.comp.outlined-text-field.disabled.trailing-icon.opacity": 0.38, "md.comp.outlined-text-field.error.focus.caret.color": "error", + "md.comp.outlined-text-field.error.focus.indicator.outline.color": "error", "md.comp.outlined-text-field.error.focus.input-text.color": "onSurface", "md.comp.outlined-text-field.error.focus.label-text.color": "error", "md.comp.outlined-text-field.error.focus.leading-icon.color": "onSurfaceVariant", @@ -35,6 +36,8 @@ "md.comp.outlined-text-field.error.outline.color": "error", "md.comp.outlined-text-field.error.supporting-text.color": "error", "md.comp.outlined-text-field.error.trailing-icon.color": "error", + "md.comp.outlined-text-field.focus.indicator.outline.color": "secondary", + "md.comp.outlined-text-field.focus.indicator.outline.thickness": "md.sys.state.focus-indicator.thickness", "md.comp.outlined-text-field.focus.input-text.color": "onSurface", "md.comp.outlined-text-field.focus.label-text.color": "primary", "md.comp.outlined-text-field.focus.leading-icon.color": "onSurfaceVariant", diff --git a/dev/tools/gen_defaults/data/text_style.json b/dev/tools/gen_defaults/data/text_style.json index 019da1e61dbd0..0eeb1fcb9ad13 100644 --- a/dev/tools/gen_defaults/data/text_style.json +++ b/dev/tools/gen_defaults/data/text_style.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.sys.typescale.body-large.font": "md.ref.typeface.plain", "md.sys.typescale.body-large.line-height": 24.0, diff --git a/dev/tools/gen_defaults/data/time_picker.json b/dev/tools/gen_defaults/data/time_picker.json index 3ac8ae33c5815..e2e146816857b 100644 --- a/dev/tools/gen_defaults/data/time_picker.json +++ b/dev/tools/gen_defaults/data/time_picker.json @@ -1,7 +1,7 @@ { - "version": "v0_162", + "version": "v0_206", - "md.comp.time-picker.clock-dial.color": "surfaceVariant", + "md.comp.time-picker.clock-dial.color": "surfaceContainerHighest", "md.comp.time-picker.clock-dial.container.size": 256.0, "md.comp.time-picker.clock-dial.label-text.text-style": "bodyLarge", "md.comp.time-picker.clock-dial.selected.label-text.color": "onPrimary", @@ -15,7 +15,7 @@ "md.comp.time-picker.clock-dial.selector.track.container.width": 2.0, "md.comp.time-picker.clock-dial.shape": "md.sys.shape.corner.full", "md.comp.time-picker.clock-dial.unselected.label-text.color": "onSurface", - "md.comp.time-picker.container.color": "surface", + "md.comp.time-picker.container.color": "surfaceContainerHigh", "md.comp.time-picker.container.elevation": "md.sys.elevation.level3", "md.comp.time-picker.container.shape": "md.sys.shape.corner.extra-large", "md.comp.time-picker.headline.color": "onSurfaceVariant", @@ -46,7 +46,6 @@ "md.comp.time-picker.period-selector.unselected.pressed.state-layer.color": "onSurfaceVariant", "md.comp.time-picker.period-selector.vertical.container.height": 80.0, "md.comp.time-picker.period-selector.vertical.container.width": 52.0, - "md.comp.time-picker.surface-tint-layer.color": "surfaceTint", "md.comp.time-picker.time-selector.24h-vertical.container.width": 114.0, "md.comp.time-picker.time-selector.container.height": 80.0, "md.comp.time-picker.time-selector.container.shape": "md.sys.shape.corner.small", @@ -65,7 +64,7 @@ "md.comp.time-picker.time-selector.selected.pressed.state-layer.color": "onPrimaryContainer", "md.comp.time-picker.time-selector.separator.color": "onSurface", "md.comp.time-picker.time-selector.separator.text-style": "displayLarge", - "md.comp.time-picker.time-selector.unselected.container.color": "surfaceVariant", + "md.comp.time-picker.time-selector.unselected.container.color": "surfaceContainerHighest", "md.comp.time-picker.time-selector.unselected.focus.label-text.color": "onSurface", "md.comp.time-picker.time-selector.unselected.focus.state-layer.color": "onSurface", "md.comp.time-picker.time-selector.unselected.hover.label-text.color": "onSurface", diff --git a/dev/tools/gen_defaults/data/top_app_bar_large.json b/dev/tools/gen_defaults/data/top_app_bar_large.json index bc2d979d76ef5..9da1d8c0fce71 100644 --- a/dev/tools/gen_defaults/data/top_app_bar_large.json +++ b/dev/tools/gen_defaults/data/top_app_bar_large.json @@ -1,11 +1,10 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.top-app-bar.large.container.color": "surface", "md.comp.top-app-bar.large.container.elevation": "md.sys.elevation.level0", "md.comp.top-app-bar.large.container.height": 152.0, "md.comp.top-app-bar.large.container.shape": "md.sys.shape.corner.none", - "md.comp.top-app-bar.large.container.surface-tint-layer.color": "surfaceTint", "md.comp.top-app-bar.large.headline.color": "onSurface", "md.comp.top-app-bar.large.headline.text-style": "headlineMedium", "md.comp.top-app-bar.large.leading-icon.color": "onSurface", diff --git a/dev/tools/gen_defaults/data/top_app_bar_medium.json b/dev/tools/gen_defaults/data/top_app_bar_medium.json index 39ff113b61847..9a5e6d941cab1 100644 --- a/dev/tools/gen_defaults/data/top_app_bar_medium.json +++ b/dev/tools/gen_defaults/data/top_app_bar_medium.json @@ -1,11 +1,10 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.top-app-bar.medium.container.color": "surface", "md.comp.top-app-bar.medium.container.elevation": "md.sys.elevation.level0", "md.comp.top-app-bar.medium.container.height": 112.0, "md.comp.top-app-bar.medium.container.shape": "md.sys.shape.corner.none", - "md.comp.top-app-bar.medium.container.surface-tint-layer.color": "surfaceTint", "md.comp.top-app-bar.medium.headline.color": "onSurface", "md.comp.top-app-bar.medium.headline.text-style": "headlineSmall", "md.comp.top-app-bar.medium.leading-icon.color": "onSurface", diff --git a/dev/tools/gen_defaults/data/top_app_bar_small.json b/dev/tools/gen_defaults/data/top_app_bar_small.json index 90053e02f26e0..24f5affa6c1e3 100644 --- a/dev/tools/gen_defaults/data/top_app_bar_small.json +++ b/dev/tools/gen_defaults/data/top_app_bar_small.json @@ -1,15 +1,15 @@ { - "version": "v0_162", + "version": "v0_206", "md.comp.top-app-bar.small.container.color": "surface", "md.comp.top-app-bar.small.container.elevation": "md.sys.elevation.level0", "md.comp.top-app-bar.small.container.height": 64.0, "md.comp.top-app-bar.small.container.shape": "md.sys.shape.corner.none", - "md.comp.top-app-bar.small.container.surface-tint-layer.color": "surfaceTint", "md.comp.top-app-bar.small.headline.color": "onSurface", "md.comp.top-app-bar.small.headline.text-style": "titleLarge", "md.comp.top-app-bar.small.leading-icon.color": "onSurface", "md.comp.top-app-bar.small.leading-icon.size": 24.0, + "md.comp.top-app-bar.small.on-scroll.container.color": "surfaceContainer", "md.comp.top-app-bar.small.on-scroll.container.elevation": "md.sys.elevation.level2", "md.comp.top-app-bar.small.trailing-icon.color": "onSurfaceVariant", "md.comp.top-app-bar.small.trailing-icon.size": 24.0 diff --git a/dev/tools/gen_defaults/data/typeface.json b/dev/tools/gen_defaults/data/typeface.json index f32100baadb6f..02dbc65448617 100644 --- a/dev/tools/gen_defaults/data/typeface.json +++ b/dev/tools/gen_defaults/data/typeface.json @@ -1,5 +1,5 @@ { - "version": "v0_162", + "version": "v0_206", "md.ref.typeface.brand": "Roboto", "md.ref.typeface.plain": "Roboto", diff --git a/dev/tools/gen_defaults/generated/used_tokens.csv b/dev/tools/gen_defaults/generated/used_tokens.csv index e40d24932f64d..12446e1df3aa0 100644 --- a/dev/tools/gen_defaults/generated/used_tokens.csv +++ b/dev/tools/gen_defaults/generated/used_tokens.csv @@ -1,7 +1,5 @@ -Versions used, v0_162, v0_202, v0_158 +Versions used, v0_206 md.comp.assist-chip.container.shape, -md.comp.assist-chip.container.surface-tint-layer.color, -md.comp.assist-chip.disabled.label-text.color, md.comp.assist-chip.elevated.container.elevation, md.comp.assist-chip.elevated.container.shadow-color, md.comp.assist-chip.elevated.disabled.container.color, @@ -25,13 +23,11 @@ md.comp.badge.large.size, md.comp.badge.size, md.comp.banner.container.color, md.comp.banner.container.elevation, -md.comp.banner.container.surface-tint-layer.color, md.comp.banner.supporting-text.text-style, md.comp.bottom-app-bar.container.color, md.comp.bottom-app-bar.container.elevation, md.comp.bottom-app-bar.container.height, md.comp.bottom-app-bar.container.shape, -md.comp.bottom-app-bar.container.surface-tint-layer.color, md.comp.checkbox.error.focus.state-layer.color, md.comp.checkbox.error.focus.state-layer.opacity, md.comp.checkbox.error.hover.state-layer.color, @@ -75,7 +71,6 @@ md.comp.circular-progress-indicator.active-indicator.color, md.comp.date-picker.modal.container.color, md.comp.date-picker.modal.container.elevation, md.comp.date-picker.modal.container.shape, -md.comp.date-picker.modal.container.surface-tint-layer.color, md.comp.date-picker.modal.date.focus.state-layer.opacity, md.comp.date-picker.modal.date.hover.state-layer.opacity, md.comp.date-picker.modal.date.label-text.text-style, @@ -124,7 +119,6 @@ md.comp.date-picker.modal.year-selection.year.unselected.pressed.state-layer.col md.comp.dialog.container.color, md.comp.dialog.container.elevation, md.comp.dialog.container.shape, -md.comp.dialog.container.surface-tint-layer.color, md.comp.dialog.headline.text-style, md.comp.dialog.supporting-text.text-style, md.comp.divider.color, @@ -134,7 +128,6 @@ md.comp.elevated-button.container.elevation, md.comp.elevated-button.container.height, md.comp.elevated-button.container.shadow-color, md.comp.elevated-button.container.shape, -md.comp.elevated-button.container.surface-tint-layer.color, md.comp.elevated-button.disabled.container.color, md.comp.elevated-button.disabled.container.elevation, md.comp.elevated-button.disabled.container.opacity, @@ -155,7 +148,6 @@ md.comp.elevated-card.container.color, md.comp.elevated-card.container.elevation, md.comp.elevated-card.container.shadow-color, md.comp.elevated-card.container.shape, -md.comp.elevated-card.container.surface-tint-layer.color, md.comp.extended-fab.primary.container.height, md.comp.extended-fab.primary.container.shape, md.comp.extended-fab.primary.icon.size, @@ -210,8 +202,9 @@ md.comp.filled-card.container.elevation, md.comp.filled-card.container.shadow-color, md.comp.filled-card.container.shape, md.comp.filled-icon-button.container.color, +md.comp.filled-icon-button.container.height, md.comp.filled-icon-button.container.shape, -md.comp.filled-icon-button.container.size, +md.comp.filled-icon-button.container.width, md.comp.filled-icon-button.disabled.container.color, md.comp.filled-icon-button.disabled.container.opacity, md.comp.filled-icon-button.disabled.icon.color, @@ -300,8 +293,9 @@ md.comp.filled-tonal-button.pressed.container.elevation, md.comp.filled-tonal-button.pressed.state-layer.color, md.comp.filled-tonal-button.pressed.state-layer.opacity, md.comp.filled-tonal-icon-button.container.color, +md.comp.filled-tonal-icon-button.container.height, md.comp.filled-tonal-icon-button.container.shape, -md.comp.filled-tonal-icon-button.container.size, +md.comp.filled-tonal-icon-button.container.width, md.comp.filled-tonal-icon-button.disabled.container.color, md.comp.filled-tonal-icon-button.disabled.container.opacity, md.comp.filled-tonal-icon-button.disabled.icon.color, @@ -325,8 +319,6 @@ md.comp.filled-tonal-icon-button.toggle.unselected.icon.color, md.comp.filled-tonal-icon-button.toggle.unselected.pressed.state-layer.color, md.comp.filled-tonal-icon-button.unselected.container.color, md.comp.filter-chip.container.shape, -md.comp.filter-chip.container.surface-tint-layer.color, -md.comp.filter-chip.disabled.label-text.color, md.comp.filter-chip.elevated.container.elevation, md.comp.filter-chip.elevated.container.shadow-color, md.comp.filter-chip.elevated.disabled.container.color, @@ -364,7 +356,6 @@ md.comp.icon-button.selected.icon.color, md.comp.icon-button.selected.pressed.state-layer.color, md.comp.icon-button.selected.pressed.state-layer.opacity, md.comp.icon-button.state-layer.shape, -md.comp.icon-button.state-layer.size, md.comp.icon-button.unselected.focus.state-layer.color, md.comp.icon-button.unselected.focus.state-layer.opacity, md.comp.icon-button.unselected.hover.state-layer.color, @@ -425,7 +416,6 @@ md.comp.menu.container.color, md.comp.menu.container.elevation, md.comp.menu.container.shadow-color, md.comp.menu.container.shape, -md.comp.menu.container.surface-tint-layer.color, md.comp.navigation-bar.active-indicator.color, md.comp.navigation-bar.active-indicator.shape, md.comp.navigation-bar.active.icon.color, @@ -433,7 +423,6 @@ md.comp.navigation-bar.active.label-text.color, md.comp.navigation-bar.container.color, md.comp.navigation-bar.container.elevation, md.comp.navigation-bar.container.height, -md.comp.navigation-bar.container.surface-tint-layer.color, md.comp.navigation-bar.icon.size, md.comp.navigation-bar.inactive.icon.color, md.comp.navigation-bar.inactive.label-text.color, @@ -444,12 +433,11 @@ md.comp.navigation-drawer.active-indicator.shape, md.comp.navigation-drawer.active-indicator.width, md.comp.navigation-drawer.active.icon.color, md.comp.navigation-drawer.active.label-text.color, -md.comp.navigation-drawer.container.color, -md.comp.navigation-drawer.container.surface-tint-layer.color, md.comp.navigation-drawer.icon.size, md.comp.navigation-drawer.inactive.icon.color, md.comp.navigation-drawer.inactive.label-text.color, md.comp.navigation-drawer.label-text.text-style, +md.comp.navigation-drawer.modal.container.color, md.comp.navigation-drawer.modal.container.elevation, md.comp.navigation-rail.active-indicator.color, md.comp.navigation-rail.active-indicator.shape, @@ -483,11 +471,11 @@ md.comp.outlined-card.container.color, md.comp.outlined-card.container.elevation, md.comp.outlined-card.container.shadow-color, md.comp.outlined-card.container.shape, -md.comp.outlined-card.container.surface-tint-layer.color, md.comp.outlined-card.outline.color, md.comp.outlined-card.outline.width, +md.comp.outlined-icon-button.container.height, md.comp.outlined-icon-button.container.shape, -md.comp.outlined-icon-button.container.size, +md.comp.outlined-icon-button.container.width, md.comp.outlined-icon-button.disabled.icon.color, md.comp.outlined-icon-button.disabled.icon.opacity, md.comp.outlined-icon-button.disabled.selected.container.color, @@ -556,8 +544,6 @@ md.comp.primary-navigation-tab.active.hover.state-layer.color, md.comp.primary-navigation-tab.active.hover.state-layer.opacity, md.comp.primary-navigation-tab.active.pressed.state-layer.color, md.comp.primary-navigation-tab.active.pressed.state-layer.opacity, -md.comp.primary-navigation-tab.divider.color, -md.comp.primary-navigation-tab.divider.height, md.comp.primary-navigation-tab.inactive.focus.state-layer.color, md.comp.primary-navigation-tab.inactive.focus.state-layer.opacity, md.comp.primary-navigation-tab.inactive.hover.state-layer.color, @@ -595,7 +581,6 @@ md.comp.search-bar.container.color, md.comp.search-bar.container.elevation, md.comp.search-bar.container.height, md.comp.search-bar.container.shape, -md.comp.search-bar.container.surface-tint-layer.color, md.comp.search-bar.hover.state-layer.color, md.comp.search-bar.hover.state-layer.opacity, md.comp.search-bar.input-text.color, @@ -606,7 +591,6 @@ md.comp.search-bar.supporting-text.color, md.comp.search-bar.supporting-text.text-style, md.comp.search-view.container.color, md.comp.search-view.container.elevation, -md.comp.search-view.container.surface-tint-layer.color, md.comp.search-view.divider.color, md.comp.search-view.docked.container.shape, md.comp.search-view.full-screen.container.shape, @@ -616,8 +600,6 @@ md.comp.search-view.header.input-text.text-style, md.comp.search-view.header.supporting-text.color, md.comp.search-view.header.supporting-text.text-style, md.comp.secondary-navigation-tab.active.label-text.color, -md.comp.secondary-navigation-tab.divider.color, -md.comp.secondary-navigation-tab.divider.height, md.comp.secondary-navigation-tab.focus.state-layer.color, md.comp.secondary-navigation-tab.focus.state-layer.opacity, md.comp.secondary-navigation-tab.hover.state-layer.color, @@ -628,10 +610,8 @@ md.comp.secondary-navigation-tab.pressed.state-layer.color, md.comp.secondary-navigation-tab.pressed.state-layer.opacity, md.comp.sheet.bottom.docked.container.color, md.comp.sheet.bottom.docked.container.shape, -md.comp.sheet.bottom.docked.container.surface-tint-layer.color, md.comp.sheet.bottom.docked.drag-handle.color, md.comp.sheet.bottom.docked.drag-handle.height, -md.comp.sheet.bottom.docked.drag-handle.opacity, md.comp.sheet.bottom.docked.drag-handle.width, md.comp.sheet.bottom.docked.modal.container.elevation, md.comp.sheet.bottom.docked.standard.container.elevation, @@ -801,7 +781,6 @@ md.comp.top-app-bar.medium.headline.text-style, md.comp.top-app-bar.small.container.color, md.comp.top-app-bar.small.container.elevation, md.comp.top-app-bar.small.container.height, -md.comp.top-app-bar.small.container.surface-tint-layer.color, md.comp.top-app-bar.small.headline.color, md.comp.top-app-bar.small.headline.text-style, md.comp.top-app-bar.small.leading-icon.color, @@ -823,10 +802,21 @@ md.ref.palette.neutral-variant80, md.ref.palette.neutral-variant90, md.ref.palette.neutral0, md.ref.palette.neutral10, +md.ref.palette.neutral100, +md.ref.palette.neutral12, +md.ref.palette.neutral17, md.ref.palette.neutral20, +md.ref.palette.neutral22, +md.ref.palette.neutral24, +md.ref.palette.neutral4, +md.ref.palette.neutral6, +md.ref.palette.neutral87, md.ref.palette.neutral90, +md.ref.palette.neutral92, +md.ref.palette.neutral94, md.ref.palette.neutral95, -md.ref.palette.neutral99, +md.ref.palette.neutral96, +md.ref.palette.neutral98, md.ref.palette.primary10, md.ref.palette.primary100, md.ref.palette.primary20, @@ -861,24 +851,43 @@ md.sys.color.on-error, md.sys.color.on-error-container, md.sys.color.on-primary, md.sys.color.on-primary-container, +md.sys.color.on-primary-fixed, +md.sys.color.on-primary-fixed-variant, md.sys.color.on-secondary, md.sys.color.on-secondary-container, +md.sys.color.on-secondary-fixed, +md.sys.color.on-secondary-fixed-variant, md.sys.color.on-surface, md.sys.color.on-surface-variant, md.sys.color.on-tertiary, md.sys.color.on-tertiary-container, +md.sys.color.on-tertiary-fixed, +md.sys.color.on-tertiary-fixed-variant, md.sys.color.outline, md.sys.color.outline-variant, md.sys.color.primary, md.sys.color.primary-container, +md.sys.color.primary-fixed, +md.sys.color.primary-fixed-dim, md.sys.color.scrim, md.sys.color.secondary, md.sys.color.secondary-container, +md.sys.color.secondary-fixed, +md.sys.color.secondary-fixed-dim, md.sys.color.shadow, md.sys.color.surface, +md.sys.color.surface-bright, +md.sys.color.surface-container, +md.sys.color.surface-container-high, +md.sys.color.surface-container-highest, +md.sys.color.surface-container-low, +md.sys.color.surface-container-lowest, +md.sys.color.surface-dim, md.sys.color.surface-variant, md.sys.color.tertiary, md.sys.color.tertiary-container, +md.sys.color.tertiary-fixed, +md.sys.color.tertiary-fixed-dim, md.sys.elevation.level0, md.sys.elevation.level1, md.sys.elevation.level2, diff --git a/dev/tools/gen_defaults/lib/action_chip_template.dart b/dev/tools/gen_defaults/lib/action_chip_template.dart index c9eca9ac73857..4cd61fc66f39d 100644 --- a/dev/tools/gen_defaults/lib/action_chip_template.dart +++ b/dev/tools/gen_defaults/lib/action_chip_template.dart @@ -52,7 +52,9 @@ class _${blockName}DefaultsM3 extends ChipThemeData { ? ${componentColor("$tokenGroup$flatVariant.disabled.container")} : ${componentColor("$tokenGroup$elevatedVariant.disabled.container")}; } - return ${componentColor("$tokenGroup$flatVariant.container")}; + return _chipVariant == _ChipVariant.flat + ? ${componentColor("$tokenGroup$flatVariant.container")} + : ${componentColor("$tokenGroup$elevatedVariant.container")}; }); @override diff --git a/dev/tools/gen_defaults/lib/banner_template.dart b/dev/tools/gen_defaults/lib/banner_template.dart index 7d622b86f4084..a24657a9a56eb 100644 --- a/dev/tools/gen_defaults/lib/banner_template.dart +++ b/dev/tools/gen_defaults/lib/banner_template.dart @@ -24,7 +24,7 @@ class _${blockName}DefaultsM3 extends MaterialBannerThemeData { Color? get backgroundColor => ${componentColor("md.comp.banner.container")}; @override - Color? get surfaceTintColor => ${color("md.comp.banner.container.surface-tint-layer.color")}; + Color? get surfaceTintColor => ${colorOrTransparent("md.comp.banner.container.surface-tint-layer.color")}; @override Color? get dividerColor => ${color("md.comp.divider.color")}; diff --git a/dev/tools/gen_defaults/lib/bottom_app_bar_template.dart b/dev/tools/gen_defaults/lib/bottom_app_bar_template.dart index 00e0e987127d8..8b2ee0f18279a 100644 --- a/dev/tools/gen_defaults/lib/bottom_app_bar_template.dart +++ b/dev/tools/gen_defaults/lib/bottom_app_bar_template.dart @@ -26,7 +26,7 @@ class _${blockName}DefaultsM3 extends BottomAppBarTheme { Color? get color => ${componentColor('md.comp.bottom-app-bar.container')}; @override - Color? get surfaceTintColor => ${componentColor('md.comp.bottom-app-bar.container.surface-tint-layer')}; + Color? get surfaceTintColor => ${colorOrTransparent('md.comp.bottom-app-bar.container.surface-tint-layer')}; @override Color? get shadowColor => Colors.transparent; diff --git a/dev/tools/gen_defaults/lib/bottom_sheet_template.dart b/dev/tools/gen_defaults/lib/bottom_sheet_template.dart index e355b639e6ba8..03da35cf7e964 100644 --- a/dev/tools/gen_defaults/lib/bottom_sheet_template.dart +++ b/dev/tools/gen_defaults/lib/bottom_sheet_template.dart @@ -30,7 +30,7 @@ class _${blockName}DefaultsM3 extends BottomSheetThemeData { Color? get backgroundColor => ${componentColor("md.comp.sheet.bottom.docked.container")}; @override - Color? get surfaceTintColor => ${componentColor("md.comp.sheet.bottom.docked.container.surface-tint-layer")}; + Color? get surfaceTintColor => ${colorOrTransparent("md.comp.sheet.bottom.docked.container.surface-tint-layer")}; @override Color? get shadowColor => Colors.transparent; diff --git a/dev/tools/gen_defaults/lib/color_scheme_template.dart b/dev/tools/gen_defaults/lib/color_scheme_template.dart index a09ad6e4a2b18..eb6c2d702fcb5 100644 --- a/dev/tools/gen_defaults/lib/color_scheme_template.dart +++ b/dev/tools/gen_defaults/lib/color_scheme_template.dart @@ -32,14 +32,26 @@ const ColorScheme _colorSchemeLightM3 = ColorScheme( onPrimary: Color(${light('md.sys.color.on-primary')}), primaryContainer: Color(${light('md.sys.color.primary-container')}), onPrimaryContainer: Color(${light('md.sys.color.on-primary-container')}), + primaryFixed: Color(${light('md.sys.color.primary-fixed')}), + primaryFixedDim: Color(${light('md.sys.color.primary-fixed-dim')}), + onPrimaryFixed: Color(${light('md.sys.color.on-primary-fixed')}), + onPrimaryFixedVariant: Color(${light('md.sys.color.on-primary-fixed-variant')}), secondary: Color(${light('md.sys.color.secondary')}), onSecondary: Color(${light('md.sys.color.on-secondary')}), secondaryContainer: Color(${light('md.sys.color.secondary-container')}), onSecondaryContainer: Color(${light('md.sys.color.on-secondary-container')}), + secondaryFixed: Color(${light('md.sys.color.secondary-fixed')}), + secondaryFixedDim: Color(${light('md.sys.color.secondary-fixed-dim')}), + onSecondaryFixed: Color(${light('md.sys.color.on-secondary-fixed')}), + onSecondaryFixedVariant: Color(${light('md.sys.color.on-secondary-fixed-variant')}), tertiary: Color(${light('md.sys.color.tertiary')}), onTertiary: Color(${light('md.sys.color.on-tertiary')}), tertiaryContainer: Color(${light('md.sys.color.tertiary-container')}), onTertiaryContainer: Color(${light('md.sys.color.on-tertiary-container')}), + tertiaryFixed: Color(${light('md.sys.color.tertiary-fixed')}), + tertiaryFixedDim: Color(${light('md.sys.color.tertiary-fixed-dim')}), + onTertiaryFixed: Color(${light('md.sys.color.on-tertiary-fixed')}), + onTertiaryFixedVariant: Color(${light('md.sys.color.on-tertiary-fixed-variant')}), error: Color(${light('md.sys.color.error')}), onError: Color(${light('md.sys.color.on-error')}), errorContainer: Color(${light('md.sys.color.error-container')}), @@ -47,6 +59,13 @@ const ColorScheme _colorSchemeLightM3 = ColorScheme( background: Color(${light('md.sys.color.background')}), onBackground: Color(${light('md.sys.color.on-background')}), surface: Color(${light('md.sys.color.surface')}), + surfaceBright: Color(${light('md.sys.color.surface-bright')}), + surfaceContainerLowest: Color(${light('md.sys.color.surface-container-lowest')}), + surfaceContainerLow: Color(${light('md.sys.color.surface-container-low')}), + surfaceContainer: Color(${light('md.sys.color.surface-container')}), + surfaceContainerHigh: Color(${light('md.sys.color.surface-container-high')}), + surfaceContainerHighest: Color(${light('md.sys.color.surface-container-highest')}), + surfaceDim: Color(${light('md.sys.color.surface-dim')}), onSurface: Color(${light('md.sys.color.on-surface')}), surfaceVariant: Color(${light('md.sys.color.surface-variant')}), onSurfaceVariant: Color(${light('md.sys.color.on-surface-variant')}), @@ -67,14 +86,26 @@ const ColorScheme _colorSchemeDarkM3 = ColorScheme( onPrimary: Color(${dark('md.sys.color.on-primary')}), primaryContainer: Color(${dark('md.sys.color.primary-container')}), onPrimaryContainer: Color(${dark('md.sys.color.on-primary-container')}), + primaryFixed: Color(${dark('md.sys.color.primary-fixed')}), + primaryFixedDim: Color(${dark('md.sys.color.primary-fixed-dim')}), + onPrimaryFixed: Color(${dark('md.sys.color.on-primary-fixed')}), + onPrimaryFixedVariant: Color(${dark('md.sys.color.on-primary-fixed-variant')}), secondary: Color(${dark('md.sys.color.secondary')}), onSecondary: Color(${dark('md.sys.color.on-secondary')}), secondaryContainer: Color(${dark('md.sys.color.secondary-container')}), onSecondaryContainer: Color(${dark('md.sys.color.on-secondary-container')}), + secondaryFixed: Color(${dark('md.sys.color.secondary-fixed')}), + secondaryFixedDim: Color(${dark('md.sys.color.secondary-fixed-dim')}), + onSecondaryFixed: Color(${dark('md.sys.color.on-secondary-fixed')}), + onSecondaryFixedVariant: Color(${dark('md.sys.color.on-secondary-fixed-variant')}), tertiary: Color(${dark('md.sys.color.tertiary')}), onTertiary: Color(${dark('md.sys.color.on-tertiary')}), tertiaryContainer: Color(${dark('md.sys.color.tertiary-container')}), onTertiaryContainer: Color(${dark('md.sys.color.on-tertiary-container')}), + tertiaryFixed: Color(${dark('md.sys.color.tertiary-fixed')}), + tertiaryFixedDim: Color(${dark('md.sys.color.tertiary-fixed-dim')}), + onTertiaryFixed: Color(${dark('md.sys.color.on-tertiary-fixed')}), + onTertiaryFixedVariant: Color(${dark('md.sys.color.on-tertiary-fixed-variant')}), error: Color(${dark('md.sys.color.error')}), onError: Color(${dark('md.sys.color.on-error')}), errorContainer: Color(${dark('md.sys.color.error-container')}), @@ -82,6 +113,13 @@ const ColorScheme _colorSchemeDarkM3 = ColorScheme( background: Color(${dark('md.sys.color.background')}), onBackground: Color(${dark('md.sys.color.on-background')}), surface: Color(${dark('md.sys.color.surface')}), + surfaceBright: Color(${dark('md.sys.color.surface-bright')}), + surfaceContainerLowest: Color(${dark('md.sys.color.surface-container-lowest')}), + surfaceContainerLow: Color(${dark('md.sys.color.surface-container-low')}), + surfaceContainer: Color(${dark('md.sys.color.surface-container')}), + surfaceContainerHigh: Color(${dark('md.sys.color.surface-container-high')}), + surfaceContainerHighest: Color(${dark('md.sys.color.surface-container-highest')}), + surfaceDim: Color(${dark('md.sys.color.surface-dim')}), onSurface: Color(${dark('md.sys.color.on-surface')}), surfaceVariant: Color(${dark('md.sys.color.surface-variant')}), onSurfaceVariant: Color(${dark('md.sys.color.on-surface-variant')}), diff --git a/dev/tools/gen_defaults/lib/drawer_template.dart b/dev/tools/gen_defaults/lib/drawer_template.dart index 6a21403c8016f..88de944de8657 100644 --- a/dev/tools/gen_defaults/lib/drawer_template.dart +++ b/dev/tools/gen_defaults/lib/drawer_template.dart @@ -17,7 +17,7 @@ class _${blockName}DefaultsM3 extends DrawerThemeData { late final TextDirection direction = Directionality.of(context); @override - Color? get backgroundColor => ${componentColor("md.comp.navigation-drawer.container")}; + Color? get backgroundColor => ${componentColor("md.comp.navigation-drawer.modal.container")}; @override Color? get surfaceTintColor => ${colorOrTransparent("md.comp.navigation-drawer.container.surface-tint-layer.color")}; diff --git a/dev/tools/gen_defaults/lib/filter_chip_template.dart b/dev/tools/gen_defaults/lib/filter_chip_template.dart index 1bf0346ac07ab..27ef2fb68376c 100644 --- a/dev/tools/gen_defaults/lib/filter_chip_template.dart +++ b/dev/tools/gen_defaults/lib/filter_chip_template.dart @@ -71,7 +71,7 @@ class _${blockName}DefaultsM3 extends ChipThemeData { } return _chipVariant == _ChipVariant.flat ? ${componentColor("$tokenGroup$flatVariant.container")} - : ${componentColor("$tokenGroup$elevatedVariant.container")}; + : ${componentColor("$tokenGroup$elevatedVariant.unselected.container")}; }); @override diff --git a/dev/tools/gen_defaults/lib/icon_button_template.dart b/dev/tools/gen_defaults/lib/icon_button_template.dart index 7031fd3cce255..32d65e3c707aa 100644 --- a/dev/tools/gen_defaults/lib/icon_button_template.dart +++ b/dev/tools/gen_defaults/lib/icon_button_template.dart @@ -185,14 +185,14 @@ class IconButtonTemplate extends TokenTemplate { } String _minimumSize() { - if (tokenAvailable('$tokenGroup.container.size')) { + if (tokenAvailable('$tokenGroup.container.height') && tokenAvailable('$tokenGroup.container.width')) { return ''' - const MaterialStatePropertyAll(Size(${getToken('$tokenGroup.container.size')}, ${getToken('$tokenGroup.container.size')}))'''; + const MaterialStatePropertyAll(Size(${getToken('$tokenGroup.container.width')}, ${getToken('$tokenGroup.container.height')}))'''; } else { return ''' - const MaterialStatePropertyAll(Size(${getToken('$tokenGroup.state-layer.size')}, ${getToken('$tokenGroup.state-layer.size')}))'''; + const MaterialStatePropertyAll(Size(40.0, 40.0))'''; } } diff --git a/dev/tools/gen_defaults/lib/menu_template.dart b/dev/tools/gen_defaults/lib/menu_template.dart index cb09087d8d72e..aaef8459af304 100644 --- a/dev/tools/gen_defaults/lib/menu_template.dart +++ b/dev/tools/gen_defaults/lib/menu_template.dart @@ -38,7 +38,7 @@ class _MenuBarDefaultsM3 extends MenuStyle { @override MaterialStateProperty? get surfaceTintColor { - return MaterialStatePropertyAll(${componentColor('md.comp.menu.container.surface-tint-layer')}); + return const MaterialStatePropertyAll(${colorOrTransparent('md.comp.menu.container.surface-tint-layer')}); } @override @@ -242,7 +242,10 @@ class _MenuDefaultsM3 extends MenuStyle { @override MaterialStateProperty? get surfaceTintColor { - return MaterialStatePropertyAll(${componentColor('md.comp.menu.container.surface-tint-layer')}); + return ${componentColor('md.comp.menu.container.surface-tint-layer') == 'null' + ? 'const MaterialStatePropertyAll(Colors.transparent)' + : 'MaterialStatePropertyAll(${componentColor('md.comp.menu.container.surface-tint-layer')})' + }; } @override diff --git a/dev/tools/gen_defaults/lib/navigation_drawer_template.dart b/dev/tools/gen_defaults/lib/navigation_drawer_template.dart index 13288262657fe..0d0ec5c04768e 100644 --- a/dev/tools/gen_defaults/lib/navigation_drawer_template.dart +++ b/dev/tools/gen_defaults/lib/navigation_drawer_template.dart @@ -26,7 +26,7 @@ class _${blockName}DefaultsM3 extends NavigationDrawerThemeData { late final TextTheme _textTheme = Theme.of(context).textTheme; @override - Color? get backgroundColor => ${componentColor("md.comp.navigation-drawer.container")}; + Color? get backgroundColor => ${componentColor("md.comp.navigation-drawer.modal.container")}; @override Color? get surfaceTintColor => ${colorOrTransparent("md.comp.navigation-drawer.container.surface-tint-layer.color")}; diff --git a/dev/tools/gen_defaults/lib/popup_menu_template.dart b/dev/tools/gen_defaults/lib/popup_menu_template.dart index bed11d0b8b09a..a29828adb1112 100644 --- a/dev/tools/gen_defaults/lib/popup_menu_template.dart +++ b/dev/tools/gen_defaults/lib/popup_menu_template.dart @@ -38,7 +38,7 @@ class _${blockName}DefaultsM3 extends PopupMenuThemeData { Color? get shadowColor => ${color("md.comp.menu.container.shadow-color")}; @override - Color? get surfaceTintColor => ${color("md.comp.menu.container.surface-tint-layer.color")}; + Color? get surfaceTintColor => ${colorOrTransparent("md.comp.menu.container.surface-tint-layer.color")}; @override ShapeBorder? get shape => ${shape("md.comp.menu.container")}; diff --git a/dev/tools/gen_defaults/lib/search_bar_template.dart b/dev/tools/gen_defaults/lib/search_bar_template.dart index 670121b9cb505..4b1acebdf7842 100644 --- a/dev/tools/gen_defaults/lib/search_bar_template.dart +++ b/dev/tools/gen_defaults/lib/search_bar_template.dart @@ -10,6 +10,15 @@ class SearchBarTemplate extends TokenTemplate { super.textThemePrefix = '_textTheme.' }); + String _surfaceTint() { + final String? color = colorOrTransparent('md.comp.search-bar.container.surface-tint-layer.color'); + final String surfaceTintColor = 'MaterialStatePropertyAll($color);'; + if (color == 'Colors.transparent') { + return 'const $surfaceTintColor'; + } + return surfaceTintColor; + } + @override String generate() => ''' class _SearchBarDefaultsM3 extends SearchBarThemeData { @@ -33,7 +42,7 @@ class _SearchBarDefaultsM3 extends SearchBarThemeData { @override MaterialStateProperty? get surfaceTintColor => - MaterialStatePropertyAll(${colorOrTransparent("md.comp.search-bar.container.surface-tint-layer.color")}); + ${_surfaceTint()} @override MaterialStateProperty? get overlayColor => diff --git a/dev/tools/gen_defaults/lib/segmented_button_template.dart b/dev/tools/gen_defaults/lib/segmented_button_template.dart index 8f9e8f6a3dd32..4d1254ea109a4 100644 --- a/dev/tools/gen_defaults/lib/segmented_button_template.dart +++ b/dev/tools/gen_defaults/lib/segmented_button_template.dart @@ -124,23 +124,23 @@ class _${blockName}DefaultsM3 extends SegmentedButtonThemeData { return MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return selectedColor?.withOpacity(0.12); + return selectedColor?.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return selectedColor?.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return selectedColor?.withOpacity(0.12); + return selectedColor?.withOpacity(0.1); } } else { if (states.contains(MaterialState.pressed)) { - return unselectedColor?.withOpacity(0.12); + return unselectedColor?.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return unselectedColor?.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return unselectedColor?.withOpacity(0.12); + return unselectedColor?.withOpacity(0.1); } } return Colors.transparent; diff --git a/dev/tools/gen_defaults/lib/tabs_template.dart b/dev/tools/gen_defaults/lib/tabs_template.dart index 25c895744af8a..0dca79409f33b 100644 --- a/dev/tools/gen_defaults/lib/tabs_template.dart +++ b/dev/tools/gen_defaults/lib/tabs_template.dart @@ -21,11 +21,13 @@ class _${blockName}PrimaryDefaultsM3 extends TabBarTheme { late final TextTheme _textTheme = Theme.of(context).textTheme; final bool isScrollable; + // This value comes from Divider widget defaults. Token db deprecated 'primary-navigation-tab.divider.color' token. @override - Color? get dividerColor => ${componentColor("md.comp.primary-navigation-tab.divider")}; + Color? get dividerColor => ${componentColor("md.comp.divider")}; + // This value comes from Divider widget defaults. Token db deprecated 'primary-navigation-tab.divider.height' token. @override - double? get dividerHeight => ${getToken('md.comp.primary-navigation-tab.divider.height')}; + double? get dividerHeight => ${getToken("md.comp.divider.thickness")}; @override Color? get indicatorColor => ${componentColor("md.comp.primary-navigation-tab.active-indicator")}; @@ -93,11 +95,13 @@ class _${blockName}SecondaryDefaultsM3 extends TabBarTheme { late final TextTheme _textTheme = Theme.of(context).textTheme; final bool isScrollable; + // This value comes from Divider widget defaults. Token db deprecated 'secondary-navigation-tab.divider.color' token. @override - Color? get dividerColor => ${componentColor("md.comp.secondary-navigation-tab.divider")}; + Color? get dividerColor => ${componentColor("md.comp.divider")}; + // This value comes from Divider widget defaults. Token db deprecated 'secondary-navigation-tab.divider.height' token. @override - double? get dividerHeight => ${getToken('md.comp.secondary-navigation-tab.divider.height')}; + double? get dividerHeight => ${getToken("md.comp.divider.thickness")}; @override Color? get indicatorColor => ${componentColor("md.comp.primary-navigation-tab.active-indicator")}; diff --git a/examples/api/lib/material/color_scheme/color_scheme.0.dart b/examples/api/lib/material/color_scheme/color_scheme.0.dart new file mode 100644 index 0000000000000..51ce183f9e2d8 --- /dev/null +++ b/examples/api/lib/material/color_scheme/color_scheme.0.dart @@ -0,0 +1,309 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/material.dart'; + +/// Flutter code sample for [ColorScheme]. + +const Widget divider = SizedBox(height: 10); + +void main() => runApp(const ColorSchemeExample()); + +class ColorSchemeExample extends StatefulWidget { + const ColorSchemeExample({super.key}); + + @override + State createState() => _ColorSchemeExampleState(); +} + +class _ColorSchemeExampleState extends State { + Color selectedColor = ColorSeed.baseColor.color; + + @override + Widget build(BuildContext context) { + final Color? colorSeed = selectedColor == ColorSeed.baseColor.color ? null : selectedColor; + final ThemeData lightTheme = ThemeData( + colorSchemeSeed: colorSeed, + brightness: Brightness.light, + ); + final ThemeData darkTheme = ThemeData( + colorSchemeSeed: colorSeed, + brightness: Brightness.dark, + ); + + Widget schemeLabel(String brightness) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 15), + child: Text( + brightness, + style: const TextStyle(fontWeight: FontWeight.bold), + ), + ); + } + + Widget schemeView(ThemeData theme) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 15), + child: ColorSchemeView(colorScheme: theme.colorScheme), + ); + } + + return MaterialApp( + theme: ThemeData(colorSchemeSeed: selectedColor), + home: Builder( + builder: (BuildContext context) => Scaffold( + appBar: AppBar( + title: const Text('ColorScheme'), + leading: MenuAnchor( + builder: (BuildContext context, MenuController controller, Widget? widget) { + return IconButton( + icon: Icon(Icons.circle, color: selectedColor), + onPressed: () { + setState(() { + if (!controller.isOpen) { + controller.open(); + } + }); + }, + ); + }, + menuChildren: List.generate(ColorSeed.values.length, (int index) { + final Color itemColor = ColorSeed.values[index].color; + return MenuItemButton( + leadingIcon: selectedColor == ColorSeed.values[index].color + ? Icon(Icons.circle, color: itemColor) + : Icon(Icons.circle_outlined, color: itemColor), + onPressed: () { + setState(() { + selectedColor = itemColor; + }); + }, + child: Text(ColorSeed.values[index].label), + ); + }), + ), + ), + body: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.only(top: 5), + child: Column( + children: [ + Row( + children: [ + Expanded( + child: Column( + children: [ + schemeLabel('Light ColorScheme'), + schemeView(lightTheme), + ], + ), + ), + Expanded( + child: Column( + children: [ + schemeLabel('Dark ColorScheme'), + schemeView(darkTheme), + ], + ), + ), + ], + ), + ], + ), + ), + ), + ), + ), + ); + } +} + +class ColorSchemeView extends StatelessWidget { + const ColorSchemeView({super.key, required this.colorScheme}); + + final ColorScheme colorScheme; + + @override + Widget build(BuildContext context) { + return Column( + children: [ + ColorGroup(children: [ + ColorChip('primary', colorScheme.primary, colorScheme.onPrimary), + ColorChip('onPrimary', colorScheme.onPrimary, colorScheme.primary), + ColorChip('primaryContainer', colorScheme.primaryContainer, colorScheme.onPrimaryContainer), + ColorChip( + 'onPrimaryContainer', + colorScheme.onPrimaryContainer, + colorScheme.primaryContainer, + ), + ]), + divider, + ColorGroup(children: [ + ColorChip('primaryFixed', colorScheme.primaryFixed, colorScheme.onPrimaryFixed), + ColorChip('onPrimaryFixed', colorScheme.onPrimaryFixed, colorScheme.primaryFixed), + ColorChip('primaryFixedDim', colorScheme.primaryFixedDim, colorScheme.onPrimaryFixedVariant), + ColorChip( + 'onPrimaryFixedVariant', + colorScheme.onPrimaryFixedVariant, + colorScheme.primaryFixedDim, + ), + ]), + divider, + ColorGroup(children: [ + ColorChip('secondary', colorScheme.secondary, colorScheme.onSecondary), + ColorChip('onSecondary', colorScheme.onSecondary, colorScheme.secondary), + ColorChip( + 'secondaryContainer', + colorScheme.secondaryContainer, + colorScheme.onSecondaryContainer, + ), + ColorChip( + 'onSecondaryContainer', + colorScheme.onSecondaryContainer, + colorScheme.secondaryContainer, + ), + ]), + divider, + ColorGroup(children: [ + ColorChip('secondaryFixed', colorScheme.secondaryFixed, colorScheme.onSecondaryFixed), + ColorChip('onSecondaryFixed', colorScheme.onSecondaryFixed, colorScheme.secondaryFixed), + ColorChip( + 'secondaryFixedDim', + colorScheme.secondaryFixedDim, + colorScheme.onSecondaryFixedVariant, + ), + ColorChip( + 'onSecondaryFixedVariant', + colorScheme.onSecondaryFixedVariant, + colorScheme.secondaryFixedDim, + ), + ]), + divider, + ColorGroup( + children: [ + ColorChip('tertiary', colorScheme.tertiary, colorScheme.onTertiary), + ColorChip('onTertiary', colorScheme.onTertiary, colorScheme.tertiary), + ColorChip( + 'tertiaryContainer', + colorScheme.tertiaryContainer, + colorScheme.onTertiaryContainer, + ), + ColorChip( + 'onTertiaryContainer', + colorScheme.onTertiaryContainer, + colorScheme.tertiaryContainer, + ), + ], + ), + divider, + ColorGroup(children: [ + ColorChip('tertiaryFixed', colorScheme.tertiaryFixed, colorScheme.onTertiaryFixed), + ColorChip('onTertiaryFixed', colorScheme.onTertiaryFixed, colorScheme.tertiaryFixed), + ColorChip('tertiaryFixedDim', colorScheme.tertiaryFixedDim, colorScheme.onTertiaryFixedVariant), + ColorChip( + 'onTertiaryFixedVariant', + colorScheme.onTertiaryFixedVariant, + colorScheme.tertiaryFixedDim, + ), + ]), + divider, + ColorGroup( + children: [ + ColorChip('error', colorScheme.error, colorScheme.onError), + ColorChip('onError', colorScheme.onError, colorScheme.error), + ColorChip('errorContainer', colorScheme.errorContainer, colorScheme.onErrorContainer), + ColorChip('onErrorContainer', colorScheme.onErrorContainer, colorScheme.errorContainer), + ], + ), + divider, + ColorGroup( + children: [ + ColorChip('surfaceDim', colorScheme.surfaceDim, colorScheme.onSurface), + ColorChip('surface', colorScheme.surface, colorScheme.onSurface), + ColorChip('surfaceBright', colorScheme.surfaceBright, colorScheme.onSurface), + ColorChip('surfaceContainerLowest', colorScheme.surfaceContainerLowest, colorScheme.onSurface), + ColorChip('surfaceContainerLow', colorScheme.surfaceContainerLow, colorScheme.onSurface), + ColorChip('surfaceContainer', colorScheme.surfaceContainer, colorScheme.onSurface), + ColorChip('surfaceContainerHigh', colorScheme.surfaceContainerHigh, colorScheme.onSurface), + ColorChip('surfaceContainerHighest', colorScheme.surfaceContainerHighest, colorScheme.onSurface), + ColorChip('onSurface', colorScheme.onSurface, colorScheme.surface), + ColorChip( + 'onSurfaceVariant', + colorScheme.onSurfaceVariant, + colorScheme.surfaceContainerHighest, + ), + ], + ), + divider, + ColorGroup( + children: [ + ColorChip('outline', colorScheme.outline, null), + ColorChip('shadow', colorScheme.shadow, null), + ColorChip('inverseSurface', colorScheme.inverseSurface, colorScheme.onInverseSurface), + ColorChip('onInverseSurface', colorScheme.onInverseSurface, colorScheme.inverseSurface), + ColorChip('inversePrimary', colorScheme.inversePrimary, colorScheme.primary), + ], + ), + ], + ); + } +} + +class ColorGroup extends StatelessWidget { + const ColorGroup({super.key, required this.children}); + + final List children; + + @override + Widget build(BuildContext context) { + return RepaintBoundary( + child: Card(clipBehavior: Clip.antiAlias, child: Column(children: children)), + ); + } +} + +class ColorChip extends StatelessWidget { + const ColorChip(this.label, this.color, this.onColor, {super.key}); + + final Color color; + final Color? onColor; + final String label; + + static Color contrastColor(Color color) { + final Brightness brightness = ThemeData.estimateBrightnessForColor(color); + return brightness == Brightness.dark ? Colors.white : Colors.black; + } + + @override + Widget build(BuildContext context) { + final Color labelColor = onColor ?? contrastColor(color); + return ColoredBox( + color: color, + child: Padding( + padding: const EdgeInsets.all(16), + child: Row( + children: [ + Expanded(child: Text(label, style: TextStyle(color: labelColor))), + ], + ), + ), + ); + } +} + +enum ColorSeed { + baseColor('M3 Baseline', Color(0xff6750a4)), + indigo('Indigo', Colors.indigo), + blue('Blue', Colors.blue), + teal('Teal', Colors.teal), + green('Green', Colors.green), + yellow('Yellow', Colors.yellow), + orange('Orange', Colors.orange), + deepOrange('Deep Orange', Colors.deepOrange), + pink('Pink', Colors.pink); + + const ColorSeed(this.label, this.color); + final String label; + final Color color; +} diff --git a/examples/api/lib/material/color_scheme/dynamic_content_color.0.dart b/examples/api/lib/material/color_scheme/dynamic_content_color.0.dart index 0dad9253839fa..e3b2b96458064 100644 --- a/examples/api/lib/material/color_scheme/dynamic_content_color.0.dart +++ b/examples/api/lib/material/color_scheme/dynamic_content_color.0.dart @@ -126,7 +126,7 @@ class _DynamicColorExampleState extends State { divider, Expanded( child: ColoredBox( - color: colorScheme.background, + color: colorScheme.surface, child: LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) { if (constraints.maxWidth < narrowScreenWidthThreshold) { return SingleChildScrollView( @@ -226,7 +226,7 @@ class _DynamicColorExampleState extends State { child: Card( color: widget.images.indexOf(image) == selectedImage ? colorScheme.primaryContainer - : colorScheme.background, + : colorScheme.surface, child: Padding( padding: const EdgeInsets.all(5.0), child: ConstrainedBox( @@ -305,21 +305,12 @@ class ColorSchemeView extends StatelessWidget { ], ), divider, - ColorGroup( - children: [ - ColorChip(label: 'background', color: colorScheme.background, onColor: colorScheme.onBackground), - ColorChip(label: 'onBackground', color: colorScheme.onBackground, onColor: colorScheme.background), - ], - ), - divider, ColorGroup( children: [ ColorChip(label: 'surface', color: colorScheme.surface, onColor: colorScheme.onSurface), ColorChip(label: 'onSurface', color: colorScheme.onSurface, onColor: colorScheme.surface), ColorChip( - label: 'surfaceVariant', color: colorScheme.surfaceVariant, onColor: colorScheme.onSurfaceVariant), - ColorChip( - label: 'onSurfaceVariant', color: colorScheme.onSurfaceVariant, onColor: colorScheme.surfaceVariant), + label: 'onSurfaceVariant', color: colorScheme.onSurfaceVariant, onColor: colorScheme.surfaceContainerHighest), ], ), divider, diff --git a/examples/api/lib/widgets/draggable_scrollable_sheet/draggable_scrollable_sheet.0.dart b/examples/api/lib/widgets/draggable_scrollable_sheet/draggable_scrollable_sheet.0.dart index 556c884ed6b9b..f904102678b41 100644 --- a/examples/api/lib/widgets/draggable_scrollable_sheet/draggable_scrollable_sheet.0.dart +++ b/examples/api/lib/widgets/draggable_scrollable_sheet/draggable_scrollable_sheet.0.dart @@ -133,7 +133,7 @@ class Grabber extends StatelessWidget { width: 32.0, height: 4.0, decoration: BoxDecoration( - color: colorScheme.surfaceVariant, + color: colorScheme.surfaceContainerHighest, borderRadius: BorderRadius.circular(8.0), ), ), diff --git a/examples/api/lib/widgets/page_view/page_view.0.dart b/examples/api/lib/widgets/page_view/page_view.0.dart index 4bf358123b8dc..336a48a04e84d 100644 --- a/examples/api/lib/widgets/page_view/page_view.0.dart +++ b/examples/api/lib/widgets/page_view/page_view.0.dart @@ -169,7 +169,7 @@ class PageIndicator extends StatelessWidget { ), TabPageSelector( controller: tabController, - color: colorScheme.background, + color: colorScheme.surface, selectedColor: colorScheme.primary, ), IconButton( diff --git a/examples/api/test/material/app/app.0_test.dart b/examples/api/test/material/app/app.0_test.dart index 007b95683fb44..edca9572d83fc 100644 --- a/examples/api/test/material/app/app.0_test.dart +++ b/examples/api/test/material/app/app.0_test.dart @@ -27,7 +27,7 @@ void main() { ); // Test the default animation. - expect(getScaffoldMaterial().color, lightTheme.colorScheme.background); + expect(getScaffoldMaterial().color, lightTheme.colorScheme.surface); await tester.tap(find.text( 'Switch Theme Mode')); await tester.pump(); @@ -37,13 +37,13 @@ void main() { // The Scaffold background color is updated. expect( getScaffoldMaterial().color, - Color.lerp(lightTheme.colorScheme.background, darkTheme.colorScheme.background, 0.5), + Color.lerp(lightTheme.colorScheme.surface, darkTheme.colorScheme.surface, 0.5), ); await tester.pumpAndSettle(); // The Scaffold background color is now fully dark. - expect(getScaffoldMaterial().color, darkTheme.colorScheme.background); + expect(getScaffoldMaterial().color, darkTheme.colorScheme.surface); // Test the custom animation curve and duration. await tester.tap(find.text('Custom')); @@ -55,12 +55,12 @@ void main() { await tester.pump(const Duration(milliseconds: 500)); // The Scaffold background color is updated. - expect(getScaffoldMaterial().color, const Color(0xff3c3e3b)); + expect(getScaffoldMaterial().color, const Color(0xff333731)); await tester.pumpAndSettle(); // The Scaffold background color is now fully light. - expect(getScaffoldMaterial().color, lightTheme.colorScheme.background); + expect(getScaffoldMaterial().color, lightTheme.colorScheme.surface); // Test the no animation style. await tester.tap(find.text('None')); @@ -71,6 +71,6 @@ void main() { await tester.pump(); // The Scaffold background color is updated immediately. - expect(getScaffoldMaterial().color, darkTheme.colorScheme.background); + expect(getScaffoldMaterial().color, darkTheme.colorScheme.surface); }); } diff --git a/examples/api/test/material/card/card.2_test.dart b/examples/api/test/material/card/card.2_test.dart index 1c0d93affbaf8..b9753bfdf886a 100644 --- a/examples/api/test/material/card/card.2_test.dart +++ b/examples/api/test/material/card/card.2_test.dart @@ -31,9 +31,9 @@ void main() { expect(defaultCard.shape, const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(12.0)), )); - expect(defaultCard.color, const Color(0xfffffbfe)); + expect(defaultCard.color, const Color(0xfff7f2fa)); expect(defaultCard.shadowColor, const Color(0xff000000)); - expect(defaultCard.surfaceTintColor, const Color(0xff6750a4)); + expect(defaultCard.surfaceTintColor, Colors.transparent); final Material filledCard = getCardMaterial(tester, 1); expect(filledCard.clipBehavior, Clip.none); @@ -41,7 +41,7 @@ void main() { expect(filledCard.shape, const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(12.0)), )); - expect(filledCard.color, const Color(0xffe7e0ec)); + expect(filledCard.color, const Color(0xffe6e0e9)); expect(filledCard.shadowColor, const Color(0xff000000)); expect(filledCard.surfaceTintColor, const Color(0x00000000)); @@ -52,8 +52,8 @@ void main() { side: BorderSide(color: Color(0xffcac4d0)), borderRadius: BorderRadius.all(Radius.circular(12.0)), )); - expect(outlinedCard.color, const Color(0xfffffbfe)); + expect(outlinedCard.color, const Color(0xfffef7ff)); expect(outlinedCard.shadowColor, const Color(0xff000000)); - expect(outlinedCard.surfaceTintColor, const Color(0xff6750a4)); + expect(outlinedCard.surfaceTintColor, Colors.transparent); }); } diff --git a/examples/api/test/material/color_scheme/color_scheme.0_test.dart b/examples/api/test/material/color_scheme/color_scheme.0_test.dart new file mode 100644 index 0000000000000..492a71884b926 --- /dev/null +++ b/examples/api/test/material/color_scheme/color_scheme.0_test.dart @@ -0,0 +1,41 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/material.dart'; +import 'package:flutter_api_samples/material/color_scheme/color_scheme.0.dart' as example; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + testWidgets('ColorScheme Smoke Test', (WidgetTester tester) async { + await tester.pumpWidget( + const example.ColorSchemeExample(), + ); + expect(find.text('Light ColorScheme'), findsOneWidget); + expect(find.text('Dark ColorScheme'), findsOneWidget); + + expect(find.byType(example.ColorChip), findsNWidgets(86)); + }); + + testWidgets('Change color seed', (WidgetTester tester) async { + await tester.pumpWidget( + const example.ColorSchemeExample(), + ); + + ColoredBox coloredBox() { + return tester.widget( + find.descendant( + of: find.widgetWithText(example.ColorChip, 'primary').first, + matching: find.byType(ColoredBox) + ) + ); + } + expect(coloredBox().color, const Color(0xFF6750A4)); + await tester.tap(find.byType(MenuAnchor)); + await tester.pumpAndSettle(); + await tester.tap(find.widgetWithText(MenuItemButton, 'Yellow')); + await tester.pumpAndSettle(); + + expect(coloredBox().color, const Color(0xFF685F12)); + }); +} diff --git a/examples/api/test/material/toggle_buttons/toggle_buttons.0_test.dart b/examples/api/test/material/toggle_buttons/toggle_buttons.0_test.dart index e2b5063491124..ccbc9192555f4 100644 --- a/examples/api/test/material/toggle_buttons/toggle_buttons.0_test.dart +++ b/examples/api/test/material/toggle_buttons/toggle_buttons.0_test.dart @@ -25,7 +25,7 @@ void main() { TextButton thirdButton = findButton('Orange'); const Color selectedColor = Color(0xffef9a9a); - const Color unselectedColor = Color(0x00fffbfe); + const Color unselectedColor = Color(0x00fef7ff); /// First button is selected. expect(firstButton.style!.backgroundColor!.resolve(enabled), selectedColor); @@ -63,7 +63,7 @@ void main() { TextButton thirdButton = findButton('Carrots'); const Color selectedColor = Color(0xffa5d6a7); - const Color unselectedColor = Color(0x00fffbfe); + const Color unselectedColor = Color(0x00fef7ff); /// Second button is selected. expect(firstButton.style!.backgroundColor!.resolve(enabled), unselectedColor); @@ -102,7 +102,7 @@ void main() { TextButton thirdButton = findButton(Icons.ac_unit); const Color selectedColor = Color(0xff90caf9); - const Color unselectedColor = Color(0x00fffbfe); + const Color unselectedColor = Color(0x00fef7ff); /// Third button is selected. diff --git a/packages/flutter/lib/fix_data/fix_material/fix_color_scheme.yaml b/packages/flutter/lib/fix_data/fix_material/fix_color_scheme.yaml index 6e7c3d18a36c5..7156debc64ce3 100644 --- a/packages/flutter/lib/fix_data/fix_material/fix_color_scheme.yaml +++ b/packages/flutter/lib/fix_data/fix_material/fix_color_scheme.yaml @@ -26,6 +26,435 @@ version: 1 transforms: + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate background" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + constructor: '' + inClass: 'ColorScheme' + oneOf: + - if: "surface == ''" + changes: + - kind: 'renameParameter' + oldName: 'background' + newName: 'surface' + - if: "surface != ''" + changes: + - kind: 'removeParameter' + name: 'background' + variables: + surface: + kind: 'fragment' + value: 'arguments[surface]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate onBackground" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + constructor: '' + inClass: 'ColorScheme' + oneOf: + - if: "onSurface == ''" + changes: + - kind: 'renameParameter' + oldName: 'onBackground' + newName: 'onSurface' + - if: "onSurface != ''" + changes: + - kind: 'removeParameter' + name: 'onBackground' + variables: + onSurface: + kind: 'fragment' + value: 'arguments[onSurface]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate surfaceVariant" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + constructor: '' + inClass: 'ColorScheme' + oneOf: + - if: "surfaceContainerHighest == ''" + changes: + - kind: 'renameParameter' + oldName: 'surfaceVariant' + newName: 'surfaceContainerHighest' + - if: "surfaceContainerHighest != ''" + changes: + - kind: 'removeParameter' + name: 'surfaceVariant' + variables: + surfaceContainerHighest: + kind: 'fragment' + value: 'arguments[surfaceContainerHighest]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate background" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + constructor: 'light' + inClass: 'ColorScheme' + oneOf: + - if: "surface == ''" + changes: + - kind: 'renameParameter' + oldName: 'background' + newName: 'surface' + - if: "surface != ''" + changes: + - kind: 'removeParameter' + name: 'background' + variables: + surface: + kind: 'fragment' + value: 'arguments[surface]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate onBackground" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + constructor: 'light' + inClass: 'ColorScheme' + oneOf: + - if: "onSurface == ''" + changes: + - kind: 'renameParameter' + oldName: 'onBackground' + newName: 'onSurface' + - if: "onSurface != ''" + changes: + - kind: 'removeParameter' + name: 'onBackground' + variables: + onSurface: + kind: 'fragment' + value: 'arguments[onSurface]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate surfaceVariant" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + constructor: 'light' + inClass: 'ColorScheme' + oneOf: + - if: "surfaceContainerHighest == ''" + changes: + - kind: 'renameParameter' + oldName: 'surfaceVariant' + newName: 'surfaceContainerHighest' + - if: "surfaceContainerHighest != ''" + changes: + - kind: 'removeParameter' + name: 'surfaceVariant' + variables: + surfaceContainerHighest: + kind: 'fragment' + value: 'arguments[surfaceContainerHighest]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate background" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + constructor: 'dark' + inClass: 'ColorScheme' + oneOf: + - if: "surface == ''" + changes: + - kind: 'renameParameter' + oldName: 'background' + newName: 'surface' + - if: "surface != ''" + changes: + - kind: 'removeParameter' + name: 'background' + variables: + surface: + kind: 'fragment' + value: 'arguments[surface]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate onBackground" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + constructor: 'dark' + inClass: 'ColorScheme' + oneOf: + - if: "onSurface == ''" + changes: + - kind: 'renameParameter' + oldName: 'onBackground' + newName: 'onSurface' + - if: "onSurface != ''" + changes: + - kind: 'removeParameter' + name: 'onBackground' + variables: + onSurface: + kind: 'fragment' + value: 'arguments[onSurface]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate surfaceVariant" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + constructor: 'dark' + inClass: 'ColorScheme' + oneOf: + - if: "surfaceContainerHighest == ''" + changes: + - kind: 'renameParameter' + oldName: 'surfaceVariant' + newName: 'surfaceContainerHighest' + - if: "surfaceContainerHighest != ''" + changes: + - kind: 'removeParameter' + name: 'surfaceVariant' + variables: + surfaceContainerHighest: + kind: 'fragment' + value: 'arguments[surfaceContainerHighest]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate background" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + constructor: 'highContrastLight' + inClass: 'ColorScheme' + oneOf: + - if: "surface == ''" + changes: + - kind: 'renameParameter' + oldName: 'background' + newName: 'surface' + - if: "surface != ''" + changes: + - kind: 'removeParameter' + name: 'background' + variables: + surface: + kind: 'fragment' + value: 'arguments[surface]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate onBackground" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + constructor: 'highContrastLight' + inClass: 'ColorScheme' + oneOf: + - if: "onSurface == ''" + changes: + - kind: 'renameParameter' + oldName: 'onBackground' + newName: 'onSurface' + - if: "onSurface != ''" + changes: + - kind: 'removeParameter' + name: 'onBackground' + variables: + onSurface: + kind: 'fragment' + value: 'arguments[onSurface]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate surfaceVariant" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + constructor: 'highContrastLight' + inClass: 'ColorScheme' + oneOf: + - if: "surfaceContainerHighest == ''" + changes: + - kind: 'renameParameter' + oldName: 'surfaceVariant' + newName: 'surfaceContainerHighest' + - if: "surfaceContainerHighest != ''" + changes: + - kind: 'removeParameter' + name: 'surfaceVariant' + variables: + surfaceContainerHighest: + kind: 'fragment' + value: 'arguments[surfaceContainerHighest]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate background" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + constructor: 'highContrastDark' + inClass: 'ColorScheme' + oneOf: + - if: "surface == ''" + changes: + - kind: 'renameParameter' + oldName: 'background' + newName: 'surface' + - if: "surface != ''" + changes: + - kind: 'removeParameter' + name: 'background' + variables: + surface: + kind: 'fragment' + value: 'arguments[surface]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate onBackground" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + constructor: 'highContrastDark' + inClass: 'ColorScheme' + oneOf: + - if: "onSurface == ''" + changes: + - kind: 'renameParameter' + oldName: 'onBackground' + newName: 'onSurface' + - if: "onSurface != ''" + changes: + - kind: 'removeParameter' + name: 'onBackground' + variables: + onSurface: + kind: 'fragment' + value: 'arguments[onSurface]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate surfaceVariant" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + constructor: 'highContrastDark' + inClass: 'ColorScheme' + oneOf: + - if: "surfaceContainerHighest == ''" + changes: + - kind: 'renameParameter' + oldName: 'surfaceVariant' + newName: 'surfaceContainerHighest' + - if: "surfaceContainerHighest != ''" + changes: + - kind: 'removeParameter' + name: 'surfaceVariant' + variables: + surfaceContainerHighest: + kind: 'fragment' + value: 'arguments[surfaceContainerHighest]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate background" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + method: 'copyWith' + inClass: 'ColorScheme' + oneOf: + - if: "surface == ''" + changes: + - kind: 'renameParameter' + oldName: 'background' + newName: 'surface' + - if: "surface != ''" + changes: + - kind: 'removeParameter' + name: 'background' + variables: + surface: + kind: 'fragment' + value: 'arguments[surface]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate onBackground" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + method: 'copyWith' + inClass: 'ColorScheme' + oneOf: + - if: "onSurface == ''" + changes: + - kind: 'renameParameter' + oldName: 'onBackground' + newName: 'onSurface' + - if: "onSurface != ''" + changes: + - kind: 'removeParameter' + name: 'onBackground' + variables: + onSurface: + kind: 'fragment' + value: 'arguments[onSurface]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate surfaceVariant" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + method: 'copyWith' + inClass: 'ColorScheme' + oneOf: + - if: "surfaceContainerHighest == ''" + changes: + - kind: 'renameParameter' + oldName: 'surfaceVariant' + newName: 'surfaceContainerHighest' + - if: "surfaceContainerHighest != ''" + changes: + - kind: 'removeParameter' + name: 'surfaceVariant' + variables: + surfaceContainerHighest: + kind: 'fragment' + value: 'arguments[surfaceContainerHighest]' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate 'background' to 'surface'" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + getter: 'background' + inClass: 'ColorScheme' + changes: + - kind: 'rename' + newName: 'surface' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate 'onBackground' to 'onSurface'" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + getter: 'onBackground' + inClass: 'ColorScheme' + changes: + - kind: 'rename' + newName: 'onSurface' + + # Changes made in https://github.com/flutter/flutter/pull/138521 + - title: "Migrate 'surfaceVariant' to 'surfaceContainerHighest'" + date: 2023-12-04 + element: + uris: [ 'material.dart' ] + getter: 'surfaceVariant' + inClass: 'ColorScheme' + changes: + - kind: 'rename' + newName: 'surfaceContainerHighest' + # Changes made in https://github.com/flutter/flutter/pull/93427 - title: "Remove 'primaryVariant' and 'secondaryVariant'" date: 2021-11-19 diff --git a/packages/flutter/lib/src/material/action_chip.dart b/packages/flutter/lib/src/material/action_chip.dart index 31e85ded65ec4..c819c48feceeb 100644 --- a/packages/flutter/lib/src/material/action_chip.dart +++ b/packages/flutter/lib/src/material/action_chip.dart @@ -280,7 +280,9 @@ class _ActionChipDefaultsM3 extends ChipThemeData { ? null : _colors.onSurface.withOpacity(0.12); } - return null; + return _chipVariant == _ChipVariant.flat + ? null + : _colors.surfaceContainerLow; }); @override @@ -289,7 +291,7 @@ class _ActionChipDefaultsM3 extends ChipThemeData { : _colors.shadow; @override - Color? get surfaceTintColor => _colors.surfaceTint; + Color? get surfaceTintColor => Colors.transparent; @override Color? get checkmarkColor => null; diff --git a/packages/flutter/lib/src/material/app_bar.dart b/packages/flutter/lib/src/material/app_bar.dart index 1f5c8dc979b56..286d8c43efda1 100644 --- a/packages/flutter/lib/src/material/app_bar.dart +++ b/packages/flutter/lib/src/material/app_bar.dart @@ -848,6 +848,17 @@ class _AppBarState extends State { defaults.backgroundColor!, ); + final Color scrolledUnderBackground = _resolveColor( + states, + widget.backgroundColor, + appBarTheme.backgroundColor, + Theme.of(context).colorScheme.surfaceContainer, + ); + + final Color effectiveBackgroundColor = states.contains(MaterialState.scrolledUnder) + ? scrolledUnderBackground + : backgroundColor; + final Color foregroundColor = widget.foregroundColor ?? appBarTheme.foregroundColor ?? defaults.foregroundColor!; @@ -1113,7 +1124,7 @@ class _AppBarState extends State { ?? appBarTheme.systemOverlayStyle ?? defaults.systemOverlayStyle ?? _systemOverlayStyleForBrightness( - ThemeData.estimateBrightnessForColor(backgroundColor), + ThemeData.estimateBrightnessForColor(effectiveBackgroundColor), // Make the status bar transparent for M3 so the elevation overlay // color is picked up by the statusbar. theme.useMaterial3 ? const Color(0x00000000) : null, @@ -1124,7 +1135,7 @@ class _AppBarState extends State { child: AnnotatedRegion( value: overlayStyle, child: Material( - color: backgroundColor, + color: theme.useMaterial3 ? effectiveBackgroundColor : backgroundColor, elevation: effectiveElevation, type: widget.forceMaterialTransparency ? MaterialType.transparency @@ -1134,7 +1145,10 @@ class _AppBarState extends State { ?? defaults.shadowColor, surfaceTintColor: widget.surfaceTintColor ?? appBarTheme.surfaceTintColor - ?? defaults.surfaceTintColor, + // M3 `defaults.surfaceTint` is Colors.transparent now. It is not used + // here because otherwise, it will cause breaking change for + // `scrolledUnderElevation`. + ?? (theme.useMaterial3 ? theme.colorScheme.surfaceTint : null), shape: widget.shape ?? appBarTheme.shape ?? defaults.shape, child: Semantics( explicitChildNodes: true, @@ -2341,7 +2355,7 @@ class _AppBarDefaultsM3 extends AppBarTheme { Color? get shadowColor => Colors.transparent; @override - Color? get surfaceTintColor => _colors.surfaceTint; + Color? get surfaceTintColor => Colors.transparent; @override IconThemeData? get iconTheme => IconThemeData( diff --git a/packages/flutter/lib/src/material/banner.dart b/packages/flutter/lib/src/material/banner.dart index 7ff0a5c9079ed..67d15b8b75900 100644 --- a/packages/flutter/lib/src/material/banner.dart +++ b/packages/flutter/lib/src/material/banner.dart @@ -6,6 +6,7 @@ import 'package:flutter/widgets.dart'; import 'banner_theme.dart'; import 'color_scheme.dart'; +import 'colors.dart'; import 'divider.dart'; import 'material.dart'; import 'scaffold.dart'; @@ -153,16 +154,18 @@ class MaterialBanner extends StatefulWidget { /// The color of the surface of this [MaterialBanner]. /// /// If `null`, [MaterialBannerThemeData.backgroundColor] is used. If that is - /// also `null`, [ColorScheme.surface] of [ThemeData.colorScheme] is used. + /// also `null`, [ColorScheme.surfaceContainerLow] of [ThemeData.colorScheme] is used. final Color? backgroundColor; /// The color used as an overlay on [backgroundColor] to indicate elevation. /// /// If null, [MaterialBannerThemeData.surfaceTintColor] is used. If that - /// is also null, the default value is [ColorScheme.surfaceTint]. + /// is also null, the default value is [Colors.transparent]. /// - /// See [Material.surfaceTintColor] for more details on how this - /// overlay is applied. + /// This is not recommended for use. [Material 3 spec](https://m3.material.io/styles/color/the-color-system/color-roles) + /// introduced a set of tone-based surfaces and surface containers in its [ColorScheme], + /// which provide more flexibility. The intention is to eventually remove surface tint color from + /// the framework. final Color? surfaceTintColor; /// The color of the shadow below the [MaterialBanner]. @@ -483,10 +486,10 @@ class _BannerDefaultsM3 extends MaterialBannerThemeData { late final TextTheme _textTheme = Theme.of(context).textTheme; @override - Color? get backgroundColor => _colors.surface; + Color? get backgroundColor => _colors.surfaceContainerLow; @override - Color? get surfaceTintColor => _colors.surfaceTint; + Color? get surfaceTintColor => Colors.transparent; @override Color? get dividerColor => _colors.outlineVariant; diff --git a/packages/flutter/lib/src/material/bottom_app_bar.dart b/packages/flutter/lib/src/material/bottom_app_bar.dart index 430c717e5c53f..c06954bc25856 100644 --- a/packages/flutter/lib/src/material/bottom_app_bar.dart +++ b/packages/flutter/lib/src/material/bottom_app_bar.dart @@ -94,8 +94,9 @@ class BottomAppBar extends StatefulWidget { /// The bottom app bar's background color. /// /// If this property is null then [BottomAppBarTheme.color] of - /// [ThemeData.bottomAppBarTheme] is used. If that's null then - /// [ThemeData.bottomAppBarColor] is used. + /// [ThemeData.bottomAppBarTheme] is used. If that's null and [ThemeData.useMaterial3] + /// is true, the default value is [ColorScheme.surfaceContainer]; If that's null + /// and [ThemeData.useMaterial3] is false, then [ThemeData.bottomAppBarColor] is used. final Color? color; /// The z-coordinate at which to place this bottom app bar relative to its @@ -129,18 +130,17 @@ class BottomAppBar extends StatefulWidget { /// A custom color for the Material 3 surface-tint elevation effect. /// - /// In Material 3, a "surface tint" with an opacity related to [elevation] - /// will be applied to the [BottomAppBar]'s background. - /// Use this property to override the default color of that tint. + /// This is not recommended for use. [Material 3 spec](https://m3.material.io/styles/color/the-color-system/color-roles) + /// introduced a set of tone-based surfaces and surface containers in its [ColorScheme], + /// which provide more flexibility. The intention is to eventually remove surface tint color from + /// the framework. /// /// If this property is null, then [BottomAppBarTheme.surfaceTintColor] - /// of [ThemeData.bottomAppBarTheme] is used. - /// If that is also null, [ColorScheme.surfaceTint] is used. + /// of [ThemeData.bottomAppBarTheme] is used. If that is also null, the default + /// value is [Colors.transparent]. /// /// Ignored if [ThemeData.useMaterial3] is false. /// - /// The default is null. - /// /// See [Material.surfaceTintColor] for more details on how this overlay is applied. final Color? surfaceTintColor; @@ -308,10 +308,10 @@ class _BottomAppBarDefaultsM3 extends BottomAppBarTheme { late final ColorScheme _colors = Theme.of(context).colorScheme; @override - Color? get color => _colors.surface; + Color? get color => _colors.surfaceContainer; @override - Color? get surfaceTintColor => _colors.surfaceTint; + Color? get surfaceTintColor => Colors.transparent; @override Color? get shadowColor => Colors.transparent; diff --git a/packages/flutter/lib/src/material/bottom_sheet.dart b/packages/flutter/lib/src/material/bottom_sheet.dart index 0f40afe147564..1d62275b9ff1b 100644 --- a/packages/flutter/lib/src/material/bottom_sheet.dart +++ b/packages/flutter/lib/src/material/bottom_sheet.dart @@ -147,8 +147,7 @@ class BottomSheet extends StatefulWidget { /// The bottom sheet drag handle's color. /// /// Defaults to [BottomSheetThemeData.dragHandleColor]. - /// If that is also null, defaults to [ColorScheme.onSurfaceVariant] - /// with an opacity of 0.4. + /// If that is also null, defaults to [ColorScheme.onSurfaceVariant]. final Color? dragHandleColor; /// Defaults to [BottomSheetThemeData.dragHandleSize]. @@ -1405,16 +1404,16 @@ class _BottomSheetDefaultsM3 extends BottomSheetThemeData { late final ColorScheme _colors = Theme.of(context).colorScheme; @override - Color? get backgroundColor => _colors.surface; + Color? get backgroundColor => _colors.surfaceContainerLow; @override - Color? get surfaceTintColor => _colors.surfaceTint; + Color? get surfaceTintColor => Colors.transparent; @override Color? get shadowColor => Colors.transparent; @override - Color? get dragHandleColor => _colors.onSurfaceVariant.withOpacity(0.4); + Color? get dragHandleColor => _colors.onSurfaceVariant; @override Size? get dragHandleSize => const Size(32, 4); diff --git a/packages/flutter/lib/src/material/card.dart b/packages/flutter/lib/src/material/card.dart index 95667be1f6db5..36a01d0c34fac 100644 --- a/packages/flutter/lib/src/material/card.dart +++ b/packages/flutter/lib/src/material/card.dart @@ -119,14 +119,8 @@ class Card extends StatelessWidget { /// /// Defines the card's [Material.color]. /// - /// In Material 3, [surfaceTintColor] is drawn on top of this color - /// when the card is elevated. This might make the appearance of - /// the card slightly different than in Material 2. To disable this - /// feature, set [surfaceTintColor] to [Colors.transparent]. - /// See [Material.surfaceTintColor] for more details. - /// /// If this property is null then the ambient [CardTheme.color] is used. If that is null, - /// and [ThemeData.useMaterial3] is true, then [ColorScheme.surface] of + /// and [ThemeData.useMaterial3] is true, then [ColorScheme.surfaceContainerLow] of /// [ThemeData.colorScheme] is used. Otherwise, [ThemeData.cardColor] is used. final Color? color; @@ -139,11 +133,16 @@ class Card extends StatelessWidget { /// The color used as an overlay on [color] to indicate elevation. /// + /// This is not recommended for use. [Material 3 spec](https://m3.material.io/styles/color/the-color-system/color-roles) + /// introduced a set of tone-based surfaces and surface containers in its [ColorScheme], + /// which provide more flexibility. The intention is to eventually remove surface tint color from + /// the framework. + /// /// If this is null, no overlay will be applied. Otherwise this color /// will be composited on top of [color] with an opacity related /// to [elevation] and used to paint the background of the card. /// - /// The default is null. + /// The default is [Colors.transparent]. /// /// See [Material.surfaceTintColor] for more details on how this /// overlay is applied. @@ -286,13 +285,13 @@ class _CardDefaultsM3 extends CardTheme { late final ColorScheme _colors = Theme.of(context).colorScheme; @override - Color? get color => _colors.surface; + Color? get color => _colors.surfaceContainerLow; @override Color? get shadowColor => _colors.shadow; @override - Color? get surfaceTintColor => _colors.surfaceTint; + Color? get surfaceTintColor => Colors.transparent; @override ShapeBorder? get shape =>const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12.0))); @@ -319,7 +318,7 @@ class _FilledCardDefaultsM3 extends CardTheme { late final ColorScheme _colors = Theme.of(context).colorScheme; @override - Color? get color => _colors.surfaceVariant; + Color? get color => _colors.surfaceContainerHighest; @override Color? get shadowColor => _colors.shadow; @@ -358,7 +357,7 @@ class _OutlinedCardDefaultsM3 extends CardTheme { Color? get shadowColor => _colors.shadow; @override - Color? get surfaceTintColor => _colors.surfaceTint; + Color? get surfaceTintColor => Colors.transparent; @override ShapeBorder? get shape => diff --git a/packages/flutter/lib/src/material/checkbox.dart b/packages/flutter/lib/src/material/checkbox.dart index b898e2cf06eaf..5d289aca6d5a1 100644 --- a/packages/flutter/lib/src/material/checkbox.dart +++ b/packages/flutter/lib/src/material/checkbox.dart @@ -975,35 +975,35 @@ class _CheckboxDefaultsM3 extends CheckboxThemeData { return MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.error)) { if (states.contains(MaterialState.pressed)) { - return _colors.error.withOpacity(0.12); + return _colors.error.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.error.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.error.withOpacity(0.12); + return _colors.error.withOpacity(0.1); } } if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } return Colors.transparent; } if (states.contains(MaterialState.pressed)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } return Colors.transparent; }); diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart index 52a405ad93e32..5fdf18171350b 100644 --- a/packages/flutter/lib/src/material/chip.dart +++ b/packages/flutter/lib/src/material/chip.dart @@ -212,9 +212,12 @@ abstract interface class ChipAttributes { /// Color of the chip's surface tint overlay when its elevation is /// greater than 0. /// - /// If this is null and [ThemeData.useMaterial3] is true, then - /// [ColorScheme.surfaceTint] color is used. Otherwise, it defaults - /// to null. + /// This is not recommended for use. [Material 3 spec](https://m3.material.io/styles/color/the-color-system/color-roles) + /// introduced a set of tone-based surfaces and surface containers in its [ColorScheme], + /// which provide more flexibility. The intention is to eventually remove surface tint color from + /// the framework. + /// + /// If this is null, defaults to [Colors.transparent]. Color? get surfaceTintColor; /// Theme used for all icons in the chip. @@ -2374,7 +2377,7 @@ class _ChipDefaultsM3 extends ChipThemeData { Color? get shadowColor => Colors.transparent; @override - Color? get surfaceTintColor => _colors.surfaceTint; + Color? get surfaceTintColor => Colors.transparent; @override Color? get checkmarkColor => null; diff --git a/packages/flutter/lib/src/material/choice_chip.dart b/packages/flutter/lib/src/material/choice_chip.dart index fa03a133a01df..14885ec994f60 100644 --- a/packages/flutter/lib/src/material/choice_chip.dart +++ b/packages/flutter/lib/src/material/choice_chip.dart @@ -307,7 +307,7 @@ class _ChoiceChipDefaultsM3 extends ChipThemeData { } return _chipVariant == _ChipVariant.flat ? null - : null; + : _colors.surfaceContainerLow; }); @override @@ -316,7 +316,7 @@ class _ChoiceChipDefaultsM3 extends ChipThemeData { : _colors.shadow; @override - Color? get surfaceTintColor => _colors.surfaceTint; + Color? get surfaceTintColor => Colors.transparent; @override Color? get checkmarkColor => isEnabled diff --git a/packages/flutter/lib/src/material/color_scheme.dart b/packages/flutter/lib/src/material/color_scheme.dart index 4b6a0ff1b986d..eaa01ace6ba1f 100644 --- a/packages/flutter/lib/src/material/color_scheme.dart +++ b/packages/flutter/lib/src/material/color_scheme.dart @@ -13,7 +13,7 @@ import 'colors.dart'; import 'theme_data.dart'; /// {@template flutter.material.color_scheme.ColorScheme} -/// A set of colors based on the +/// A set of 45 colors based on the /// [Material spec](https://m3.material.io/styles/color/the-color-system/color-roles) /// that can be used to configure the color properties of most components. /// {@endtemplate} @@ -64,6 +64,13 @@ import 'theme_data.dart'; /// with on '-Fixed' roles, such as [onPrimaryFixed], they provide a /// lower-emphasis option for text and icons. /// +/// {@tool dartpad} +/// This example shows all Material [ColorScheme] roles in light and dark +/// brightnesses. +/// +/// ** See code in examples/api/lib/material/color_scheme/color_scheme.0.dart ** +/// {@end-tool} +/// /// ### Setting Colors in Flutter /// ///{@macro flutter.material.colors.settingColors} @@ -95,10 +102,11 @@ class ColorScheme with Diagnosticable { /// * [onSecondary] /// * [error] /// * [onError] - /// * [background] - /// * [onBackground] /// * [surface] /// * [onSurface] + /// DEPRECATED: + /// * [background] + /// * [onBackground] const ColorScheme({ required this.brightness, required this.primary, @@ -129,8 +137,6 @@ class ColorScheme with Diagnosticable { required this.onError, Color? errorContainer, Color? onErrorContainer, - required this.background, - required this.onBackground, required this.surface, required this.onSurface, Color? surfaceDim, @@ -140,7 +146,6 @@ class ColorScheme with Diagnosticable { Color? surfaceContainer, Color? surfaceContainerHigh, Color? surfaceContainerHighest, - Color? surfaceVariant, Color? onSurfaceVariant, Color? outline, Color? outlineVariant, @@ -150,6 +155,21 @@ class ColorScheme with Diagnosticable { Color? onInverseSurface, Color? inversePrimary, Color? surfaceTint, + @Deprecated( + 'Use surface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? background, + @Deprecated( + 'Use onSurface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? onBackground, + @Deprecated( + 'Use surfaceContainerHighest instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? surfaceVariant, }) : _primaryContainer = primaryContainer, _onPrimaryContainer = onPrimaryContainer, _primaryFixed = primaryFixed, @@ -179,7 +199,6 @@ class ColorScheme with Diagnosticable { _surfaceContainer = surfaceContainer, _surfaceContainerHigh = surfaceContainerHigh, _surfaceContainerHighest = surfaceContainerHighest, - _surfaceVariant = surfaceVariant, _onSurfaceVariant = onSurfaceVariant, _outline = outline, _outlineVariant = outlineVariant, @@ -188,7 +207,11 @@ class ColorScheme with Diagnosticable { _inverseSurface = inverseSurface, _onInverseSurface = onInverseSurface, _inversePrimary = inversePrimary, - _surfaceTint = surfaceTint; + _surfaceTint = surfaceTint, + // DEPRECATED (newest deprecations at the bottom) + _background = background, + _onBackground = onBackground, + _surfaceVariant = surfaceVariant; /// Generate a [ColorScheme] derived from the given `seedColor`. /// @@ -219,25 +242,41 @@ class ColorScheme with Diagnosticable { Color? onPrimary, Color? primaryContainer, Color? onPrimaryContainer, + Color? primaryFixed, + Color? primaryFixedDim, + Color? onPrimaryFixed, + Color? onPrimaryFixedVariant, Color? secondary, Color? onSecondary, Color? secondaryContainer, Color? onSecondaryContainer, + Color? secondaryFixed, + Color? secondaryFixedDim, + Color? onSecondaryFixed, + Color? onSecondaryFixedVariant, Color? tertiary, Color? onTertiary, Color? tertiaryContainer, Color? onTertiaryContainer, + Color? tertiaryFixed, + Color? tertiaryFixedDim, + Color? onTertiaryFixed, + Color? onTertiaryFixedVariant, Color? error, Color? onError, Color? errorContainer, Color? onErrorContainer, Color? outline, Color? outlineVariant, - Color? background, - Color? onBackground, Color? surface, Color? onSurface, - Color? surfaceVariant, + Color? surfaceDim, + Color? surfaceBright, + Color? surfaceContainerLowest, + Color? surfaceContainerLow, + Color? surfaceContainer, + Color? surfaceContainerHigh, + Color? surfaceContainerHighest, Color? onSurfaceVariant, Color? inverseSurface, Color? onInverseSurface, @@ -245,43 +284,82 @@ class ColorScheme with Diagnosticable { Color? shadow, Color? scrim, Color? surfaceTint, + @Deprecated( + 'Use surface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? background, + @Deprecated( + 'Use onSurface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? onBackground, + @Deprecated( + 'Use surfaceContainerHighest instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? surfaceVariant, }) { - final Scheme scheme = switch (brightness) { - Brightness.light => Scheme.light(seedColor.value), - Brightness.dark => Scheme.dark(seedColor.value), - }; + final SchemeTonalSpot scheme; + switch (brightness) { + case Brightness.light: + scheme = SchemeTonalSpot(sourceColorHct: Hct.fromInt(seedColor.value), isDark: false, contrastLevel: 0.0); + case Brightness.dark: + scheme = SchemeTonalSpot(sourceColorHct: Hct.fromInt(seedColor.value), isDark: true, contrastLevel: 0.0); + } + return ColorScheme( - primary: primary ?? Color(scheme.primary), - onPrimary: onPrimary ?? Color(scheme.onPrimary), - primaryContainer: primaryContainer ?? Color(scheme.primaryContainer), - onPrimaryContainer: onPrimaryContainer ?? Color(scheme.onPrimaryContainer), - secondary: secondary ?? Color(scheme.secondary), - onSecondary: onSecondary ?? Color(scheme.onSecondary), - secondaryContainer: secondaryContainer ?? Color(scheme.secondaryContainer), - onSecondaryContainer: onSecondaryContainer ?? Color(scheme.onSecondaryContainer), - tertiary: tertiary ?? Color(scheme.tertiary), - onTertiary: onTertiary ?? Color(scheme.onTertiary), - tertiaryContainer: tertiaryContainer ?? Color(scheme.tertiaryContainer), - onTertiaryContainer: onTertiaryContainer ?? Color(scheme.onTertiaryContainer), - error: error ?? Color(scheme.error), - onError: onError ?? Color(scheme.onError), - errorContainer: errorContainer ?? Color(scheme.errorContainer), - onErrorContainer: onErrorContainer ?? Color(scheme.onErrorContainer), - outline: outline ?? Color(scheme.outline), - outlineVariant: outlineVariant ?? Color(scheme.outlineVariant), - background: background ?? Color(scheme.background), - onBackground: onBackground ?? Color(scheme.onBackground), - surface: surface ?? Color(scheme.surface), - onSurface: onSurface ?? Color(scheme.onSurface), - surfaceVariant: surfaceVariant ?? Color(scheme.surfaceVariant), - onSurfaceVariant: onSurfaceVariant ?? Color(scheme.onSurfaceVariant), - inverseSurface: inverseSurface ?? Color(scheme.inverseSurface), - onInverseSurface: onInverseSurface ?? Color(scheme.inverseOnSurface), - inversePrimary: inversePrimary ?? Color(scheme.inversePrimary), - shadow: shadow ?? Color(scheme.shadow), - scrim: scrim ?? Color(scheme.scrim), - surfaceTint: surfaceTint ?? Color(scheme.primary), + primary: primary ?? Color(MaterialDynamicColors.primary.getArgb(scheme)), + onPrimary: onPrimary ?? Color(MaterialDynamicColors.onPrimary.getArgb(scheme)), + primaryContainer: primaryContainer ?? Color(MaterialDynamicColors.primaryContainer.getArgb(scheme)), + onPrimaryContainer: onPrimaryContainer ?? Color(MaterialDynamicColors.onPrimaryContainer.getArgb(scheme)), + primaryFixed: primaryFixed ?? Color(MaterialDynamicColors.primaryFixed.getArgb(scheme)), + primaryFixedDim: primaryFixedDim ?? Color(MaterialDynamicColors.primaryFixedDim.getArgb(scheme)), + onPrimaryFixed: onPrimaryFixed ?? Color(MaterialDynamicColors.onPrimaryFixed.getArgb(scheme)), + onPrimaryFixedVariant: onPrimaryFixedVariant ?? Color(MaterialDynamicColors.onPrimaryFixedVariant.getArgb(scheme)), + secondary: secondary ?? Color(MaterialDynamicColors.secondary.getArgb(scheme)), + onSecondary: onSecondary ?? Color(MaterialDynamicColors.onSecondary.getArgb(scheme)), + secondaryContainer: secondaryContainer ?? Color(MaterialDynamicColors.secondaryContainer.getArgb(scheme)), + onSecondaryContainer: onSecondaryContainer ?? Color(MaterialDynamicColors.onSecondaryContainer.getArgb(scheme)), + secondaryFixed: secondaryFixed ?? Color(MaterialDynamicColors.secondaryFixed.getArgb(scheme)), + secondaryFixedDim: secondaryFixedDim ?? Color(MaterialDynamicColors.secondaryFixedDim.getArgb(scheme)), + onSecondaryFixed: onSecondaryFixed ?? Color(MaterialDynamicColors.onSecondaryFixed.getArgb(scheme)), + onSecondaryFixedVariant: onSecondaryFixedVariant ?? Color(MaterialDynamicColors.onSecondaryFixedVariant.getArgb(scheme)), + tertiary: tertiary ?? Color(MaterialDynamicColors.tertiary.getArgb(scheme)), + onTertiary: onTertiary ?? Color(MaterialDynamicColors.onTertiary.getArgb(scheme)), + tertiaryContainer: tertiaryContainer ?? Color(MaterialDynamicColors.tertiaryContainer.getArgb(scheme)), + onTertiaryContainer: onTertiaryContainer ?? Color(MaterialDynamicColors.onTertiaryContainer.getArgb(scheme)), + tertiaryFixed: tertiaryFixed ?? Color(MaterialDynamicColors.tertiaryFixed.getArgb(scheme)), + tertiaryFixedDim: tertiaryFixedDim ?? Color(MaterialDynamicColors.tertiaryFixedDim.getArgb(scheme)), + onTertiaryFixed: onTertiaryFixed ?? Color(MaterialDynamicColors.onTertiaryFixed.getArgb(scheme)), + onTertiaryFixedVariant: onTertiaryFixedVariant ?? Color(MaterialDynamicColors.onTertiaryFixedVariant.getArgb(scheme)), + error: error ?? Color(MaterialDynamicColors.error.getArgb(scheme)), + onError: onError ?? Color(MaterialDynamicColors.onError.getArgb(scheme)), + errorContainer: errorContainer ?? Color(MaterialDynamicColors.errorContainer.getArgb(scheme)), + onErrorContainer: onErrorContainer ?? Color(MaterialDynamicColors.onErrorContainer.getArgb(scheme)), + outline: outline ?? Color(MaterialDynamicColors.outline.getArgb(scheme)), + outlineVariant: outlineVariant ?? Color(MaterialDynamicColors.outlineVariant.getArgb(scheme)), + surface: surface ?? Color(MaterialDynamicColors.surface.getArgb(scheme)), + surfaceDim: surfaceDim ?? Color(MaterialDynamicColors.surfaceDim.getArgb(scheme)), + surfaceBright: surfaceBright ?? Color(MaterialDynamicColors.surfaceBright.getArgb(scheme)), + surfaceContainerLowest: surfaceContainerLowest ?? Color(MaterialDynamicColors.surfaceContainerLowest.getArgb(scheme)), + surfaceContainerLow: surfaceContainerLow ?? Color(MaterialDynamicColors.surfaceContainerLow.getArgb(scheme)), + surfaceContainer: surfaceContainer ?? Color(MaterialDynamicColors.surfaceContainer.getArgb(scheme)), + surfaceContainerHigh: surfaceContainerHigh ?? Color(MaterialDynamicColors.surfaceContainerHigh.getArgb(scheme)), + surfaceContainerHighest: surfaceContainerHighest ?? Color(MaterialDynamicColors.surfaceContainerHighest.getArgb(scheme)), + onSurface: onSurface ?? Color(MaterialDynamicColors.onSurface.getArgb(scheme)), + onSurfaceVariant: onSurfaceVariant ?? Color(MaterialDynamicColors.onSurfaceVariant.getArgb(scheme)), + inverseSurface: inverseSurface ?? Color(MaterialDynamicColors.inverseSurface.getArgb(scheme)), + onInverseSurface: onInverseSurface ?? Color(MaterialDynamicColors.inverseOnSurface.getArgb(scheme)), + inversePrimary: inversePrimary ?? Color(MaterialDynamicColors.inversePrimary.getArgb(scheme)), + shadow: shadow ?? Color(MaterialDynamicColors.shadow.getArgb(scheme)), + scrim: scrim ?? Color(MaterialDynamicColors.scrim.getArgb(scheme)), + surfaceTint: surfaceTint ?? Color(MaterialDynamicColors.primary.getArgb(scheme)), brightness: brightness, + // DEPRECATED (newest deprecations at the bottom) + background: background ?? Color(MaterialDynamicColors.background.getArgb(scheme)), + onBackground: onBackground ?? Color(MaterialDynamicColors.onBackground.getArgb(scheme)), + surfaceVariant: surfaceVariant ?? Color(MaterialDynamicColors.surfaceVariant.getArgb(scheme)), ); } @@ -338,8 +416,6 @@ class ColorScheme with Diagnosticable { this.onError = Colors.white, Color? errorContainer, Color? onErrorContainer, - this.background = Colors.white, - this.onBackground = Colors.black, this.surface = Colors.white, this.onSurface = Colors.black, Color? surfaceDim, @@ -349,7 +425,6 @@ class ColorScheme with Diagnosticable { Color? surfaceContainer, Color? surfaceContainerHigh, Color? surfaceContainerHighest, - Color? surfaceVariant, Color? onSurfaceVariant, Color? outline, Color? outlineVariant, @@ -359,6 +434,21 @@ class ColorScheme with Diagnosticable { Color? onInverseSurface, Color? inversePrimary, Color? surfaceTint, + @Deprecated( + 'Use surface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? background = Colors.white, + @Deprecated( + 'Use onSurface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? onBackground = Colors.black, + @Deprecated( + 'Use surfaceContainerHighest instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? surfaceVariant }) : _primaryContainer = primaryContainer, _onPrimaryContainer = onPrimaryContainer, _primaryFixed = primaryFixed, @@ -388,7 +478,6 @@ class ColorScheme with Diagnosticable { _surfaceContainer = surfaceContainer, _surfaceContainerHigh = surfaceContainerHigh, _surfaceContainerHighest = surfaceContainerHighest, - _surfaceVariant = surfaceVariant, _onSurfaceVariant = onSurfaceVariant, _outline = outline, _outlineVariant = outlineVariant, @@ -397,7 +486,11 @@ class ColorScheme with Diagnosticable { _inverseSurface = inverseSurface, _onInverseSurface = onInverseSurface, _inversePrimary = inversePrimary, - _surfaceTint = surfaceTint; + _surfaceTint = surfaceTint, + // DEPRECATED (newest deprecations at the bottom) + _background = background, + _onBackground = onBackground, + _surfaceVariant = surfaceVariant; /// Create the dark color scheme that matches the /// [baseline Material 2 color scheme](https://material.io/design/color/dark-theme.html#ui-application). @@ -457,8 +550,6 @@ class ColorScheme with Diagnosticable { this.onError = Colors.black, Color? errorContainer, Color? onErrorContainer, - this.background = const Color(0xff121212), - this.onBackground = Colors.white, this.surface = const Color(0xff121212), this.onSurface = Colors.white, Color? surfaceDim, @@ -468,7 +559,6 @@ class ColorScheme with Diagnosticable { Color? surfaceContainer, Color? surfaceContainerHigh, Color? surfaceContainerHighest, - Color? surfaceVariant, Color? onSurfaceVariant, Color? outline, Color? outlineVariant, @@ -478,6 +568,21 @@ class ColorScheme with Diagnosticable { Color? onInverseSurface, Color? inversePrimary, Color? surfaceTint, + @Deprecated( + 'Use surface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? background = const Color(0xff121212), + @Deprecated( + 'Use onSurface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? onBackground = Colors.white, + @Deprecated( + 'Use surfaceContainerHighest instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? surfaceVariant, }) : _primaryContainer = primaryContainer, _onPrimaryContainer = onPrimaryContainer, _primaryFixed = primaryFixed, @@ -507,7 +612,6 @@ class ColorScheme with Diagnosticable { _surfaceContainer = surfaceContainer, _surfaceContainerHigh = surfaceContainerHigh, _surfaceContainerHighest = surfaceContainerHighest, - _surfaceVariant = surfaceVariant, _onSurfaceVariant = onSurfaceVariant, _outline = outline, _outlineVariant = outlineVariant, @@ -516,7 +620,11 @@ class ColorScheme with Diagnosticable { _inverseSurface = inverseSurface, _onInverseSurface = onInverseSurface, _inversePrimary = inversePrimary, - _surfaceTint = surfaceTint; + _surfaceTint = surfaceTint, + // DEPRECATED (newest deprecations at the bottom) + _background = background, + _onBackground = onBackground, + _surfaceVariant = surfaceVariant; /// Create a high contrast ColorScheme based on a purple primary color that /// matches the [baseline Material 2 color scheme](https://material.io/design/color/the-color-system.html#color-theme-creation). @@ -571,8 +679,6 @@ class ColorScheme with Diagnosticable { this.onError = Colors.white, Color? errorContainer, Color? onErrorContainer, - this.background = Colors.white, - this.onBackground = Colors.black, this.surface = Colors.white, this.onSurface = Colors.black, Color? surfaceDim, @@ -582,7 +688,6 @@ class ColorScheme with Diagnosticable { Color? surfaceContainer, Color? surfaceContainerHigh, Color? surfaceContainerHighest, - Color? surfaceVariant, Color? onSurfaceVariant, Color? outline, Color? outlineVariant, @@ -592,6 +697,21 @@ class ColorScheme with Diagnosticable { Color? onInverseSurface, Color? inversePrimary, Color? surfaceTint, + @Deprecated( + 'Use surface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? background = Colors.white, + @Deprecated( + 'Use onSurface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? onBackground = Colors.black, + @Deprecated( + 'Use surfaceContainerHighest instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? surfaceVariant, }) : _primaryContainer = primaryContainer, _onPrimaryContainer = onPrimaryContainer, _primaryFixed = primaryFixed, @@ -621,7 +741,6 @@ class ColorScheme with Diagnosticable { _surfaceContainer = surfaceContainer, _surfaceContainerHigh = surfaceContainerHigh, _surfaceContainerHighest = surfaceContainerHighest, - _surfaceVariant = surfaceVariant, _onSurfaceVariant = onSurfaceVariant, _outline = outline, _outlineVariant = outlineVariant, @@ -630,7 +749,11 @@ class ColorScheme with Diagnosticable { _inverseSurface = inverseSurface, _onInverseSurface = onInverseSurface, _inversePrimary = inversePrimary, - _surfaceTint = surfaceTint; + _surfaceTint = surfaceTint, + // DEPRECATED (newest deprecations at the bottom) + _background = background, + _onBackground = onBackground, + _surfaceVariant = surfaceVariant; /// Create a high contrast ColorScheme based on the dark /// [baseline Material 2 color scheme](https://material.io/design/color/dark-theme.html#ui-application). @@ -690,8 +813,6 @@ class ColorScheme with Diagnosticable { this.onError = Colors.black, Color? errorContainer, Color? onErrorContainer, - this.background = const Color(0xff121212), - this.onBackground = Colors.white, this.surface = const Color(0xff121212), this.onSurface = Colors.white, Color? surfaceDim, @@ -701,7 +822,6 @@ class ColorScheme with Diagnosticable { Color? surfaceContainer, Color? surfaceContainerHigh, Color? surfaceContainerHighest, - Color? surfaceVariant, Color? onSurfaceVariant, Color? outline, Color? outlineVariant, @@ -711,6 +831,21 @@ class ColorScheme with Diagnosticable { Color? onInverseSurface, Color? inversePrimary, Color? surfaceTint, + @Deprecated( + 'Use surface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? background = const Color(0xff121212), + @Deprecated( + 'Use onSurface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? onBackground = Colors.white, + @Deprecated( + 'Use surfaceContainerHighest instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? surfaceVariant, }) : _primaryContainer = primaryContainer, _onPrimaryContainer = onPrimaryContainer, _primaryFixed = primaryFixed, @@ -740,7 +875,6 @@ class ColorScheme with Diagnosticable { _surfaceContainer = surfaceContainer, _surfaceContainerHigh = surfaceContainerHigh, _surfaceContainerHighest = surfaceContainerHighest, - _surfaceVariant = surfaceVariant, _onSurfaceVariant = onSurfaceVariant, _outline = outline, _outlineVariant = outlineVariant, @@ -749,7 +883,11 @@ class ColorScheme with Diagnosticable { _inverseSurface = inverseSurface, _onInverseSurface = onInverseSurface, _inversePrimary = inversePrimary, - _surfaceTint = surfaceTint; + _surfaceTint = surfaceTint, + // DEPRECATED (newest deprecations at the bottom) + _background = background, + _onBackground = onBackground, + _surfaceVariant = surfaceVariant; /// Creates a color scheme from a [MaterialColor] swatch. /// @@ -778,14 +916,15 @@ class ColorScheme with Diagnosticable { primary: primarySwatch, secondary: secondary, surface: cardColor ?? (isDark ? Colors.grey[800]! : Colors.white), - background: backgroundColor ?? (isDark ? Colors.grey[700]! : primarySwatch[200]!), error: errorColor ?? Colors.red[700]!, onPrimary: primaryIsDark ? Colors.white : Colors.black, onSecondary: secondaryIsDark ? Colors.white : Colors.black, onSurface: isDark ? Colors.white : Colors.black, - onBackground: primaryIsDark ? Colors.white : Colors.black, onError: isDark ? Colors.black : Colors.white, brightness: brightness, + // DEPRECATED (newest deprecations at the bottom) + background: backgroundColor ?? (isDark ? Colors.grey[700]! : primarySwatch[200]!), + onBackground: primaryIsDark ? Colors.white : Colors.black, ); } @@ -949,16 +1088,6 @@ class ColorScheme with Diagnosticable { /// . Color get onErrorContainer => _onErrorContainer ?? onError; - /// A color that typically appears behind scrollable content. - final Color background; - - /// A color that's clearly legible when drawn on [background]. - /// - /// To ensure that an app is accessible, a contrast ratio between - /// [background] and [onBackground] of at least 4.5:1 is recommended. See - /// . - final Color onBackground; - /// The background color for widgets like [Card]. final Color surface; @@ -972,6 +1101,10 @@ class ColorScheme with Diagnosticable { final Color? _surfaceVariant; /// A color variant of [surface] that can be used for differentiation against /// a component using [surface]. + @Deprecated( + 'Use surfaceContainerHighest instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) Color get surfaceVariant => _surfaceVariant ?? surface; final Color? _surfaceDim; @@ -1064,6 +1197,26 @@ class ColorScheme with Diagnosticable { /// elevation. Color get surfaceTint => _surfaceTint ?? primary; + final Color? _background; + /// A color that typically appears behind scrollable content. + @Deprecated( + 'Use surface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color get background => _background ?? surface; + + final Color? _onBackground; + /// A color that's clearly legible when drawn on [background]. + /// + /// To ensure that an app is accessible, a contrast ratio between + /// [background] and [onBackground] of at least 4.5:1 is recommended. See + /// . + @Deprecated( + 'Use onSurface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color get onBackground => _onBackground ?? onSurface; + /// Creates a copy of this color scheme with the given fields /// replaced by the non-null parameter values. ColorScheme copyWith({ @@ -1096,8 +1249,6 @@ class ColorScheme with Diagnosticable { Color? onError, Color? errorContainer, Color? onErrorContainer, - Color? background, - Color? onBackground, Color? surface, Color? onSurface, Color? surfaceDim, @@ -1107,7 +1258,6 @@ class ColorScheme with Diagnosticable { Color? surfaceContainer, Color? surfaceContainerHigh, Color? surfaceContainerHighest, - Color? surfaceVariant, Color? onSurfaceVariant, Color? outline, Color? outlineVariant, @@ -1117,6 +1267,21 @@ class ColorScheme with Diagnosticable { Color? onInverseSurface, Color? inversePrimary, Color? surfaceTint, + @Deprecated( + 'Use surface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? background, + @Deprecated( + 'Use onSurface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? onBackground, + @Deprecated( + 'Use surfaceContainerHighest instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? surfaceVariant, }) { return ColorScheme( brightness: brightness ?? this.brightness, @@ -1148,8 +1313,6 @@ class ColorScheme with Diagnosticable { onError : onError ?? this.onError, errorContainer : errorContainer ?? this.errorContainer, onErrorContainer : onErrorContainer ?? this.onErrorContainer, - background : background ?? this.background, - onBackground : onBackground ?? this.onBackground, surface : surface ?? this.surface, onSurface : onSurface ?? this.onSurface, surfaceDim : surfaceDim ?? this.surfaceDim, @@ -1159,7 +1322,6 @@ class ColorScheme with Diagnosticable { surfaceContainer : surfaceContainer ?? this.surfaceContainer, surfaceContainerHigh : surfaceContainerHigh ?? this.surfaceContainerHigh, surfaceContainerHighest : surfaceContainerHighest ?? this.surfaceContainerHighest, - surfaceVariant : surfaceVariant ?? this.surfaceVariant, onSurfaceVariant : onSurfaceVariant ?? this.onSurfaceVariant, outline : outline ?? this.outline, outlineVariant : outlineVariant ?? this.outlineVariant, @@ -1169,6 +1331,10 @@ class ColorScheme with Diagnosticable { onInverseSurface : onInverseSurface ?? this.onInverseSurface, inversePrimary : inversePrimary ?? this.inversePrimary, surfaceTint: surfaceTint ?? this.surfaceTint, + // DEPRECATED (newest deprecations at the bottom) + background : background ?? this.background, + onBackground : onBackground ?? this.onBackground, + surfaceVariant : surfaceVariant ?? this.surfaceVariant, ); } @@ -1209,8 +1375,6 @@ class ColorScheme with Diagnosticable { onError: Color.lerp(a.onError, b.onError, t)!, errorContainer: Color.lerp(a.errorContainer, b.errorContainer, t), onErrorContainer: Color.lerp(a.onErrorContainer, b.onErrorContainer, t), - background: Color.lerp(a.background, b.background, t)!, - onBackground: Color.lerp(a.onBackground, b.onBackground, t)!, surface: Color.lerp(a.surface, b.surface, t)!, onSurface: Color.lerp(a.onSurface, b.onSurface, t)!, surfaceDim: Color.lerp(a.surfaceDim, b.surfaceDim, t), @@ -1220,7 +1384,6 @@ class ColorScheme with Diagnosticable { surfaceContainer: Color.lerp(a.surfaceContainer, b.surfaceContainer, t), surfaceContainerHigh: Color.lerp(a.surfaceContainerHigh, b.surfaceContainerHigh, t), surfaceContainerHighest: Color.lerp(a.surfaceContainerHighest, b.surfaceContainerHighest, t), - surfaceVariant: Color.lerp(a.surfaceVariant, b.surfaceVariant, t), onSurfaceVariant: Color.lerp(a.onSurfaceVariant, b.onSurfaceVariant, t), outline: Color.lerp(a.outline, b.outline, t), outlineVariant: Color.lerp(a.outlineVariant, b.outlineVariant, t), @@ -1230,6 +1393,10 @@ class ColorScheme with Diagnosticable { onInverseSurface: Color.lerp(a.onInverseSurface, b.onInverseSurface, t), inversePrimary: Color.lerp(a.inversePrimary, b.inversePrimary, t), surfaceTint: Color.lerp(a.surfaceTint, b.surfaceTint, t), + // DEPRECATED (newest deprecations at the bottom) + background: Color.lerp(a.background, b.background, t), + onBackground: Color.lerp(a.onBackground, b.onBackground, t), + surfaceVariant: Color.lerp(a.surfaceVariant, b.surfaceVariant, t), ); } @@ -1271,8 +1438,6 @@ class ColorScheme with Diagnosticable { && other.onError == onError && other.errorContainer == errorContainer && other.onErrorContainer == onErrorContainer - && other.background == background - && other.onBackground == onBackground && other.surface == surface && other.onSurface == onSurface && other.surfaceDim == surfaceDim @@ -1282,7 +1447,6 @@ class ColorScheme with Diagnosticable { && other.surfaceContainer == surfaceContainer && other.surfaceContainerHigh == surfaceContainerHigh && other.surfaceContainerHighest == surfaceContainerHighest - && other.surfaceVariant == surfaceVariant && other.onSurfaceVariant == onSurfaceVariant && other.outline == outline && other.outlineVariant == outlineVariant @@ -1291,7 +1455,11 @@ class ColorScheme with Diagnosticable { && other.inverseSurface == inverseSurface && other.onInverseSurface == onInverseSurface && other.inversePrimary == inversePrimary - && other.surfaceTint == surfaceTint; + && other.surfaceTint == surfaceTint + // DEPRECATED (newest deprecations at the bottom) + && other.background == background + && other.onBackground == onBackground + && other.surfaceVariant == surfaceVariant; } @override @@ -1313,8 +1481,6 @@ class ColorScheme with Diagnosticable { onError, errorContainer, onErrorContainer, - background, - onBackground, Object.hash( surface, onSurface, @@ -1325,7 +1491,6 @@ class ColorScheme with Diagnosticable { surfaceContainer, surfaceContainerHigh, surfaceContainerHighest, - surfaceVariant, onSurfaceVariant, outline, outlineVariant, @@ -1348,6 +1513,10 @@ class ColorScheme with Diagnosticable { tertiaryFixedDim, onTertiaryFixed, onTertiaryFixedVariant, + // DEPRECATED (newest deprecations at the bottom) + background, + onBackground, + surfaceVariant, ) ), ); @@ -1385,8 +1554,6 @@ class ColorScheme with Diagnosticable { properties.add(ColorProperty('onError', onError, defaultValue: defaultScheme.onError)); properties.add(ColorProperty('errorContainer', errorContainer, defaultValue: defaultScheme.errorContainer)); properties.add(ColorProperty('onErrorContainer', onErrorContainer, defaultValue: defaultScheme.onErrorContainer)); - properties.add(ColorProperty('background', background, defaultValue: defaultScheme.background)); - properties.add(ColorProperty('onBackground', onBackground, defaultValue: defaultScheme.onBackground)); properties.add(ColorProperty('surface', surface, defaultValue: defaultScheme.surface)); properties.add(ColorProperty('onSurface', onSurface, defaultValue: defaultScheme.onSurface)); properties.add(ColorProperty('surfaceDim', surfaceDim, defaultValue: defaultScheme.surfaceDim)); @@ -1396,7 +1563,6 @@ class ColorScheme with Diagnosticable { properties.add(ColorProperty('surfaceContainer', surfaceContainer, defaultValue: defaultScheme.surfaceContainer)); properties.add(ColorProperty('surfaceContainerHigh', surfaceContainerHigh, defaultValue: defaultScheme.surfaceContainerHigh)); properties.add(ColorProperty('surfaceContainerHighest', surfaceContainerHighest, defaultValue: defaultScheme.surfaceContainerHighest)); - properties.add(ColorProperty('surfaceVariant', surfaceVariant, defaultValue: defaultScheme.surfaceVariant)); properties.add(ColorProperty('onSurfaceVariant', onSurfaceVariant, defaultValue: defaultScheme.onSurfaceVariant)); properties.add(ColorProperty('outline', outline, defaultValue: defaultScheme.outline)); properties.add(ColorProperty('outlineVariant', outlineVariant, defaultValue: defaultScheme.outlineVariant)); @@ -1406,6 +1572,10 @@ class ColorScheme with Diagnosticable { properties.add(ColorProperty('onInverseSurface', onInverseSurface, defaultValue: defaultScheme.onInverseSurface)); properties.add(ColorProperty('inversePrimary', inversePrimary, defaultValue: defaultScheme.inversePrimary)); properties.add(ColorProperty('surfaceTint', surfaceTint, defaultValue: defaultScheme.surfaceTint)); + // DEPRECATED (newest deprecations at the bottom) + properties.add(ColorProperty('background', background, defaultValue: defaultScheme.background)); + properties.add(ColorProperty('onBackground', onBackground, defaultValue: defaultScheme.onBackground)); + properties.add(ColorProperty('surfaceVariant', surfaceVariant, defaultValue: defaultScheme.surfaceVariant)); } /// Generate a [ColorScheme] derived from the given `imageProvider`. @@ -1449,25 +1619,41 @@ class ColorScheme with Diagnosticable { Color? onPrimary, Color? primaryContainer, Color? onPrimaryContainer, + Color? primaryFixed, + Color? primaryFixedDim, + Color? onPrimaryFixed, + Color? onPrimaryFixedVariant, Color? secondary, Color? onSecondary, Color? secondaryContainer, Color? onSecondaryContainer, + Color? secondaryFixed, + Color? secondaryFixedDim, + Color? onSecondaryFixed, + Color? onSecondaryFixedVariant, Color? tertiary, Color? onTertiary, Color? tertiaryContainer, Color? onTertiaryContainer, + Color? tertiaryFixed, + Color? tertiaryFixedDim, + Color? onTertiaryFixed, + Color? onTertiaryFixedVariant, Color? error, Color? onError, Color? errorContainer, Color? onErrorContainer, Color? outline, Color? outlineVariant, - Color? background, - Color? onBackground, Color? surface, Color? onSurface, - Color? surfaceVariant, + Color? surfaceDim, + Color? surfaceBright, + Color? surfaceContainerLowest, + Color? surfaceContainerLow, + Color? surfaceContainer, + Color? surfaceContainerHigh, + Color? surfaceContainerHighest, Color? onSurfaceVariant, Color? inverseSurface, Color? onInverseSurface, @@ -1475,6 +1661,21 @@ class ColorScheme with Diagnosticable { Color? shadow, Color? scrim, Color? surfaceTint, + @Deprecated( + 'Use surface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? background, + @Deprecated( + 'Use onSurface instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? onBackground, + @Deprecated( + 'Use surfaceContainerHighest instead. ' + 'This feature was deprecated after v3.18.0-0.1.pre.' + ) + Color? surfaceVariant, }) async { // Extract dominant colors from image. final QuantizerResult quantizerResult = @@ -1487,42 +1688,66 @@ class ColorScheme with Diagnosticable { final List scoredResults = Score.score(colorToCount, desired: 1); final ui.Color baseColor = Color(scoredResults.first); - final Scheme scheme = switch (brightness) { - Brightness.light => Scheme.light(baseColor.value), - Brightness.dark => Scheme.dark(baseColor.value), - }; - - return ColorScheme(primary: primary ?? Color(scheme.primary), - onPrimary: onPrimary ?? Color(scheme.onPrimary), - primaryContainer: primaryContainer ?? Color(scheme.primaryContainer), - onPrimaryContainer: onPrimaryContainer ?? Color(scheme.onPrimaryContainer), - secondary: secondary ?? Color(scheme.secondary), - onSecondary: onSecondary ?? Color(scheme.onSecondary), - secondaryContainer: secondaryContainer ?? Color(scheme.secondaryContainer), - onSecondaryContainer: onSecondaryContainer ?? Color(scheme.onSecondaryContainer), - tertiary: tertiary ?? Color(scheme.tertiary), - onTertiary: onTertiary ?? Color(scheme.onTertiary), - tertiaryContainer: tertiaryContainer ?? Color(scheme.tertiaryContainer), - onTertiaryContainer: onTertiaryContainer ?? Color(scheme.onTertiaryContainer), - error: error ?? Color(scheme.error), - onError: onError ?? Color(scheme.onError), - errorContainer: errorContainer ?? Color(scheme.errorContainer), - onErrorContainer: onErrorContainer ?? Color(scheme.onErrorContainer), - outline: outline ?? Color(scheme.outline), - outlineVariant: outlineVariant ?? Color(scheme.outlineVariant), - background: background ?? Color(scheme.background), - onBackground: onBackground ?? Color(scheme.onBackground), - surface: surface ?? Color(scheme.surface), - onSurface: onSurface ?? Color(scheme.onSurface), - surfaceVariant: surfaceVariant ?? Color(scheme.surfaceVariant), - onSurfaceVariant: onSurfaceVariant ?? Color(scheme.onSurfaceVariant), - inverseSurface: inverseSurface ?? Color(scheme.inverseSurface), - onInverseSurface: onInverseSurface ?? Color(scheme.inverseOnSurface), - inversePrimary: inversePrimary ?? Color(scheme.inversePrimary), - shadow: shadow ?? Color(scheme.shadow), - scrim: scrim ?? Color(scheme.scrim), - surfaceTint: surfaceTint ?? Color(scheme.primary), + final SchemeTonalSpot scheme; + switch (brightness) { + case Brightness.light: + scheme = SchemeTonalSpot(sourceColorHct: Hct.fromInt(baseColor.value), isDark: false, contrastLevel: 0.0); + case Brightness.dark: + scheme = SchemeTonalSpot(sourceColorHct: Hct.fromInt(baseColor.value), isDark: true, contrastLevel: 0.0); + } + + return ColorScheme( + primary: primary ?? Color(MaterialDynamicColors.primary.getArgb(scheme)), + onPrimary: onPrimary ?? Color(MaterialDynamicColors.onPrimary.getArgb(scheme)), + primaryContainer: primaryContainer ?? Color(MaterialDynamicColors.primaryContainer.getArgb(scheme)), + onPrimaryContainer: onPrimaryContainer ?? Color(MaterialDynamicColors.onPrimaryContainer.getArgb(scheme)), + primaryFixed: primaryFixed ?? Color(MaterialDynamicColors.primaryFixed.getArgb(scheme)), + primaryFixedDim: primaryFixedDim ?? Color(MaterialDynamicColors.primaryFixedDim.getArgb(scheme)), + onPrimaryFixed: onPrimaryFixed ?? Color(MaterialDynamicColors.onPrimaryFixed.getArgb(scheme)), + onPrimaryFixedVariant: onPrimaryFixedVariant ?? Color(MaterialDynamicColors.onPrimaryFixedVariant.getArgb(scheme)), + secondary: secondary ?? Color(MaterialDynamicColors.secondary.getArgb(scheme)), + onSecondary: onSecondary ?? Color(MaterialDynamicColors.onSecondary.getArgb(scheme)), + secondaryContainer: secondaryContainer ?? Color(MaterialDynamicColors.secondaryContainer.getArgb(scheme)), + onSecondaryContainer: onSecondaryContainer ?? Color(MaterialDynamicColors.onSecondaryContainer.getArgb(scheme)), + secondaryFixed: secondaryFixed ?? Color(MaterialDynamicColors.secondaryFixed.getArgb(scheme)), + secondaryFixedDim: secondaryFixedDim ?? Color(MaterialDynamicColors.secondaryFixedDim.getArgb(scheme)), + onSecondaryFixed: onSecondaryFixed ?? Color(MaterialDynamicColors.onSecondaryFixed.getArgb(scheme)), + onSecondaryFixedVariant: onSecondaryFixedVariant ?? Color(MaterialDynamicColors.onSecondaryFixedVariant.getArgb(scheme)), + tertiary: tertiary ?? Color(MaterialDynamicColors.tertiary.getArgb(scheme)), + onTertiary: onTertiary ?? Color(MaterialDynamicColors.onTertiary.getArgb(scheme)), + tertiaryContainer: tertiaryContainer ?? Color(MaterialDynamicColors.tertiaryContainer.getArgb(scheme)), + onTertiaryContainer: onTertiaryContainer ?? Color(MaterialDynamicColors.onTertiaryContainer.getArgb(scheme)), + tertiaryFixed: tertiaryFixed ?? Color(MaterialDynamicColors.tertiaryFixed.getArgb(scheme)), + tertiaryFixedDim: tertiaryFixedDim ?? Color(MaterialDynamicColors.tertiaryFixedDim.getArgb(scheme)), + onTertiaryFixed: onTertiaryFixed ?? Color(MaterialDynamicColors.onTertiaryFixed.getArgb(scheme)), + onTertiaryFixedVariant: onTertiaryFixedVariant ?? Color(MaterialDynamicColors.onTertiaryFixedVariant.getArgb(scheme)), + error: error ?? Color(MaterialDynamicColors.error.getArgb(scheme)), + onError: onError ?? Color(MaterialDynamicColors.onError.getArgb(scheme)), + errorContainer: errorContainer ?? Color(MaterialDynamicColors.errorContainer.getArgb(scheme)), + onErrorContainer: onErrorContainer ?? Color(MaterialDynamicColors.onErrorContainer.getArgb(scheme)), + outline: outline ?? Color(MaterialDynamicColors.outline.getArgb(scheme)), + outlineVariant: outlineVariant ?? Color(MaterialDynamicColors.outlineVariant.getArgb(scheme)), + surface: surface ?? Color(MaterialDynamicColors.surface.getArgb(scheme)), + surfaceDim: surfaceDim ?? Color(MaterialDynamicColors.surfaceDim.getArgb(scheme)), + surfaceBright: surfaceBright ?? Color(MaterialDynamicColors.surfaceBright.getArgb(scheme)), + surfaceContainerLowest: surfaceContainerLowest ?? Color(MaterialDynamicColors.surfaceContainerLowest.getArgb(scheme)), + surfaceContainerLow: surfaceContainerLow ?? Color(MaterialDynamicColors.surfaceContainerLow.getArgb(scheme)), + surfaceContainer: surfaceContainer ?? Color(MaterialDynamicColors.surfaceContainer.getArgb(scheme)), + surfaceContainerHigh: surfaceContainerHigh ?? Color(MaterialDynamicColors.surfaceContainerHigh.getArgb(scheme)), + surfaceContainerHighest: surfaceContainerHighest ?? Color(MaterialDynamicColors.surfaceContainerHighest.getArgb(scheme)), + onSurface: onSurface ?? Color(MaterialDynamicColors.onSurface.getArgb(scheme)), + onSurfaceVariant: onSurfaceVariant ?? Color(MaterialDynamicColors.onSurfaceVariant.getArgb(scheme)), + inverseSurface: inverseSurface ?? Color(MaterialDynamicColors.inverseSurface.getArgb(scheme)), + onInverseSurface: onInverseSurface ?? Color(MaterialDynamicColors.inverseOnSurface.getArgb(scheme)), + inversePrimary: inversePrimary ?? Color(MaterialDynamicColors.inversePrimary.getArgb(scheme)), + shadow: shadow ?? Color(MaterialDynamicColors.shadow.getArgb(scheme)), + scrim: scrim ?? Color(MaterialDynamicColors.scrim.getArgb(scheme)), + surfaceTint: surfaceTint ?? Color(MaterialDynamicColors.primary.getArgb(scheme)), brightness: brightness, + // DEPRECATED (newest deprecations at the bottom) + background: background ?? Color(MaterialDynamicColors.background.getArgb(scheme)), + onBackground: onBackground ?? Color(MaterialDynamicColors.onBackground.getArgb(scheme)), + surfaceVariant: surfaceVariant ?? Color(MaterialDynamicColors.surfaceVariant.getArgb(scheme)), ); } diff --git a/packages/flutter/lib/src/material/date_picker_theme.dart b/packages/flutter/lib/src/material/date_picker_theme.dart index d2c75856b3841..cd81c2eee0aee 100644 --- a/packages/flutter/lib/src/material/date_picker_theme.dart +++ b/packages/flutter/lib/src/material/date_picker_theme.dart @@ -227,6 +227,11 @@ class DatePickerThemeData with Diagnosticable { /// to the [backgroundColor] of a full screen /// [DateRangePickerDialog]'s to indicate elevation. /// + /// This is not recommended for use. [Material 3 spec](https://m3.material.io/styles/color/the-color-system/color-roles) + /// introduced a set of tone-based surfaces and surface containers in its [ColorScheme], + /// which provide more flexibility. The intention is to eventually remove surface tint color from + /// the framework. + /// /// See also: /// [Material.surfaceTintColor], which explains how this color is related to /// [elevation]. @@ -848,7 +853,7 @@ class _DatePickerDefaultsM3 extends DatePickerThemeData { late final TextTheme _textTheme = _theme.textTheme; @override - Color? get backgroundColor => _colors.surface; + Color? get backgroundColor => _colors.surfaceContainerHigh; @override ButtonStyle get cancelButtonStyle { @@ -864,7 +869,7 @@ class _DatePickerDefaultsM3 extends DatePickerThemeData { Color? get shadowColor => Colors.transparent; @override - Color? get surfaceTintColor => _colors.surfaceTint; + Color? get surfaceTintColor => Colors.transparent; @override Color? get headerBackgroundColor => Colors.transparent; @@ -911,23 +916,23 @@ class _DatePickerDefaultsM3 extends DatePickerThemeData { MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return _colors.onPrimary.withOpacity(0.12); + return _colors.onPrimary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onPrimary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onPrimary.withOpacity(0.12); + return _colors.onPrimary.withOpacity(0.1); } } else { if (states.contains(MaterialState.pressed)) { - return _colors.onSurfaceVariant.withOpacity(0.12); + return _colors.onSurfaceVariant.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSurfaceVariant.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurfaceVariant.withOpacity(0.12); + return _colors.onSurfaceVariant.withOpacity(0.1); } } return null; @@ -978,23 +983,23 @@ class _DatePickerDefaultsM3 extends DatePickerThemeData { MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return _colors.onPrimary.withOpacity(0.12); + return _colors.onPrimary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onPrimary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onPrimary.withOpacity(0.12); + return _colors.onPrimary.withOpacity(0.1); } } else { if (states.contains(MaterialState.pressed)) { - return _colors.onSurfaceVariant.withOpacity(0.12); + return _colors.onSurfaceVariant.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSurfaceVariant.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurfaceVariant.withOpacity(0.12); + return _colors.onSurfaceVariant.withOpacity(0.1); } } return null; @@ -1013,13 +1018,13 @@ class _DatePickerDefaultsM3 extends DatePickerThemeData { MaterialStateProperty? get rangeSelectionOverlayColor => MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.pressed)) { - return _colors.onPrimaryContainer.withOpacity(0.12); + return _colors.onPrimaryContainer.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onPrimaryContainer.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onPrimaryContainer.withOpacity(0.12); + return _colors.onPrimaryContainer.withOpacity(0.1); } return null; }); diff --git a/packages/flutter/lib/src/material/dialog.dart b/packages/flutter/lib/src/material/dialog.dart index cb2af1eb448d6..3d8336fc01130 100644 --- a/packages/flutter/lib/src/material/dialog.dart +++ b/packages/flutter/lib/src/material/dialog.dart @@ -85,7 +85,7 @@ class Dialog extends StatelessWidget { /// /// This sets the [Material.color] on this [Dialog]'s [Material]. /// - /// If `null`, [ThemeData.dialogBackgroundColor] is used. + /// If `null`, [ColorScheme.surfaceContainerHigh] is used in Material 3. /// {@endtemplate} final Color? backgroundColor; @@ -135,8 +135,12 @@ class Dialog extends StatelessWidget { /// /// If [ThemeData.useMaterial3] is false property has no effect. /// - /// If null and [ThemeData.useMaterial3] is true then [ThemeData]'s - /// [ColorScheme.surfaceTint] will be used. + /// This is not recommended for use. [Material 3 spec](https://m3.material.io/styles/color/the-color-system/color-roles) + /// introduced a set of tone-based surfaces and surface containers in its [ColorScheme], + /// which provide more flexibility. The intention is to eventually remove surface tint color from + /// the framework. + /// + /// defaults to [Colors.transparent]. /// /// To disable this feature, set [surfaceTintColor] to [Colors.transparent]. /// @@ -1648,13 +1652,13 @@ class _DialogDefaultsM3 extends DialogTheme { Color? get iconColor => _colors.secondary; @override - Color? get backgroundColor => _colors.surface; + Color? get backgroundColor => _colors.surfaceContainerHigh; @override Color? get shadowColor => Colors.transparent; @override - Color? get surfaceTintColor => _colors.surfaceTint; + Color? get surfaceTintColor => Colors.transparent; @override TextStyle? get titleTextStyle => _textTheme.headlineSmall; diff --git a/packages/flutter/lib/src/material/drawer.dart b/packages/flutter/lib/src/material/drawer.dart index dc12c4b540807..e27eb149a6b91 100644 --- a/packages/flutter/lib/src/material/drawer.dart +++ b/packages/flutter/lib/src/material/drawer.dart @@ -175,13 +175,15 @@ class Drawer extends StatelessWidget { /// The color used as a surface tint overlay on the drawer's background color, /// which reflects the drawer's [elevation]. /// - /// If [ThemeData.useMaterial3] is false property has no effect. - /// - /// If null and [ThemeData.useMaterial3] is true then [ThemeData]'s - /// [ColorScheme.surfaceTint] will be used. + /// This is not recommended for use. [Material 3 spec](https://m3.material.io/styles/color/the-color-system/color-roles) + /// introduced a set of tone-based surfaces and surface containers in its [ColorScheme], + /// which provide more flexibility. The intention is to eventually remove surface tint color from + /// the framework. /// /// To disable this feature, set [surfaceTintColor] to [Colors.transparent]. /// + /// Defaults to [Colors.transparent]. + /// /// See also: /// * [Material.surfaceTintColor], which describes how the surface tint will /// be applied to the background color of the drawer. @@ -791,10 +793,10 @@ class _DrawerDefaultsM3 extends DrawerThemeData { late final TextDirection direction = Directionality.of(context); @override - Color? get backgroundColor => Theme.of(context).colorScheme.surface; + Color? get backgroundColor => Theme.of(context).colorScheme.surfaceContainerLow; @override - Color? get surfaceTintColor => Theme.of(context).colorScheme.surfaceTint; + Color? get surfaceTintColor => Colors.transparent; @override Color? get shadowColor => Colors.transparent; diff --git a/packages/flutter/lib/src/material/elevated_button.dart b/packages/flutter/lib/src/material/elevated_button.dart index 3380abd9d68b0..9a00c589ce142 100644 --- a/packages/flutter/lib/src/material/elevated_button.dart +++ b/packages/flutter/lib/src/material/elevated_button.dart @@ -358,15 +358,15 @@ class ElevatedButton extends ButtonStyleButton { /// * `textStyle` - Theme.textTheme.labelLarge /// * `backgroundColor` /// * disabled - Theme.colorScheme.onSurface(0.12) - /// * others - Theme.colorScheme.surface + /// * others - Theme.colorScheme.surfaceContainerLow /// * `foregroundColor` /// * disabled - Theme.colorScheme.onSurface(0.38) /// * others - Theme.colorScheme.primary /// * `overlayColor` /// * hovered - Theme.colorScheme.primary(0.08) - /// * focused or pressed - Theme.colorScheme.primary(0.12) + /// * focused or pressed - Theme.colorScheme.primary(0.1) /// * `shadowColor` - Theme.colorScheme.shadow - /// * `surfaceTintColor` - Theme.colorScheme.surfaceTint + /// * `surfaceTintColor` - Colors.transparent /// * `elevation` /// * disabled - 0 /// * default - 1 @@ -472,13 +472,13 @@ class _ElevatedButtonDefaultOverlay extends MaterialStateProperty with D @override Color? resolve(Set states) { if (states.contains(MaterialState.pressed)) { - return overlay.withOpacity(0.24); + return overlay.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return overlay.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return overlay.withOpacity(0.24); + return overlay.withOpacity(0.1); } return null; } @@ -629,7 +629,7 @@ class _ElevatedButtonDefaultsM3 extends ButtonStyle { if (states.contains(MaterialState.disabled)) { return _colors.onSurface.withOpacity(0.12); } - return _colors.surface; + return _colors.surfaceContainerLow; }); @override @@ -645,13 +645,13 @@ class _ElevatedButtonDefaultsM3 extends ButtonStyle { MaterialStateProperty? get overlayColor => MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.pressed)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } return null; }); @@ -662,7 +662,7 @@ class _ElevatedButtonDefaultsM3 extends ButtonStyle { @override MaterialStateProperty? get surfaceTintColor => - MaterialStatePropertyAll(_colors.surfaceTint); + const MaterialStatePropertyAll(Colors.transparent); @override MaterialStateProperty? get elevation => diff --git a/packages/flutter/lib/src/material/filled_button.dart b/packages/flutter/lib/src/material/filled_button.dart index 438aade9c371c..e84a492533178 100644 --- a/packages/flutter/lib/src/material/filled_button.dart +++ b/packages/flutter/lib/src/material/filled_button.dart @@ -417,7 +417,7 @@ class FilledButton extends ButtonStyleButton { /// * others - Theme.colorScheme.onSecondaryContainer /// * `overlayColor` /// * hovered - Theme.colorScheme.onSecondaryContainer(0.08) - /// * focused or pressed - Theme.colorScheme.onSecondaryContainer(0.12) + /// * focused or pressed - Theme.colorScheme.onSecondaryContainer(0.1) /// * `shadowColor` - Theme.colorScheme.shadow /// * `surfaceTintColor` - Colors.transparent /// * `elevation` @@ -501,13 +501,13 @@ class _FilledButtonDefaultOverlay extends MaterialStateProperty with Dia @override Color? resolve(Set states) { if (states.contains(MaterialState.pressed)) { - return overlay.withOpacity(0.12); + return overlay.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return overlay.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return overlay.withOpacity(0.12); + return overlay.withOpacity(0.1); } return null; } @@ -676,13 +676,13 @@ class _FilledButtonDefaultsM3 extends ButtonStyle { MaterialStateProperty? get overlayColor => MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.pressed)) { - return _colors.onPrimary.withOpacity(0.12); + return _colors.onPrimary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onPrimary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onPrimary.withOpacity(0.12); + return _colors.onPrimary.withOpacity(0.1); } return null; }); @@ -798,13 +798,13 @@ class _FilledTonalButtonDefaultsM3 extends ButtonStyle { MaterialStateProperty? get overlayColor => MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.pressed)) { - return _colors.onSecondaryContainer.withOpacity(0.12); + return _colors.onSecondaryContainer.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSecondaryContainer.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSecondaryContainer.withOpacity(0.12); + return _colors.onSecondaryContainer.withOpacity(0.1); } return null; }); diff --git a/packages/flutter/lib/src/material/filter_chip.dart b/packages/flutter/lib/src/material/filter_chip.dart index 4cc1403983d09..bede721c0f7a8 100644 --- a/packages/flutter/lib/src/material/filter_chip.dart +++ b/packages/flutter/lib/src/material/filter_chip.dart @@ -338,7 +338,7 @@ class _FilterChipDefaultsM3 extends ChipThemeData { } return _chipVariant == _ChipVariant.flat ? null - : null; + : _colors.surfaceContainerLow; }); @override @@ -347,7 +347,7 @@ class _FilterChipDefaultsM3 extends ChipThemeData { : _colors.shadow; @override - Color? get surfaceTintColor => _colors.surfaceTint; + Color? get surfaceTintColor => Colors.transparent; @override Color? get checkmarkColor => isEnabled diff --git a/packages/flutter/lib/src/material/floating_action_button.dart b/packages/flutter/lib/src/material/floating_action_button.dart index 1b32b6af7385f..06aed53f5a6fb 100644 --- a/packages/flutter/lib/src/material/floating_action_button.dart +++ b/packages/flutter/lib/src/material/floating_action_button.dart @@ -283,19 +283,22 @@ class FloatingActionButton extends StatelessWidget { /// The color to use for filling the button when the button has input focus. /// - /// Defaults to [ThemeData.focusColor] for the current theme. + /// In Material3, defaults to [ColorScheme.onPrimaryContainer] with opacity 0.1. + /// In Material 2, it defaults to [ThemeData.focusColor] for the current theme. final Color? focusColor; /// The color to use for filling the button when the button has a pointer /// hovering over it. /// - /// Defaults to [ThemeData.hoverColor] for the current theme. + /// Defaults to [ThemeData.hoverColor] for the current theme in Material 2. In + /// Material 3, defaults to [ColorScheme.onPrimaryContainer] with opacity 0.08. final Color? hoverColor; /// The splash color for this [FloatingActionButton]'s [InkWell]. /// /// If null, [FloatingActionButtonThemeData.splashColor] is used, if that is - /// null, [ThemeData.splashColor] is used. + /// null, [ThemeData.splashColor] is used in Material 2; [ColorScheme.onPrimaryContainer] + /// with opacity 0.1 is used in Material 3. final Color? splashColor; /// The tag to apply to the button's [Hero] widget. @@ -808,8 +811,8 @@ class _FABDefaultsM3 extends FloatingActionButtonThemeData { @override Color? get foregroundColor => _colors.onPrimaryContainer; @override Color? get backgroundColor => _colors.primaryContainer; - @override Color? get splashColor => _colors.onPrimaryContainer.withOpacity(0.12); - @override Color? get focusColor => _colors.onPrimaryContainer.withOpacity(0.12); + @override Color? get splashColor => _colors.onPrimaryContainer.withOpacity(0.1); + @override Color? get focusColor => _colors.onPrimaryContainer.withOpacity(0.1); @override Color? get hoverColor => _colors.onPrimaryContainer.withOpacity(0.08); @override diff --git a/packages/flutter/lib/src/material/icon_button.dart b/packages/flutter/lib/src/material/icon_button.dart index 8b0a9e0a529e0..bee7558d07095 100644 --- a/packages/flutter/lib/src/material/icon_button.dart +++ b/packages/flutter/lib/src/material/icon_button.dart @@ -919,9 +919,9 @@ class _IconButtonM3 extends ButtonStyleButton { /// * `overlayColor` /// * selected /// * hovered - Theme.colorScheme.primary(0.08) - /// * focused or pressed - Theme.colorScheme.primary(0.12) - /// * hovered or focused - Theme.colorScheme.onSurfaceVariant(0.08) - /// * pressed - Theme.colorScheme.onSurfaceVariant(0.12) + /// * focused or pressed - Theme.colorScheme.primary(0.1) + /// * hovered - Theme.colorScheme.onSurfaceVariant(0.08) + /// * pressed or focused - Theme.colorScheme.onSurfaceVariant(0.1) /// * others - null /// * `shadowColor` - null /// * `surfaceTintColor` - null @@ -1034,23 +1034,23 @@ class _IconButtonDefaultOverlay extends MaterialStateProperty { Color? resolve(Set states) { if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return highlightColor ?? foregroundColor?.withOpacity(0.12); + return highlightColor ?? foregroundColor?.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return hoverColor ?? foregroundColor?.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return focusColor ?? foregroundColor?.withOpacity(0.12); + return focusColor ?? foregroundColor?.withOpacity(0.1); } } if (states.contains(MaterialState.pressed)) { - return highlightColor ?? foregroundColor?.withOpacity(0.12); + return highlightColor ?? foregroundColor?.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return hoverColor ?? foregroundColor?.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return focusColor ?? foregroundColor?.withOpacity(0.08); + return focusColor ?? foregroundColor?.withOpacity(0.1); } return null; } @@ -1119,23 +1119,23 @@ class _IconButtonDefaultsM3 extends ButtonStyle { MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } } if (states.contains(MaterialState.pressed)) { - return _colors.onSurfaceVariant.withOpacity(0.12); + return _colors.onSurfaceVariant.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSurfaceVariant.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurfaceVariant.withOpacity(0.12); + return _colors.onSurfaceVariant.withOpacity(0.1); } return Colors.transparent; }); @@ -1229,7 +1229,7 @@ class _FilledIconButtonDefaultsM3 extends ButtonStyle { return _colors.primary; } if (toggleable) { // toggleable but unselected case - return _colors.surfaceVariant; + return _colors.surfaceContainerHighest; } return _colors.primary; }); @@ -1254,34 +1254,34 @@ class _FilledIconButtonDefaultsM3 extends ButtonStyle { MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return _colors.onPrimary.withOpacity(0.12); + return _colors.onPrimary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onPrimary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onPrimary.withOpacity(0.12); + return _colors.onPrimary.withOpacity(0.1); } } if (toggleable) { // toggleable but unselected case if (states.contains(MaterialState.pressed)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } } if (states.contains(MaterialState.pressed)) { - return _colors.onPrimary.withOpacity(0.12); + return _colors.onPrimary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onPrimary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onPrimary.withOpacity(0.12); + return _colors.onPrimary.withOpacity(0.1); } return Colors.transparent; }); @@ -1375,7 +1375,7 @@ class _FilledTonalIconButtonDefaultsM3 extends ButtonStyle { return _colors.secondaryContainer; } if (toggleable) { // toggleable but unselected case - return _colors.surfaceVariant; + return _colors.surfaceContainerHighest; } return _colors.secondaryContainer; }); @@ -1400,34 +1400,34 @@ class _FilledTonalIconButtonDefaultsM3 extends ButtonStyle { MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return _colors.onSecondaryContainer.withOpacity(0.12); + return _colors.onSecondaryContainer.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSecondaryContainer.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSecondaryContainer.withOpacity(0.12); + return _colors.onSecondaryContainer.withOpacity(0.1); } } if (toggleable) { // toggleable but unselected case if (states.contains(MaterialState.pressed)) { - return _colors.onSurfaceVariant.withOpacity(0.12); + return _colors.onSurfaceVariant.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSurfaceVariant.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurfaceVariant.withOpacity(0.12); + return _colors.onSurfaceVariant.withOpacity(0.1); } } if (states.contains(MaterialState.pressed)) { - return _colors.onSecondaryContainer.withOpacity(0.12); + return _colors.onSecondaryContainer.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSecondaryContainer.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSecondaryContainer.withOpacity(0.12); + return _colors.onSecondaryContainer.withOpacity(0.1); } return Colors.transparent; }); @@ -1542,7 +1542,7 @@ class _OutlinedIconButtonDefaultsM3 extends ButtonStyle { MaterialStateProperty? get overlayColor => MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return _colors.onInverseSurface.withOpacity(0.12); + return _colors.onInverseSurface.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onInverseSurface.withOpacity(0.08); @@ -1552,7 +1552,7 @@ class _OutlinedIconButtonDefaultsM3 extends ButtonStyle { } } if (states.contains(MaterialState.pressed)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSurfaceVariant.withOpacity(0.08); diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart index f9d72f04f9f46..136826b0e6596 100644 --- a/packages/flutter/lib/src/material/input_decorator.dart +++ b/packages/flutter/lib/src/material/input_decorator.dart @@ -4656,7 +4656,7 @@ class _InputDecoratorDefaultsM3 extends InputDecorationTheme { if (states.contains(MaterialState.disabled)) { return _colors.onSurface.withOpacity(0.04); } - return _colors.surfaceVariant; + return _colors.surfaceContainerHighest; }); @override diff --git a/packages/flutter/lib/src/material/menu_anchor.dart b/packages/flutter/lib/src/material/menu_anchor.dart index 16f084628f2b4..ab05d34e717c5 100644 --- a/packages/flutter/lib/src/material/menu_anchor.dart +++ b/packages/flutter/lib/src/material/menu_anchor.dart @@ -3703,7 +3703,7 @@ class _MenuBarDefaultsM3 extends MenuStyle { @override MaterialStateProperty get backgroundColor { - return MaterialStatePropertyAll(_colors.surface); + return MaterialStatePropertyAll(_colors.surfaceContainer); } @override @@ -3713,7 +3713,7 @@ class _MenuBarDefaultsM3 extends MenuStyle { @override MaterialStateProperty? get surfaceTintColor { - return MaterialStatePropertyAll(_colors.surfaceTint); + return const MaterialStatePropertyAll(Colors.transparent); } @override @@ -3823,13 +3823,13 @@ class _MenuButtonDefaultsM3 extends ButtonStyle { return MaterialStateProperty.resolveWith( (Set states) { if (states.contains(MaterialState.pressed)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } return Colors.transparent; }, @@ -3912,12 +3912,12 @@ class _MenuDefaultsM3 extends MenuStyle { @override MaterialStateProperty get backgroundColor { - return MaterialStatePropertyAll(_colors.surface); + return MaterialStatePropertyAll(_colors.surfaceContainer); } @override MaterialStateProperty? get surfaceTintColor { - return MaterialStatePropertyAll(_colors.surfaceTint); + return const MaterialStatePropertyAll(Colors.transparent); } @override diff --git a/packages/flutter/lib/src/material/navigation_bar.dart b/packages/flutter/lib/src/material/navigation_bar.dart index 6bad2342e5a3a..a17697ed60d45 100644 --- a/packages/flutter/lib/src/material/navigation_bar.dart +++ b/packages/flutter/lib/src/material/navigation_bar.dart @@ -140,7 +140,7 @@ class NavigationBar extends StatelessWidget { /// /// If null, [NavigationBarThemeData.backgroundColor] is used. If that /// is also null, then if [ThemeData.useMaterial3] is true, the value is - /// [ColorScheme.surface]. If that is false, the default blends [ColorScheme.surface] + /// [ColorScheme.surfaceContainer]. If that is false, the default blends [ColorScheme.surface] /// and [ColorScheme.onSurface] using an [ElevationOverlay]. final Color? backgroundColor; @@ -162,8 +162,13 @@ class NavigationBar extends StatelessWidget { /// The color used as an overlay on [backgroundColor] to indicate elevation. /// + /// This is not recommended for use. [Material 3 spec](https://m3.material.io/styles/color/the-color-system/color-roles) + /// introduced a set of tone-based surfaces and surface containers in its [ColorScheme], + /// which provide more flexibility. The intention is to eventually remove surface tint color from + /// the framework. + /// /// If null, [NavigationBarThemeData.surfaceTintColor] is used. If that - /// is also null, the default value is [ColorScheme.surfaceTint]. + /// is also null, the default value is [Colors.transparent]. /// /// See [Material.surfaceTintColor] for more details on how this /// overlay is applied. @@ -1363,11 +1368,11 @@ class _NavigationBarDefaultsM3 extends NavigationBarThemeData { late final ColorScheme _colors = Theme.of(context).colorScheme; late final TextTheme _textTheme = Theme.of(context).textTheme; - @override Color? get backgroundColor => _colors.surface; + @override Color? get backgroundColor => _colors.surfaceContainer; @override Color? get shadowColor => Colors.transparent; - @override Color? get surfaceTintColor => _colors.surfaceTint; + @override Color? get surfaceTintColor => Colors.transparent; @override MaterialStateProperty? get iconTheme { return MaterialStateProperty.resolveWith((Set states) { diff --git a/packages/flutter/lib/src/material/navigation_drawer.dart b/packages/flutter/lib/src/material/navigation_drawer.dart index 8ce07e90d50bb..edd9946c9b7cd 100644 --- a/packages/flutter/lib/src/material/navigation_drawer.dart +++ b/packages/flutter/lib/src/material/navigation_drawer.dart @@ -68,7 +68,7 @@ class NavigationDrawer extends StatelessWidget { /// contents. /// /// If this is null, then [NavigationDrawerThemeData.backgroundColor] is used. - /// If that is also null, then it falls back to [ColorScheme.surface]. + /// If that is also null, then it falls back to [ColorScheme.surfaceContainerLow]. final Color? backgroundColor; /// The color used for the drop shadow to indicate elevation. @@ -80,11 +80,16 @@ class NavigationDrawer extends StatelessWidget { /// See [Material.shadowColor] for more details on drop shadows. final Color? shadowColor; - /// The surface tint of the [Material] that holds the [NavigationDrawer]'s + /// The surface tint of the [Material] that holds the [NavigationDrawer]'s /// contents. /// + /// This is not recommended for use. [Material 3 spec](https://m3.material.io/styles/color/the-color-system/color-roles) + /// introduced a set of tone-based surfaces and surface containers in its [ColorScheme], + /// which provide more flexibility. The intention is to eventually remove surface tint color from + /// the framework. + /// /// If this is null, then [NavigationDrawerThemeData.surfaceTintColor] is used. - /// If that is also null, then it falls back to [Material.surfaceTintColor]'s default. + /// If that is also null, the default value is [Colors.transparent]. final Color? surfaceTintColor; /// The elevation of the [NavigationDrawer] itself. @@ -711,10 +716,10 @@ class _NavigationDrawerDefaultsM3 extends NavigationDrawerThemeData { late final TextTheme _textTheme = Theme.of(context).textTheme; @override - Color? get backgroundColor => _colors.surface; + Color? get backgroundColor => _colors.surfaceContainerLow; @override - Color? get surfaceTintColor => _colors.surfaceTint; + Color? get surfaceTintColor => Colors.transparent; @override Color? get shadowColor => Colors.transparent; diff --git a/packages/flutter/lib/src/material/outlined_button.dart b/packages/flutter/lib/src/material/outlined_button.dart index 3ca3b7caf386e..35be334606359 100644 --- a/packages/flutter/lib/src/material/outlined_button.dart +++ b/packages/flutter/lib/src/material/outlined_button.dart @@ -317,7 +317,7 @@ class OutlinedButton extends ButtonStyleButton { /// * others - Theme.colorScheme.primary /// * `overlayColor` /// * hovered - Theme.colorScheme.primary(0.08) - /// * focused or pressed - Theme.colorScheme.primary(0.12) + /// * focused or pressed - Theme.colorScheme.primary(0.1) /// * others - null /// * `shadowColor` - Colors.transparent, /// * `surfaceTintColor` - null @@ -421,13 +421,13 @@ class _OutlinedButtonDefaultOverlay extends MaterialStateProperty with D @override Color? resolve(Set states) { if (states.contains(MaterialState.pressed)) { - return foreground.withOpacity(0.12); + return foreground.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { - return foreground.withOpacity(0.04); + return foreground.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return foreground.withOpacity(0.12); + return foreground.withOpacity(0.1); } return null; } @@ -559,13 +559,13 @@ class _OutlinedButtonDefaultsM3 extends ButtonStyle { MaterialStateProperty? get overlayColor => MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.pressed)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } return null; }); diff --git a/packages/flutter/lib/src/material/popup_menu.dart b/packages/flutter/lib/src/material/popup_menu.dart index fdddc102824a0..8746b3465bffb 100644 --- a/packages/flutter/lib/src/material/popup_menu.dart +++ b/packages/flutter/lib/src/material/popup_menu.dart @@ -8,6 +8,7 @@ import 'package:flutter/scheduler.dart'; import 'package:flutter/widgets.dart'; import 'color_scheme.dart'; +import 'colors.dart'; import 'constants.dart'; import 'debug.dart'; import 'divider.dart'; @@ -1194,8 +1195,13 @@ class PopupMenuButton extends StatefulWidget { /// The color used as an overlay on [color] to indicate elevation. /// + /// This is not recommended for use. [Material 3 spec](https://m3.material.io/styles/color/the-color-system/color-roles) + /// introduced a set of tone-based surfaces and surface containers in its [ColorScheme], + /// which provide more flexibility. The intention is to eventually remove surface tint color from + /// the framework. + /// /// If null, [PopupMenuThemeData.surfaceTintColor] is used. If that - /// is also null, the default value is [ColorScheme.surfaceTint]. + /// is also null, the default value is [Colors.transparent]. /// /// See [Material.surfaceTintColor] for more details on how this /// overlay is applied. @@ -1251,7 +1257,8 @@ class PopupMenuButton extends StatefulWidget { /// /// If this property is null, then [PopupMenuThemeData.color] is used. /// If [PopupMenuThemeData.color] is also null, then - /// Theme.of(context).cardColor is used. + /// [ThemeData.cardColor] is used in Material 2. In Material3, defaults to + /// [ColorScheme.surfaceContainer]. final Color? color; /// If provided, this color is used for the button icon. @@ -1513,13 +1520,13 @@ class _PopupMenuDefaultsM3 extends PopupMenuThemeData { } @override - Color? get color => _colors.surface; + Color? get color => _colors.surfaceContainer; @override Color? get shadowColor => _colors.shadow; @override - Color? get surfaceTintColor => _colors.surfaceTint; + Color? get surfaceTintColor => Colors.transparent; @override ShapeBorder? get shape => const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0))); diff --git a/packages/flutter/lib/src/material/progress_indicator.dart b/packages/flutter/lib/src/material/progress_indicator.dart index ed53025c77ce5..8b4cf3f72486d 100644 --- a/packages/flutter/lib/src/material/progress_indicator.dart +++ b/packages/flutter/lib/src/material/progress_indicator.dart @@ -1086,7 +1086,7 @@ class _LinearProgressIndicatorDefaultsM3 extends ProgressIndicatorThemeData { Color get color => _colors.primary; @override - Color get linearTrackColor => _colors.surfaceVariant; + Color get linearTrackColor => _colors.surfaceContainerHighest; @override double get linearMinHeight => 4.0; diff --git a/packages/flutter/lib/src/material/radio.dart b/packages/flutter/lib/src/material/radio.dart index f41dda57cb9a7..d0c97e3b40810 100644 --- a/packages/flutter/lib/src/material/radio.dart +++ b/packages/flutter/lib/src/material/radio.dart @@ -330,9 +330,17 @@ class Radio extends StatefulWidget { /// [kRadialReactionAlpha], [focusColor] and [hoverColor] is used in the /// pressed, focused and hovered state. If that is also null, /// the value of [RadioThemeData.overlayColor] is used. If that is also null, - /// then the value of [ColorScheme.secondary] with alpha + /// then in Material 2, the value of [ColorScheme.secondary] with alpha /// [kRadialReactionAlpha], [ThemeData.focusColor] and [ThemeData.hoverColor] - /// is used in the pressed, focused and hovered state. + /// is used in the pressed, focused and hovered state. In Material3, the default + /// values are: + /// * selected + /// * pressed - Theme.colorScheme.onSurface(0.1) + /// * hovered - Theme.colorScheme.primary(0.08) + /// * focused - Theme.colorScheme.primary(0.1) + /// * pressed - Theme.colorScheme.primary(0.1) + /// * hovered - Theme.colorScheme.onSurface(0.08) + /// * focused - Theme.colorScheme.onSurface(0.1) final MaterialStateProperty? overlayColor; /// {@template flutter.material.radio.splashRadius} @@ -672,24 +680,24 @@ class _RadioDefaultsM3 extends RadioThemeData { return MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } return Colors.transparent; } if (states.contains(MaterialState.pressed)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } return Colors.transparent; }); diff --git a/packages/flutter/lib/src/material/search_anchor.dart b/packages/flutter/lib/src/material/search_anchor.dart index 88d8d516b9056..70184692b953c 100644 --- a/packages/flutter/lib/src/material/search_anchor.dart +++ b/packages/flutter/lib/src/material/search_anchor.dart @@ -228,7 +228,7 @@ class SearchAnchor extends StatefulWidget { /// The search view's background fill color. /// /// If null, the value of [SearchViewThemeData.backgroundColor] will be used. - /// If this is also null, then the default value is [ColorScheme.surface]. + /// If this is also null, then the default value is [ColorScheme.surfaceContainerHigh]. final Color? viewBackgroundColor; /// The elevation of the search view's [Material]. @@ -239,7 +239,10 @@ class SearchAnchor extends StatefulWidget { /// The surface tint color of the search view's [Material]. /// - /// See [Material.surfaceTintColor] for more details. + /// This is not recommended for use. [Material 3 spec](https://m3.material.io/styles/color/the-color-system/color-roles) + /// introduced a set of tone-based surfaces and surface containers in its [ColorScheme], + /// which provide more flexibility. The intention is to eventually remove surface tint color from + /// the framework. /// /// If null, the value of [SearchViewThemeData.surfaceTintColor] will be used. /// If this is also null, then the default value is [ColorScheme.surfaceTint]. @@ -1192,7 +1195,7 @@ class SearchBar extends StatefulWidget { /// The search bar's background fill color. /// /// If null, the value of [SearchBarThemeData.backgroundColor] will be used. - /// If this is also null, then the default value is [ColorScheme.surface]. + /// If this is also null, then the default value is [ColorScheme.surfaceContainerHigh]. final MaterialStateProperty? backgroundColor; /// The shadow color of the search bar's [Material]. @@ -1203,10 +1206,13 @@ class SearchBar extends StatefulWidget { /// The surface tint color of the search bar's [Material]. /// - /// See [Material.surfaceTintColor] for more details. + /// This is not recommended for use. [Material 3 spec](https://m3.material.io/styles/color/the-color-system/color-roles) + /// introduced a set of tone-based surfaces and surface containers in its [ColorScheme], + /// which provide more flexibility. The intention is to eventually remove surface tint color from + /// the framework. /// /// If null, the value of [SearchBarThemeData.surfaceTintColor] will be used. - /// If this is also null, then the default value is [ColorScheme.surfaceTint]. + /// If this is also null, then the default value is [Colors.transparent]. final MaterialStateProperty? surfaceTintColor; /// The highlight color that's typically used to indicate that @@ -1445,7 +1451,7 @@ class _SearchBarDefaultsM3 extends SearchBarThemeData { @override MaterialStateProperty? get backgroundColor => - MaterialStatePropertyAll(_colors.surface); + MaterialStatePropertyAll(_colors.surfaceContainerHigh); @override MaterialStateProperty? get elevation => @@ -1457,13 +1463,13 @@ class _SearchBarDefaultsM3 extends SearchBarThemeData { @override MaterialStateProperty? get surfaceTintColor => - MaterialStatePropertyAll(_colors.surfaceTint); + const MaterialStatePropertyAll(Colors.transparent); @override MaterialStateProperty? get overlayColor => MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.pressed)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); @@ -1520,13 +1526,13 @@ class _SearchViewDefaultsM3 extends SearchViewThemeData { static double fullScreenBarHeight = 72.0; @override - Color? get backgroundColor => _colors.surface; + Color? get backgroundColor => _colors.surfaceContainerHigh; @override double? get elevation => 6.0; @override - Color? get surfaceTintColor => _colors.surfaceTint; + Color? get surfaceTintColor => Colors.transparent; // No default side diff --git a/packages/flutter/lib/src/material/segmented_button.dart b/packages/flutter/lib/src/material/segmented_button.dart index b2dd0e123934f..540513e82c632 100644 --- a/packages/flutter/lib/src/material/segmented_button.dart +++ b/packages/flutter/lib/src/material/segmented_button.dart @@ -985,23 +985,23 @@ class _SegmentedButtonDefaultsM3 extends SegmentedButtonThemeData { overlayColor: MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return _colors.onSecondaryContainer.withOpacity(0.12); + return _colors.onSecondaryContainer.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSecondaryContainer.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSecondaryContainer.withOpacity(0.12); + return _colors.onSecondaryContainer.withOpacity(0.1); } } else { if (states.contains(MaterialState.pressed)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } } return null; @@ -1026,23 +1026,23 @@ class _SegmentedButtonDefaultsM3 extends SegmentedButtonThemeData { return MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return selectedColor?.withOpacity(0.12); + return selectedColor?.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return selectedColor?.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return selectedColor?.withOpacity(0.12); + return selectedColor?.withOpacity(0.1); } } else { if (states.contains(MaterialState.pressed)) { - return unselectedColor?.withOpacity(0.12); + return unselectedColor?.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return unselectedColor?.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return unselectedColor?.withOpacity(0.12); + return unselectedColor?.withOpacity(0.1); } } return Colors.transparent; diff --git a/packages/flutter/lib/src/material/slider.dart b/packages/flutter/lib/src/material/slider.dart index c60042ec68013..0719926cf6f99 100644 --- a/packages/flutter/lib/src/material/slider.dart +++ b/packages/flutter/lib/src/material/slider.dart @@ -424,7 +424,7 @@ class Slider extends StatefulWidget { /// /// If null, [SliderThemeData.inactiveTrackColor] of the ambient [SliderTheme] /// is used. If that is null and [ThemeData.useMaterial3] is true, - /// [ColorScheme.surfaceVariant] will be used, otherwise [ColorScheme.primary] + /// [ColorScheme.surfaceContainerHighest] will be used, otherwise [ColorScheme.primary] /// with an opacity of 0.24 will be used. /// /// Using a [SliderTheme] gives much more fine-grained control over the @@ -468,7 +468,7 @@ class Slider extends StatefulWidget { /// /// If that is also null, If [ThemeData.useMaterial3] is true, /// Slider will use [ColorScheme.primary] with an opacity of 0.08 when - /// slider thumb is hovered and with an opacity of 0.12 when slider thumb + /// slider thumb is hovered and with an opacity of 0.1 when slider thumb /// is focused or dragged, If [ThemeData.useMaterial3] is false, defaults /// to [ColorScheme.primary] with an opacity of 0.12. final MaterialStateProperty? overlayColor; @@ -1974,7 +1974,7 @@ class _SliderDefaultsM3 extends SliderThemeData { Color? get activeTrackColor => _colors.primary; @override - Color? get inactiveTrackColor => _colors.surfaceVariant; + Color? get inactiveTrackColor => _colors.surfaceContainerHighest; @override Color? get secondaryActiveTrackColor => _colors.primary.withOpacity(0.54); @@ -2009,13 +2009,13 @@ class _SliderDefaultsM3 extends SliderThemeData { @override Color? get overlayColor => MaterialStateColor.resolveWith((Set states) { if (states.contains(MaterialState.dragged)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } return Colors.transparent; diff --git a/packages/flutter/lib/src/material/snack_bar.dart b/packages/flutter/lib/src/material/snack_bar.dart index dd9f6f876f6ec..78e1b2eb81ee8 100644 --- a/packages/flutter/lib/src/material/snack_bar.dart +++ b/packages/flutter/lib/src/material/snack_bar.dart @@ -586,7 +586,7 @@ class _SnackBarState extends State { primary: colorScheme.onPrimary, secondary: buttonColor, surface: colorScheme.onSurface, - background: defaults.backgroundColor!, + background: defaults.backgroundColor, error: colorScheme.onError, onPrimary: colorScheme.primary, onSecondary: colorScheme.secondary, diff --git a/packages/flutter/lib/src/material/switch.dart b/packages/flutter/lib/src/material/switch.dart index 4bab570855558..35a3dae5507e9 100644 --- a/packages/flutter/lib/src/material/switch.dart +++ b/packages/flutter/lib/src/material/switch.dart @@ -2069,7 +2069,7 @@ class _SwitchDefaultsM3 extends SwitchThemeData { if (states.contains(MaterialState.selected)) { return _colors.onSurface.withOpacity(0.12); } - return _colors.surfaceVariant.withOpacity(0.12); + return _colors.surfaceContainerHighest.withOpacity(0.12); } if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { @@ -2084,15 +2084,15 @@ class _SwitchDefaultsM3 extends SwitchThemeData { return _colors.primary; } if (states.contains(MaterialState.pressed)) { - return _colors.surfaceVariant; + return _colors.surfaceContainerHighest; } if (states.contains(MaterialState.hovered)) { - return _colors.surfaceVariant; + return _colors.surfaceContainerHighest; } if (states.contains(MaterialState.focused)) { - return _colors.surfaceVariant; + return _colors.surfaceContainerHighest; } - return _colors.surfaceVariant; + return _colors.surfaceContainerHighest; }); } @@ -2114,24 +2114,24 @@ class _SwitchDefaultsM3 extends SwitchThemeData { return MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } return null; } if (states.contains(MaterialState.pressed)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } return null; }); @@ -2169,7 +2169,7 @@ class _SwitchConfigM3 with _SwitchConfig { if (states.contains(MaterialState.selected)) { return _colors.onSurface.withOpacity(0.38); } - return _colors.surfaceVariant.withOpacity(0.38); + return _colors.surfaceContainerHighest.withOpacity(0.38); } if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { @@ -2184,15 +2184,15 @@ class _SwitchConfigM3 with _SwitchConfig { return _colors.onPrimaryContainer; } if (states.contains(MaterialState.pressed)) { - return _colors.surfaceVariant; + return _colors.surfaceContainerHighest; } if (states.contains(MaterialState.hovered)) { - return _colors.surfaceVariant; + return _colors.surfaceContainerHighest; } if (states.contains(MaterialState.focused)) { - return _colors.surfaceVariant; + return _colors.surfaceContainerHighest; } - return _colors.surfaceVariant; + return _colors.surfaceContainerHighest; }); } diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart index 22edc9d34c885..dd37970fe2de8 100644 --- a/packages/flutter/lib/src/material/tabs.dart +++ b/packages/flutter/lib/src/material/tabs.dart @@ -1020,9 +1020,9 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget { /// The color of the divider. /// - /// If null and [ThemeData.useMaterial3] is true, [TabBarTheme.dividerColor] + /// If null and [ThemeData.useMaterial3] is false, [TabBarTheme.dividerColor] /// color is used. If that is null and [ThemeData.useMaterial3] is true, - /// [ColorScheme.surfaceVariant] will be used, otherwise divider will not be drawn. + /// [ColorScheme.outlineVariant] will be used, otherwise divider will not be drawn. final Color? dividerColor; /// The height of the divider. @@ -1121,9 +1121,17 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget { /// [MaterialState.pressed] triggers a ripple (an ink splash), per /// the current Material Design spec. /// - /// If the overlay color is null or resolves to null, then the default values - /// for [InkResponse.focusColor], [InkResponse.hoverColor], [InkResponse.splashColor], - /// and [InkResponse.highlightColor] will be used instead. + /// If the overlay color is null or resolves to null, then if [ThemeData.useMaterial3] is + /// false, the default values for [InkResponse.focusColor], [InkResponse.hoverColor], [InkResponse.splashColor], + /// and [InkResponse.highlightColor] will be used instead. If [ThemeData.useMaterial3] + /// if true, the default values are: + /// * selected: + /// * pressed - ThemeData.colorScheme.primary(0.1) + /// * hovered - ThemeData.colorScheme.primary(0.08) + /// * focused - ThemeData.colorScheme.primary(0.1) + /// * pressed - ThemeData.colorScheme.primary(0.1) + /// * hovered - ThemeData.colorScheme.onSurface(0.08) + /// * focused - ThemeData.colorScheme.onSurface(0.1) final MaterialStateProperty? overlayColor; /// {@macro flutter.widgets.scrollable.dragStartBehavior} @@ -2359,9 +2367,11 @@ class _TabsPrimaryDefaultsM3 extends TabBarTheme { late final TextTheme _textTheme = Theme.of(context).textTheme; final bool isScrollable; + // This value comes from Divider widget defaults. Token db deprecated 'primary-navigation-tab.divider.color' token. @override - Color? get dividerColor => _colors.surfaceVariant; + Color? get dividerColor => _colors.outlineVariant; + // This value comes from Divider widget defaults. Token db deprecated 'primary-navigation-tab.divider.height' token. @override double? get dividerHeight => 1.0; @@ -2385,24 +2395,24 @@ class _TabsPrimaryDefaultsM3 extends TabBarTheme { return MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } return null; } if (states.contains(MaterialState.pressed)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } return null; }); @@ -2431,9 +2441,11 @@ class _TabsSecondaryDefaultsM3 extends TabBarTheme { late final TextTheme _textTheme = Theme.of(context).textTheme; final bool isScrollable; + // This value comes from Divider widget defaults. Token db deprecated 'secondary-navigation-tab.divider.color' token. @override - Color? get dividerColor => _colors.surfaceVariant; + Color? get dividerColor => _colors.outlineVariant; + // This value comes from Divider widget defaults. Token db deprecated 'secondary-navigation-tab.divider.height' token. @override double? get dividerHeight => 1.0; @@ -2457,24 +2469,24 @@ class _TabsSecondaryDefaultsM3 extends TabBarTheme { return MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } return null; } if (states.contains(MaterialState.pressed)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurface.withOpacity(0.12); + return _colors.onSurface.withOpacity(0.1); } return null; }); diff --git a/packages/flutter/lib/src/material/text_button.dart b/packages/flutter/lib/src/material/text_button.dart index 669217aeec2d6..078b44d5127cd 100644 --- a/packages/flutter/lib/src/material/text_button.dart +++ b/packages/flutter/lib/src/material/text_button.dart @@ -350,7 +350,7 @@ class TextButton extends ButtonStyleButton { /// * others - Theme.colorScheme.primary /// * `overlayColor` /// * hovered - Theme.colorScheme.primary(0.08) - /// * focused or pressed - Theme.colorScheme.primary(0.12) + /// * focused or pressed - Theme.colorScheme.primary(0.1) /// * others - null /// * `shadowColor` - Colors.transparent, /// * `surfaceTintColor` - null @@ -458,13 +458,13 @@ class _TextButtonDefaultOverlay extends MaterialStateProperty { @override Color? resolve(Set states) { if (states.contains(MaterialState.pressed)) { - return primary.withOpacity(0.12); + return primary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { - return primary.withOpacity(0.04); + return primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return primary.withOpacity(0.12); + return primary.withOpacity(0.1); } return null; } @@ -600,13 +600,13 @@ class _TextButtonDefaultsM3 extends ButtonStyle { MaterialStateProperty? get overlayColor => MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.pressed)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.12); + return _colors.primary.withOpacity(0.1); } return null; }); diff --git a/packages/flutter/lib/src/material/theme_data.dart b/packages/flutter/lib/src/material/theme_data.dart index e2f69ae00a853..73b0c2e08103f 100644 --- a/packages/flutter/lib/src/material/theme_data.dart +++ b/packages/flutter/lib/src/material/theme_data.dart @@ -2654,30 +2654,49 @@ const ColorScheme _colorSchemeLightM3 = ColorScheme( onPrimary: Color(0xFFFFFFFF), primaryContainer: Color(0xFFEADDFF), onPrimaryContainer: Color(0xFF21005D), + primaryFixed: Color(0xFFEADDFF), + primaryFixedDim: Color(0xFFD0BCFF), + onPrimaryFixed: Color(0xFF21005D), + onPrimaryFixedVariant: Color(0xFF4F378B), secondary: Color(0xFF625B71), onSecondary: Color(0xFFFFFFFF), secondaryContainer: Color(0xFFE8DEF8), onSecondaryContainer: Color(0xFF1D192B), + secondaryFixed: Color(0xFFE8DEF8), + secondaryFixedDim: Color(0xFFCCC2DC), + onSecondaryFixed: Color(0xFF1D192B), + onSecondaryFixedVariant: Color(0xFF4A4458), tertiary: Color(0xFF7D5260), onTertiary: Color(0xFFFFFFFF), tertiaryContainer: Color(0xFFFFD8E4), onTertiaryContainer: Color(0xFF31111D), + tertiaryFixed: Color(0xFFFFD8E4), + tertiaryFixedDim: Color(0xFFEFB8C8), + onTertiaryFixed: Color(0xFF31111D), + onTertiaryFixedVariant: Color(0xFF633B48), error: Color(0xFFB3261E), onError: Color(0xFFFFFFFF), errorContainer: Color(0xFFF9DEDC), onErrorContainer: Color(0xFF410E0B), - background: Color(0xFFFFFBFE), - onBackground: Color(0xFF1C1B1F), - surface: Color(0xFFFFFBFE), - onSurface: Color(0xFF1C1B1F), + background: Color(0xFFFEF7FF), + onBackground: Color(0xFF1D1B20), + surface: Color(0xFFFEF7FF), + surfaceBright: Color(0xFFFEF7FF), + surfaceContainerLowest: Color(0xFFFFFFFF), + surfaceContainerLow: Color(0xFFF7F2FA), + surfaceContainer: Color(0xFFF3EDF7), + surfaceContainerHigh: Color(0xFFECE6F0), + surfaceContainerHighest: Color(0xFFE6E0E9), + surfaceDim: Color(0xFFDED8E1), + onSurface: Color(0xFF1D1B20), surfaceVariant: Color(0xFFE7E0EC), onSurfaceVariant: Color(0xFF49454F), outline: Color(0xFF79747E), outlineVariant: Color(0xFFCAC4D0), shadow: Color(0xFF000000), scrim: Color(0xFF000000), - inverseSurface: Color(0xFF313033), - onInverseSurface: Color(0xFFF4EFF4), + inverseSurface: Color(0xFF322F35), + onInverseSurface: Color(0xFFF5EFF7), inversePrimary: Color(0xFFD0BCFF), // The surfaceTint color is set to the same color as the primary. surfaceTint: Color(0xFF6750A4), @@ -2689,30 +2708,49 @@ const ColorScheme _colorSchemeDarkM3 = ColorScheme( onPrimary: Color(0xFF381E72), primaryContainer: Color(0xFF4F378B), onPrimaryContainer: Color(0xFFEADDFF), + primaryFixed: Color(0xFFEADDFF), + primaryFixedDim: Color(0xFFD0BCFF), + onPrimaryFixed: Color(0xFF21005D), + onPrimaryFixedVariant: Color(0xFF4F378B), secondary: Color(0xFFCCC2DC), onSecondary: Color(0xFF332D41), secondaryContainer: Color(0xFF4A4458), onSecondaryContainer: Color(0xFFE8DEF8), + secondaryFixed: Color(0xFFE8DEF8), + secondaryFixedDim: Color(0xFFCCC2DC), + onSecondaryFixed: Color(0xFF1D192B), + onSecondaryFixedVariant: Color(0xFF4A4458), tertiary: Color(0xFFEFB8C8), onTertiary: Color(0xFF492532), tertiaryContainer: Color(0xFF633B48), onTertiaryContainer: Color(0xFFFFD8E4), + tertiaryFixed: Color(0xFFFFD8E4), + tertiaryFixedDim: Color(0xFFEFB8C8), + onTertiaryFixed: Color(0xFF31111D), + onTertiaryFixedVariant: Color(0xFF633B48), error: Color(0xFFF2B8B5), onError: Color(0xFF601410), errorContainer: Color(0xFF8C1D18), onErrorContainer: Color(0xFFF9DEDC), - background: Color(0xFF1C1B1F), - onBackground: Color(0xFFE6E1E5), - surface: Color(0xFF1C1B1F), - onSurface: Color(0xFFE6E1E5), + background: Color(0xFF141218), + onBackground: Color(0xFFE6E0E9), + surface: Color(0xFF141218), + surfaceBright: Color(0xFF3B383E), + surfaceContainerLowest: Color(0xFF0F0D13), + surfaceContainerLow: Color(0xFF1D1B20), + surfaceContainer: Color(0xFF211F26), + surfaceContainerHigh: Color(0xFF2B2930), + surfaceContainerHighest: Color(0xFF36343B), + surfaceDim: Color(0xFF141218), + onSurface: Color(0xFFE6E0E9), surfaceVariant: Color(0xFF49454F), onSurfaceVariant: Color(0xFFCAC4D0), outline: Color(0xFF938F99), outlineVariant: Color(0xFF49454F), shadow: Color(0xFF000000), scrim: Color(0xFF000000), - inverseSurface: Color(0xFFE6E1E5), - onInverseSurface: Color(0xFF313033), + inverseSurface: Color(0xFFE6E0E9), + onInverseSurface: Color(0xFF322F35), inversePrimary: Color(0xFF6750A4), // The surfaceTint color is set to the same color as the primary. surfaceTint: Color(0xFFD0BCFF), diff --git a/packages/flutter/lib/src/material/time_picker.dart b/packages/flutter/lib/src/material/time_picker.dart index 731417bb862a3..1fe8d502c43df 100644 --- a/packages/flutter/lib/src/material/time_picker.dart +++ b/packages/flutter/lib/src/material/time_picker.dart @@ -3357,7 +3357,7 @@ class _TimePickerDefaultsM3 extends _TimePickerDefaults { @override Color get backgroundColor { - return _colors.surface; + return _colors.surfaceContainerHigh; } @override @@ -3445,7 +3445,7 @@ class _TimePickerDefaultsM3 extends _TimePickerDefaults { @override Color get dialBackgroundColor { - return _colors.surfaceVariant; + return _colors.surfaceContainerHighest; } @override @@ -3522,22 +3522,22 @@ class _TimePickerDefaultsM3 extends _TimePickerDefaults { const double hoverOpacity = 0.08; overlayColor = _colors.onPrimaryContainer.withOpacity(hoverOpacity); } else if (states.contains(MaterialState.focused)) { - const double focusOpacity = 0.12; + const double focusOpacity = 0.1; overlayColor = _colors.onPrimaryContainer.withOpacity(focusOpacity); } return Color.alphaBlend(overlayColor, _colors.primaryContainer); } else { - Color overlayColor = _colors.surfaceVariant; + Color overlayColor = _colors.surfaceContainerHighest; if (states.contains(MaterialState.pressed)) { overlayColor = _colors.onSurface; } else if (states.contains(MaterialState.hovered)) { const double hoverOpacity = 0.08; overlayColor = _colors.onSurface.withOpacity(hoverOpacity); } else if (states.contains(MaterialState.focused)) { - const double focusOpacity = 0.12; + const double focusOpacity = 0.1; overlayColor = _colors.onSurface.withOpacity(focusOpacity); } - return Color.alphaBlend(overlayColor, _colors.surfaceVariant); + return Color.alphaBlend(overlayColor, _colors.surfaceContainerHighest); } }); } diff --git a/packages/flutter/lib/src/material/time_picker_theme.dart b/packages/flutter/lib/src/material/time_picker_theme.dart index 0c104134ec915..1ba598ada4f2f 100644 --- a/packages/flutter/lib/src/material/time_picker_theme.dart +++ b/packages/flutter/lib/src/material/time_picker_theme.dart @@ -69,7 +69,7 @@ class TimePickerThemeData with Diagnosticable { /// The background color of a time picker. /// /// If this is null, the time picker defaults to the overall theme's - /// [ColorScheme.background]. + /// [ColorScheme.surfaceContainerHigh]. final Color? backgroundColor; /// The style of the cancel button of a [TimePickerDialog]. @@ -85,7 +85,7 @@ class TimePickerThemeData with Diagnosticable { /// ```dart /// BorderSide( /// color: Color.alphaBlend( - /// Theme.of(context).colorScheme.onBackground.withOpacity(0.38), + /// Theme.of(context).colorScheme.onSurface.withOpacity(0.38), /// Theme.of(context).colorScheme.surface, /// ), /// ), @@ -154,7 +154,7 @@ class TimePickerThemeData with Diagnosticable { /// [TimePickerEntryMode.dial] or [TimePickerEntryMode.dialOnly]. /// /// If this is null and [ThemeData.useMaterial3] is true, the time picker - /// dial background color defaults [ColorScheme.surfaceVariant] color. + /// dial background color defaults [ColorScheme.surfaceContainerHighest] color. /// /// If this is null and [ThemeData.useMaterial3] is false, the time picker /// dial background color defaults to [ColorScheme.onSurface] color with diff --git a/packages/flutter/lib/src/widgets/routes.dart b/packages/flutter/lib/src/widgets/routes.dart index 2e5aee9acbd12..c4194e4e8b597 100644 --- a/packages/flutter/lib/src/widgets/routes.dart +++ b/packages/flutter/lib/src/widgets/routes.dart @@ -1368,7 +1368,7 @@ abstract class ModalRoute extends TransitionRoute with LocalHistoryRoute Theme.of(navigator.context).colorScheme.background; + /// Color get barrierColor => Theme.of(navigator.context).colorScheme.surface; /// ``` /// /// {@end-tool} diff --git a/packages/flutter/test/material/action_chip_test.dart b/packages/flutter/test/material/action_chip_test.dart index 9006b86bcb844..a350df4b55a27 100644 --- a/packages/flutter/test/material/action_chip_test.dart +++ b/packages/flutter/test/material/action_chip_test.dart @@ -161,7 +161,7 @@ void main() { Material chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, Colors.transparent); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, RoundedRectangleBorder( @@ -189,7 +189,7 @@ void main() { chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, Colors.transparent); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, RoundedRectangleBorder( @@ -235,7 +235,7 @@ void main() { Material chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 1); expect(chipMaterial.shadowColor, theme.colorScheme.shadow); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, const RoundedRectangleBorder( @@ -245,7 +245,7 @@ void main() { ); ShapeDecoration decoration = tester.widget(find.byType(Ink)).decoration! as ShapeDecoration; - expect(decoration.color, null); + expect(decoration.color, theme.colorScheme.surfaceContainerLow); // Test disabled ActionChip.elevated defaults. await tester.pumpWidget( @@ -263,7 +263,7 @@ void main() { chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, theme.colorScheme.shadow); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, const RoundedRectangleBorder( diff --git a/packages/flutter/test/material/app_test.dart b/packages/flutter/test/material/app_test.dart index d72d990fbd4ce..6ac9981cf1fa9 100644 --- a/packages/flutter/test/material/app_test.dart +++ b/packages/flutter/test/material/app_test.dart @@ -1587,7 +1587,7 @@ void main() { // Test the initial Scaffold background color. await tester.pumpWidget(buildWidget()); - expect(tester.widget(find.byType(Material)).color, const Color(0xfffffbfe)); + expect(tester.widget(find.byType(Material)).color, lightTheme.colorScheme.surface); // Test the Scaffold background color animation from light to dark theme. await tester.pumpWidget(buildWidget(themeMode: ThemeMode.dark)); @@ -1595,13 +1595,13 @@ void main() { await tester.pump(const Duration(milliseconds: 50)); // Advance animation by 50 milliseconds. // Scaffold background color is slightly updated. - expect(tester.widget(find.byType(Material)).color, const Color(0xffc6c3c6)); + expect(tester.widget(find.byType(Material)).color, const Color(0xffc3bdc5)); // Let the animation finish. await tester.pumpAndSettle(); // Scaffold background color is fully updated to dark theme. - expect(tester.widget(find.byType(Material)).color, const Color(0xff1c1b1f)); + expect(tester.widget(find.byType(Material)).color, darkTheme.colorScheme.surface); // Reset to light theme to compare the Scaffold background color animation // with the default animation curve. @@ -1618,21 +1618,21 @@ void main() { // Scaffold background color is slightly updated but with a different // color than the default animation curve. - expect(tester.widget(find.byType(Material)).color, const Color(0xffe9e5e9)); + expect(tester.widget(find.byType(Material)).color, const Color(0xffe7e1e9)); // Let the animation finish. await tester.pumpAndSettle(); // Scaffold background color is fully updated to dark theme. - expect(tester.widget(find.byType(Material)).color, const Color(0xff1c1b1f)); + expect(tester.widget(find.byType(Material)).color, darkTheme.colorScheme.surface); // Switch from dark to light theme with overridden animation duration. await tester.pumpWidget(buildWidget(animationStyle: AnimationStyle.noAnimation)); await tester.pump(); await tester.pump(const Duration(milliseconds: 1)); - expect(tester.widget(find.byType(Material)).color, isNot(const Color(0xff1c1b1f))); - expect(tester.widget(find.byType(Material)).color, const Color(0xfffffbfe)); + expect(tester.widget(find.byType(Material)).color, isNot(darkTheme.colorScheme.surface)); + expect(tester.widget(find.byType(Material)).color, lightTheme.colorScheme.surface); }); testWidgets('AnimationStyle.noAnimation removes AnimatedTheme from the tree', (WidgetTester tester) async { diff --git a/packages/flutter/test/material/banner_theme_test.dart b/packages/flutter/test/material/banner_theme_test.dart index ca4c9022d5940..8a6d2e58f427b 100644 --- a/packages/flutter/test/material/banner_theme_test.dart +++ b/packages/flutter/test/material/banner_theme_test.dart @@ -92,8 +92,8 @@ void main() { )); final Material material = _getMaterialFromText(tester, contentText); - expect(material.color, theme.colorScheme.surface); - expect(material.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(material.color, theme.colorScheme.surfaceContainerLow); + expect(material.surfaceTintColor, Colors.transparent); expect(material.shadowColor, null); expect(material.elevation, 0.0); @@ -155,8 +155,8 @@ void main() { await tester.pumpAndSettle(); final Material material = _getMaterialFromText(tester, contentText); - expect(material.color, theme.colorScheme.surface); - expect(material.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(material.color, theme.colorScheme.surfaceContainerLow); + expect(material.surfaceTintColor, Colors.transparent); expect(material.shadowColor, null); expect(material.elevation, 0.0); @@ -406,7 +406,7 @@ void main() { )); final Material material = _getMaterialFromText(tester, contentText); - expect(material.color, colorScheme.surface); + expect(material.color, colorScheme.surfaceContainerLow); }); testWidgets('MaterialBanner uses color scheme when necessary when presented by ScaffoldMessenger', (WidgetTester tester) async { @@ -445,7 +445,7 @@ void main() { await tester.pumpAndSettle(); final Material material = _getMaterialFromText(tester, contentText); - expect(material.color, colorScheme.surface); + expect(material.color, colorScheme.surfaceContainerLow); }); group('Material 2', () { diff --git a/packages/flutter/test/material/bottom_app_bar_test.dart b/packages/flutter/test/material/bottom_app_bar_test.dart index 9d1916dcf037f..3eeff6825b63c 100644 --- a/packages/flutter/test/material/bottom_app_bar_test.dart +++ b/packages/flutter/test/material/bottom_app_bar_test.dart @@ -358,7 +358,7 @@ void main() { theme: ThemeData.from(useMaterial3: true, colorScheme: colorScheme), home: Scaffold( bottomNavigationBar: BottomAppBar( - color: colorScheme.surface, + color: colorScheme.surfaceContainer, ), ), ), @@ -367,8 +367,9 @@ void main() { final PhysicalShape physicalShape = tester.widget(find.byType(PhysicalShape).at(0)); const double elevation = 3.0; // Default for M3. - final Color overlayColor = ElevationOverlay.applySurfaceTint(colorScheme.surface, colorScheme.surfaceTint, elevation); - expect(physicalShape.color, overlayColor); + final Color overlayColor = ElevationOverlay.applySurfaceTint(colorScheme.surfaceContainer, colorScheme.surfaceTint, elevation); + expect(physicalShape.color, isNot(overlayColor)); + expect(physicalShape.color, colorScheme.surfaceContainer); }); // This is a regression test for a bug we had where toggling the notch on/off diff --git a/packages/flutter/test/material/bottom_app_bar_theme_test.dart b/packages/flutter/test/material/bottom_app_bar_theme_test.dart index 371ca9e13f774..ca0f8651f04a5 100644 --- a/packages/flutter/test/material/bottom_app_bar_theme_test.dart +++ b/packages/flutter/test/material/bottom_app_bar_theme_test.dart @@ -175,7 +175,7 @@ void main() { final PhysicalShape widget = _getBabRenderObject(tester); - expect(widget.color, theme.colorScheme.surface); + expect(widget.color, theme.colorScheme.surfaceContainer); expect(widget.elevation, equals(3.0)); }); diff --git a/packages/flutter/test/material/bottom_sheet_test.dart b/packages/flutter/test/material/bottom_sheet_test.dart index 8d1358dcc96c3..5ac634e914b8e 100644 --- a/packages/flutter/test/material/bottom_sheet_test.dart +++ b/packages/flutter/test/material/bottom_sheet_test.dart @@ -944,7 +944,8 @@ void main() { final Material material = tester.widget(finder); expect(material.color, surfaceColor); - expect(material.surfaceTintColor, surfaceTintColor); + // Surface tint is no longer used by default. + expect(material.surfaceTintColor, Colors.transparent); expect(material.elevation, 1.0); expect(material.shape, defaultShape); expect(tester.getSize(finder).width, 640); diff --git a/packages/flutter/test/material/bottom_sheet_theme_test.dart b/packages/flutter/test/material/bottom_sheet_theme_test.dart index bf51ff15bf4b6..a1a483a4156e6 100644 --- a/packages/flutter/test/material/bottom_sheet_theme_test.dart +++ b/packages/flutter/test/material/bottom_sheet_theme_test.dart @@ -99,7 +99,7 @@ void main() { ); final ThemeData theme = Theme.of(tester.element(find.byType(Scaffold))); - expect(material.color, theme.colorScheme.surface); + expect(material.color, theme.colorScheme.surfaceContainerLow); expect(material.elevation, 1.0); expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.vertical(top: Radius.circular(28.0)))); expect(material.clipBehavior, Clip.none); @@ -273,7 +273,7 @@ void main() { ); expect(material.elevation, 1.0); final ThemeData theme = Theme.of(tester.element(find.byType(Scaffold))); - expect(material.color, theme.colorScheme.surface); + expect(material.color, theme.colorScheme.surfaceContainerLow); }); testWidgets("Material2 - Modal bottom sheet-specific parameters don't apply to persistent bottom sheets", (WidgetTester tester) async { diff --git a/packages/flutter/test/material/card_test.dart b/packages/flutter/test/material/card_test.dart index 64a9e456dc8e2..a0ab6df82c215 100644 --- a/packages/flutter/test/material/card_test.dart +++ b/packages/flutter/test/material/card_test.dart @@ -24,9 +24,9 @@ void main() { expect(material.clipBehavior, Clip.none); expect(material.elevation, 1.0); expect(container.margin, const EdgeInsets.all(4.0)); - expect(material.color, colors.surface); + expect(material.color, colors.surfaceContainerLow); expect(material.shadowColor, colors.shadow); - expect(material.surfaceTintColor, colors.surfaceTint); // Default primary color + expect(material.surfaceTintColor, Colors.transparent); // Don't use surface tint. Toned surface container is used instead. expect(material.shape, const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(12.0)), )); @@ -48,7 +48,7 @@ void main() { expect(material.clipBehavior, Clip.none); expect(material.elevation, 0.0); expect(container.margin, const EdgeInsets.all(4.0)); - expect(material.color, colors.surfaceVariant); + expect(material.color, colors.surfaceContainerHighest); expect(material.shadowColor, colors.shadow); expect(material.surfaceTintColor, Colors.transparent); expect(material.shape, const RoundedRectangleBorder( @@ -74,7 +74,7 @@ void main() { expect(container.margin, const EdgeInsets.all(4.0)); expect(material.color, colors.surface); expect(material.shadowColor, colors.shadow); - expect(material.surfaceTintColor, colors.surfaceTint); + expect(material.surfaceTintColor, Colors.transparent); expect(material.shape, RoundedRectangleBorder( side: BorderSide(color: colors.outlineVariant), borderRadius: const BorderRadius.all(Radius.circular(12.0)), diff --git a/packages/flutter/test/material/card_theme_test.dart b/packages/flutter/test/material/card_theme_test.dart index 2e22d13132a01..2cb4748f0ec37 100644 --- a/packages/flutter/test/material/card_theme_test.dart +++ b/packages/flutter/test/material/card_theme_test.dart @@ -35,9 +35,9 @@ void main() { final Material material = _getCardMaterial(tester); expect(material.clipBehavior, Clip.none); - expect(material.color, theme.colorScheme.surface); + expect(material.color, theme.colorScheme.surfaceContainerLow); expect(material.shadowColor, theme.colorScheme.shadow); - expect(material.surfaceTintColor, theme.colorScheme.surfaceTint); // Default primary color + expect(material.surfaceTintColor, Colors.transparent); // Default primary color expect(material.elevation, 1.0); expect(container.margin, const EdgeInsets.all(4.0)); expect(material.shape, const RoundedRectangleBorder( @@ -128,7 +128,7 @@ void main() { )); final Material material = _getCardMaterial(tester); - expect(material.color, themeData.colorScheme.surface); + expect(material.color, themeData.colorScheme.surfaceContainerLow); }); testWidgets('Material3 - CardTheme customizes shape', (WidgetTester tester) async { diff --git a/packages/flutter/test/material/checkbox_test.dart b/packages/flutter/test/material/checkbox_test.dart index 74f89a0a675e4..dafa56c2da0b9 100644 --- a/packages/flutter/test/material/checkbox_test.dart +++ b/packages/flutter/test/material/checkbox_test.dart @@ -1446,7 +1446,7 @@ void main() { expect( Material.of(tester.element(find.byType(Checkbox))), - paints..circle(color: colors.primary.withOpacity(0.12)), + paints..circle(color: colors.primary.withOpacity(0.1)), reason: 'Default inactive pressed Checkbox should have overlay color from default fillColor', ); @@ -1456,7 +1456,7 @@ void main() { expect( Material.of(tester.element(find.byType(Checkbox))), - paints..circle(color: colors.onSurface.withOpacity(0.12)), + paints..circle(color: colors.onSurface.withOpacity(0.1)), reason: 'Default active pressed Checkbox should have overlay color from default fillColor', ); @@ -1467,7 +1467,7 @@ void main() { expect(focusNode.hasPrimaryFocus, isTrue); expect( Material.of(tester.element(find.byType(Checkbox))), - paints..circle(color: colors.onSurface.withOpacity(0.12)), + paints..circle(color: colors.onSurface.withOpacity(0.1)), reason: 'Focused Checkbox should use default focused overlay color', ); @@ -2025,7 +2025,7 @@ void main() { expect(focusNode.hasPrimaryFocus, isTrue); expect( Material.of(tester.element(find.byType(Checkbox))), - paints..circle(color: themeData.colorScheme.error.withOpacity(0.12))..path(color: themeData.colorScheme.error)..path(color: themeData.colorScheme.onError) + paints..circle(color: themeData.colorScheme.error.withOpacity(0.1))..path(color: themeData.colorScheme.error)..path(color: themeData.colorScheme.onError) ); // Default color @@ -2057,7 +2057,7 @@ void main() { expect( Material.of(tester.element(find.byType(Checkbox))), paints - ..circle(color: themeData.colorScheme.error.withOpacity(0.12)) + ..circle(color: themeData.colorScheme.error.withOpacity(0.1)) ..path(color: themeData.colorScheme.error) ); await gestureLongPress.up(); diff --git a/packages/flutter/test/material/choice_chip_test.dart b/packages/flutter/test/material/choice_chip_test.dart index 04a613dbe9598..441fac3bc6332 100644 --- a/packages/flutter/test/material/choice_chip_test.dart +++ b/packages/flutter/test/material/choice_chip_test.dart @@ -210,7 +210,7 @@ void main() { Material chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, Colors.transparent); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, RoundedRectangleBorder( @@ -239,7 +239,7 @@ void main() { chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, Colors.transparent); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, RoundedRectangleBorder( @@ -269,7 +269,7 @@ void main() { chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, null); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, const RoundedRectangleBorder( @@ -298,7 +298,7 @@ void main() { chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, null); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, const RoundedRectangleBorder( @@ -345,7 +345,7 @@ void main() { Material chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 1); expect(chipMaterial.shadowColor, theme.colorScheme.shadow); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, const RoundedRectangleBorder( @@ -355,7 +355,7 @@ void main() { ); ShapeDecoration decoration = tester.widget(find.byType(Ink)).decoration! as ShapeDecoration; - expect(decoration.color, null); + expect(decoration.color, theme.colorScheme.surfaceContainerLow); // Test disabled ChoiceChip.elevated defaults. await tester.pumpWidget( @@ -374,7 +374,7 @@ void main() { chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, theme.colorScheme.shadow); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, const RoundedRectangleBorder( @@ -404,7 +404,7 @@ void main() { chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 1); expect(chipMaterial.shadowColor, null); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, const RoundedRectangleBorder( @@ -433,7 +433,7 @@ void main() { chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, theme.colorScheme.shadow); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, const RoundedRectangleBorder( diff --git a/packages/flutter/test/material/color_scheme_test.dart b/packages/flutter/test/material/color_scheme_test.dart index c597a37783a37..17eba66e0e756 100644 --- a/packages/flutter/test/material/color_scheme_test.dart +++ b/packages/flutter/test/material/color_scheme_test.dart @@ -249,36 +249,55 @@ void main() { test('can generate a light scheme from a seed color', () { final ColorScheme scheme = ColorScheme.fromSeed(seedColor: Colors.blue); - expect(scheme.primary, const Color(0xff0061a4)); + expect(scheme.primary, const Color(0xff36618e)); expect(scheme.onPrimary, const Color(0xffffffff)); expect(scheme.primaryContainer, const Color(0xffd1e4ff)); expect(scheme.onPrimaryContainer, const Color(0xff001d36)); + expect(scheme.primaryFixed, const Color(0xffd1e4ff)); + expect(scheme.primaryFixedDim, const Color(0xffa0cafd)); + expect(scheme.onPrimaryFixed, const Color(0xff001d36)); + expect(scheme.onPrimaryFixedVariant, const Color(0xff194975)); expect(scheme.secondary, const Color(0xff535f70)); expect(scheme.onSecondary, const Color(0xffffffff)); expect(scheme.secondaryContainer, const Color(0xffd7e3f7)); expect(scheme.onSecondaryContainer, const Color(0xff101c2b)); + expect(scheme.secondaryFixed, const Color(0xffd7e3f7)); + expect(scheme.secondaryFixedDim, const Color(0xffbbc7db)); + expect(scheme.onSecondaryFixed, const Color(0xff101c2b)); + expect(scheme.onSecondaryFixedVariant, const Color(0xff3b4858)); expect(scheme.tertiary, const Color(0xff6b5778)); expect(scheme.onTertiary, const Color(0xffffffff)); expect(scheme.tertiaryContainer, const Color(0xfff2daff)); expect(scheme.onTertiaryContainer, const Color(0xff251431)); + expect(scheme.tertiaryFixed, const Color(0xfff2daff)); + expect(scheme.tertiaryFixedDim, const Color(0xffd6bee4)); + expect(scheme.onTertiaryFixed, const Color(0xff251431)); + expect(scheme.onTertiaryFixedVariant, const Color(0xff523f5f)); expect(scheme.error, const Color(0xffba1a1a)); expect(scheme.onError, const Color(0xffffffff)); expect(scheme.errorContainer, const Color(0xffffdad6)); expect(scheme.onErrorContainer, const Color(0xff410002)); expect(scheme.outline, const Color(0xff73777f)); expect(scheme.outlineVariant, const Color(0xffc3c7cf)); - expect(scheme.background, const Color(0xfffdfcff)); - expect(scheme.onBackground, const Color(0xff1a1c1e)); - expect(scheme.surface, const Color(0xfffdfcff)); - expect(scheme.onSurface, const Color(0xff1a1c1e)); + expect(scheme.background, const Color(0xfff8f9ff)); + expect(scheme.onBackground, const Color(0xff191c20)); + expect(scheme.surface, const Color(0xfff8f9ff)); + expect(scheme.surfaceBright, const Color(0xfff8f9ff)); + expect(scheme.surfaceDim, const Color(0xffd8dae0)); + expect(scheme.surfaceContainerLowest, const Color(0xffffffff)); + expect(scheme.surfaceContainerLow, const Color(0xfff2f3fa)); + expect(scheme.surfaceContainer, const Color(0xffeceef4)); + expect(scheme.surfaceContainerHigh, const Color(0xffe6e8ee)); + expect(scheme.surfaceContainerHighest, const Color(0xffe1e2e8)); + expect(scheme.onSurface, const Color(0xff191c20)); expect(scheme.surfaceVariant, const Color(0xffdfe2eb)); expect(scheme.onSurfaceVariant, const Color(0xff43474e)); - expect(scheme.inverseSurface, const Color(0xff2f3033)); - expect(scheme.onInverseSurface, const Color(0xfff1f0f4)); - expect(scheme.inversePrimary, const Color(0xff9ecaff)); + expect(scheme.inverseSurface, const Color(0xff2e3135)); + expect(scheme.onInverseSurface, const Color(0xffeff0f7)); + expect(scheme.inversePrimary, const Color(0xffa0cafd)); expect(scheme.shadow, const Color(0xff000000)); expect(scheme.scrim, const Color(0xff000000)); - expect(scheme.surfaceTint, const Color(0xff0061a4)); + expect(scheme.surfaceTint, const Color(0xff36618e)); expect(scheme.brightness, Brightness.light); }); @@ -289,14 +308,26 @@ void main() { onPrimary: const Color(0x00000002), primaryContainer: const Color(0x00000003), onPrimaryContainer: const Color(0x00000004), + primaryFixed: const Color(0x0000001D), + primaryFixedDim: const Color(0x0000001E), + onPrimaryFixed: const Color(0x0000001F), + onPrimaryFixedVariant: const Color(0x00000020), secondary: const Color(0x00000005), onSecondary: const Color(0x00000006), secondaryContainer: const Color(0x00000007), onSecondaryContainer: const Color(0x00000008), + secondaryFixed: const Color(0x00000021), + secondaryFixedDim: const Color(0x00000022), + onSecondaryFixed: const Color(0x00000023), + onSecondaryFixedVariant: const Color(0x00000024), tertiary: const Color(0x00000009), onTertiary: const Color(0x0000000A), tertiaryContainer: const Color(0x0000000B), onTertiaryContainer: const Color(0x0000000C), + tertiaryFixed: const Color(0x00000025), + tertiaryFixedDim: const Color(0x00000026), + onTertiaryFixed: const Color(0x00000027), + onTertiaryFixedVariant: const Color(0x00000028), error: const Color(0x0000000D), onError: const Color(0x0000000E), errorContainer: const Color(0x0000000F), @@ -304,6 +335,13 @@ void main() { background: const Color(0x00000011), onBackground: const Color(0x00000012), surface: const Color(0x00000013), + surfaceDim: const Color(0x00000029), + surfaceBright: const Color(0x0000002A), + surfaceContainerLowest: const Color(0x0000002B), + surfaceContainerLow: const Color(0x0000002C), + surfaceContainer: const Color(0x0000002D), + surfaceContainerHigh: const Color(0x0000002E), + surfaceContainerHighest: const Color(0x0000002F), onSurface: const Color(0x00000014), surfaceVariant: const Color(0x00000015), onSurfaceVariant: const Color(0x00000016), @@ -322,14 +360,26 @@ void main() { expect(scheme.onPrimary, const Color(0x00000002)); expect(scheme.primaryContainer, const Color(0x00000003)); expect(scheme.onPrimaryContainer, const Color(0x00000004)); + expect(scheme.primaryFixed, const Color(0x0000001D)); + expect(scheme.primaryFixedDim, const Color(0x0000001E)); + expect(scheme.onPrimaryFixed, const Color(0x0000001F)); + expect(scheme.onPrimaryFixedVariant, const Color(0x00000020)); expect(scheme.secondary, const Color(0x00000005)); expect(scheme.onSecondary, const Color(0x00000006)); expect(scheme.secondaryContainer, const Color(0x00000007)); expect(scheme.onSecondaryContainer, const Color(0x00000008)); + expect(scheme.secondaryFixed, const Color(0x00000021)); + expect(scheme.secondaryFixedDim, const Color(0x00000022)); + expect(scheme.onSecondaryFixed, const Color(0x00000023)); + expect(scheme.onSecondaryFixedVariant, const Color(0x00000024)); expect(scheme.tertiary, const Color(0x00000009)); expect(scheme.onTertiary, const Color(0x0000000A)); expect(scheme.tertiaryContainer, const Color(0x0000000B)); expect(scheme.onTertiaryContainer, const Color(0x0000000C)); + expect(scheme.tertiaryFixed, const Color(0x00000025)); + expect(scheme.tertiaryFixedDim, const Color(0x00000026)); + expect(scheme.onTertiaryFixed, const Color(0x00000027)); + expect(scheme.onTertiaryFixedVariant, const Color(0x00000028)); expect(scheme.error, const Color(0x0000000D)); expect(scheme.onError, const Color(0x0000000E)); expect(scheme.errorContainer, const Color(0x0000000F)); @@ -337,6 +387,13 @@ void main() { expect(scheme.background, const Color(0x00000011)); expect(scheme.onBackground, const Color(0x00000012)); expect(scheme.surface, const Color(0x00000013)); + expect(scheme.surfaceDim, const Color(0x00000029)); + expect(scheme.surfaceBright, const Color(0x0000002A)); + expect(scheme.surfaceContainerLowest, const Color(0x0000002B)); + expect(scheme.surfaceContainerLow, const Color(0x0000002C)); + expect(scheme.surfaceContainer, const Color(0x0000002D)); + expect(scheme.surfaceContainerHigh, const Color(0x0000002E)); + expect(scheme.surfaceContainerHighest, const Color(0x0000002F)); expect(scheme.onSurface, const Color(0x00000014)); expect(scheme.surfaceVariant, const Color(0x00000015)); expect(scheme.onSurfaceVariant, const Color(0x00000016)); @@ -352,36 +409,55 @@ void main() { test('can generate a dark scheme from a seed color', () { final ColorScheme scheme = ColorScheme.fromSeed(seedColor: Colors.blue, brightness: Brightness.dark); - expect(scheme.primary, const Color(0xff9ecaff)); + expect(scheme.primary, const Color(0xffa0cafd)); expect(scheme.onPrimary, const Color(0xff003258)); - expect(scheme.primaryContainer, const Color(0xff00497d)); + expect(scheme.primaryContainer, const Color(0xff194975)); expect(scheme.onPrimaryContainer, const Color(0xffd1e4ff)); + expect(scheme.primaryFixed, const Color(0xffd1e4ff)); + expect(scheme.primaryFixedDim, const Color(0xffa0cafd)); + expect(scheme.onPrimaryFixed, const Color(0xff001d36)); + expect(scheme.onPrimaryFixedVariant, const Color(0xff194975)); expect(scheme.secondary, const Color(0xffbbc7db)); expect(scheme.onSecondary, const Color(0xff253140)); expect(scheme.secondaryContainer, const Color(0xff3b4858)); expect(scheme.onSecondaryContainer, const Color(0xffd7e3f7)); + expect(scheme.secondaryFixed, const Color(0xffd7e3f7)); + expect(scheme.secondaryFixedDim, const Color(0xffbbc7db)); + expect(scheme.onSecondaryFixed, const Color(0xff101c2b)); + expect(scheme.onSecondaryFixedVariant, const Color(0xff3b4858)); expect(scheme.tertiary, const Color(0xffd6bee4)); expect(scheme.onTertiary, const Color(0xff3b2948)); expect(scheme.tertiaryContainer, const Color(0xff523f5f)); expect(scheme.onTertiaryContainer, const Color(0xfff2daff)); + expect(scheme.tertiaryFixed, const Color(0xfff2daff)); + expect(scheme.tertiaryFixedDim, const Color(0xffd6bee4)); + expect(scheme.onTertiaryFixed, const Color(0xff251431)); + expect(scheme.onTertiaryFixedVariant, const Color(0xff523f5f)); expect(scheme.error, const Color(0xffffb4ab)); expect(scheme.onError, const Color(0xff690005)); expect(scheme.errorContainer, const Color(0xff93000a)); - expect(scheme.onErrorContainer, const Color(0xffffb4ab)); + expect(scheme.onErrorContainer, const Color(0xffffdad6)); expect(scheme.outline, const Color(0xff8d9199)); expect(scheme.outlineVariant, const Color(0xff43474e)); - expect(scheme.background, const Color(0xff1a1c1e)); - expect(scheme.onBackground, const Color(0xffe2e2e6)); - expect(scheme.surface, const Color(0xff1a1c1e)); - expect(scheme.onSurface, const Color(0xffe2e2e6)); + expect(scheme.background, const Color(0xff111418)); + expect(scheme.onBackground, const Color(0xffe1e2e8)); + expect(scheme.surface, const Color(0xff111418)); + expect(scheme.surfaceDim, const Color(0xff111418)); + expect(scheme.surfaceBright, const Color(0xff36393e)); + expect(scheme.surfaceContainerLowest, const Color(0xff0b0e13)); + expect(scheme.surfaceContainerLow, const Color(0xff191c20)); + expect(scheme.surfaceContainer, const Color(0xff1d2024)); + expect(scheme.surfaceContainerHigh, const Color(0xff272a2f)); + expect(scheme.surfaceContainerHighest, const Color(0xff32353a)); + expect(scheme.onSurface, const Color(0xffe1e2e8)); expect(scheme.surfaceVariant, const Color(0xff43474e)); expect(scheme.onSurfaceVariant, const Color(0xffc3c7cf)); - expect(scheme.inverseSurface, const Color(0xffe2e2e6)); - expect(scheme.onInverseSurface, const Color(0xff2f3033)); - expect(scheme.inversePrimary, const Color(0xff0061a4)); + expect(scheme.inverseSurface, const Color(0xffe1e2e8)); + expect(scheme.onInverseSurface, const Color(0xff2e3135)); + expect(scheme.inversePrimary, const Color(0xff36618e)); expect(scheme.shadow, const Color(0xff000000)); expect(scheme.scrim, const Color(0xff000000)); - expect(scheme.surfaceTint, const Color(0xff9ecaff)); + expect(scheme.surfaceTint, const Color(0xffa0cafd)); expect(scheme.brightness, Brightness.dark); }); @@ -397,14 +473,26 @@ void main() { expect(scheme.onPrimary, baseScheme.onPrimary); expect(scheme.primaryContainer, baseScheme.primaryContainer); expect(scheme.onPrimaryContainer, baseScheme.onPrimaryContainer); + expect(scheme.primaryFixed, baseScheme.primaryFixed); + expect(scheme.primaryFixedDim, baseScheme.primaryFixedDim); + expect(scheme.onPrimaryFixed, baseScheme.onPrimaryFixed); + expect(scheme.onPrimaryFixedVariant, baseScheme.onPrimaryFixedVariant); expect(scheme.secondary, baseScheme.secondary); expect(scheme.onSecondary, baseScheme.onSecondary); expect(scheme.secondaryContainer, baseScheme.secondaryContainer); expect(scheme.onSecondaryContainer, baseScheme.onSecondaryContainer); + expect(scheme.secondaryFixed, baseScheme.secondaryFixed); + expect(scheme.secondaryFixedDim, baseScheme.secondaryFixedDim); + expect(scheme.onSecondaryFixed, baseScheme.onSecondaryFixed); + expect(scheme.onSecondaryFixedVariant, baseScheme.onSecondaryFixedVariant); expect(scheme.tertiary, baseScheme.tertiary); expect(scheme.onTertiary, baseScheme.onTertiary); expect(scheme.tertiaryContainer, baseScheme.tertiaryContainer); expect(scheme.onTertiaryContainer, baseScheme.onTertiaryContainer); + expect(scheme.tertiaryFixed, baseScheme.tertiaryFixed); + expect(scheme.tertiaryFixedDim, baseScheme.tertiaryFixedDim); + expect(scheme.onTertiaryFixed, baseScheme.onTertiaryFixed); + expect(scheme.onTertiaryFixedVariant, baseScheme.onTertiaryFixedVariant); expect(scheme.error, baseScheme.error); expect(scheme.onError, baseScheme.onError); expect(scheme.errorContainer, baseScheme.errorContainer); @@ -414,6 +502,13 @@ void main() { expect(scheme.background, baseScheme.background); expect(scheme.onBackground, baseScheme.onBackground); expect(scheme.surface, baseScheme.surface); + expect(scheme.surfaceBright, baseScheme.surfaceBright); + expect(scheme.surfaceDim, baseScheme.surfaceDim); + expect(scheme.surfaceContainerLowest, baseScheme.surfaceContainerLowest); + expect(scheme.surfaceContainerLow, baseScheme.surfaceContainerLow); + expect(scheme.surfaceContainer, baseScheme.surfaceContainer); + expect(scheme.surfaceContainerHigh, baseScheme.surfaceContainerHigh); + expect(scheme.surfaceContainerHighest, baseScheme.surfaceContainerHighest); expect(scheme.onSurface, baseScheme.onSurface); expect(scheme.surfaceVariant, baseScheme.surfaceVariant); expect(scheme.onSurfaceVariant, baseScheme.onSurfaceVariant); @@ -434,36 +529,55 @@ void main() { await ColorScheme.fromImageProvider(provider: image); expect(scheme.brightness, Brightness.light); - expect(scheme.primary, const Color(0xff4040f3)); + expect(scheme.primary, const Color(0xff575992)); expect(scheme.onPrimary, const Color(0xffffffff)); expect(scheme.primaryContainer, const Color(0xffe1e0ff)); - expect(scheme.onPrimaryContainer, const Color(0xff06006c)); + expect(scheme.onPrimaryContainer, const Color(0xff13144b)); + expect(scheme.primaryFixed, const Color(0xffe1e0ff)); + expect(scheme.primaryFixedDim, const Color(0xffc0c1ff)); + expect(scheme.onPrimaryFixed, const Color(0xff13144b)); + expect(scheme.onPrimaryFixedVariant, const Color(0xff3f4178)); expect(scheme.secondary, const Color(0xff5d5c72)); expect(scheme.onSecondary, const Color(0xffffffff)); expect(scheme.secondaryContainer, const Color(0xffe2e0f9)); expect(scheme.onSecondaryContainer, const Color(0xff191a2c)); + expect(scheme.secondaryFixed, const Color(0xffe2e0f9)); + expect(scheme.secondaryFixedDim, const Color(0xffc6c4dd)); + expect(scheme.onSecondaryFixed, const Color(0xff191a2c)); + expect(scheme.onSecondaryFixedVariant, const Color(0xff454559)); expect(scheme.tertiary, const Color(0xff79536a)); expect(scheme.onTertiary, const Color(0xffffffff)); expect(scheme.tertiaryContainer, const Color(0xffffd8ec)); expect(scheme.onTertiaryContainer, const Color(0xff2e1125)); + expect(scheme.tertiaryFixed, const Color(0xffffd8ec)); + expect(scheme.tertiaryFixedDim, const Color(0xffe9b9d3)); + expect(scheme.onTertiaryFixed, const Color(0xff2e1125)); + expect(scheme.onTertiaryFixedVariant, const Color(0xff5f3c51)); expect(scheme.error, const Color(0xffba1a1a)); expect(scheme.onError, const Color(0xffffffff)); expect(scheme.errorContainer, const Color(0xffffdad6)); expect(scheme.onErrorContainer, const Color(0xff410002)); - expect(scheme.background, const Color(0xfffffbff)); - expect(scheme.onBackground, const Color(0xff1c1b1f)); - expect(scheme.surface, const Color(0xfffffbff)); - expect(scheme.onSurface, const Color(0xff1c1b1f)); + expect(scheme.background, const Color(0xfffcf8ff)); + expect(scheme.onBackground, const Color(0xff1b1b21)); + expect(scheme.surface, const Color(0xfffcf8ff)); + expect(scheme.surfaceDim, const Color(0xffdcd9e0)); + expect(scheme.surfaceBright, const Color(0xfffcf8ff)); + expect(scheme.surfaceContainerLowest, const Color(0xffffffff)); + expect(scheme.surfaceContainerLow, const Color(0xfff6f2fa)); + expect(scheme.surfaceContainer, const Color(0xfff0ecf4)); + expect(scheme.surfaceContainerHigh, const Color(0xffeae7ef)); + expect(scheme.surfaceContainerHighest, const Color(0xffe4e1e9)); + expect(scheme.onSurface, const Color(0xff1b1b21)); expect(scheme.surfaceVariant, const Color(0xffe4e1ec)); expect(scheme.onSurfaceVariant, const Color(0xff46464f)); expect(scheme.outline, const Color(0xff777680)); expect(scheme.outlineVariant, const Color(0xffc8c5d0)); expect(scheme.shadow, const Color(0xff000000)); expect(scheme.scrim, const Color(0xff000000)); - expect(scheme.inverseSurface, const Color(0xff313034)); - expect(scheme.onInverseSurface, const Color(0xfff3eff4)); + expect(scheme.inverseSurface, const Color(0xff303036)); + expect(scheme.onInverseSurface, const Color(0xfff3eff7)); expect(scheme.inversePrimary, const Color(0xffc0c1ff)); - expect(scheme.surfaceTint, const Color(0xff4040f3)); + expect(scheme.surfaceTint, const Color(0xff575992)); }, skip: isBrowser, // [intended] uses dart:typed_data. ); @@ -475,32 +589,51 @@ void main() { provider: image, brightness: Brightness.dark); expect(scheme.primary, const Color(0xffc0c1ff)); - expect(scheme.onPrimary, const Color(0xff0f00aa)); - expect(scheme.primaryContainer, const Color(0xff2218dd)); + expect(scheme.onPrimary, const Color(0xff292a60)); + expect(scheme.primaryContainer, const Color(0xff3f4178)); expect(scheme.onPrimaryContainer, const Color(0xffe1e0ff)); + expect(scheme.primaryFixed, const Color(0xffe1e0ff)); + expect(scheme.primaryFixedDim, const Color(0xffc0c1ff)); + expect(scheme.onPrimaryFixed, const Color(0xff13144b)); + expect(scheme.onPrimaryFixedVariant, const Color(0xff3f4178)); expect(scheme.secondary, const Color(0xffc6c4dd)); expect(scheme.onSecondary, const Color(0xff2e2f42)); expect(scheme.secondaryContainer, const Color(0xff454559)); expect(scheme.onSecondaryContainer, const Color(0xffe2e0f9)); + expect(scheme.secondaryFixed, const Color(0xffe2e0f9)); + expect(scheme.secondaryFixedDim, const Color(0xffc6c4dd)); + expect(scheme.onSecondaryFixed, const Color(0xff191a2c)); + expect(scheme.onSecondaryFixedVariant, const Color(0xff454559)); expect(scheme.tertiary, const Color(0xffe9b9d3)); expect(scheme.onTertiary, const Color(0xff46263a)); expect(scheme.tertiaryContainer, const Color(0xff5f3c51)); expect(scheme.onTertiaryContainer, const Color(0xffffd8ec)); + expect(scheme.tertiaryFixed, const Color(0xffffd8ec)); + expect(scheme.tertiaryFixedDim, const Color(0xffe9b9d3)); + expect(scheme.onTertiaryFixed, const Color(0xff2e1125)); + expect(scheme.onTertiaryFixedVariant, const Color(0xff5f3c51)); expect(scheme.error, const Color(0xffffb4ab)); expect(scheme.onError, const Color(0xff690005)); expect(scheme.errorContainer, const Color(0xff93000a)); - expect(scheme.onErrorContainer, const Color(0xffffb4ab)); - expect(scheme.background, const Color(0xff1c1b1f)); - expect(scheme.onBackground, const Color(0xffe5e1e6)); - expect(scheme.surface, const Color(0xff1c1b1f)); - expect(scheme.onSurface, const Color(0xffe5e1e6)); + expect(scheme.onErrorContainer, const Color(0xffffdad6)); + expect(scheme.background, const Color(0xff131318)); + expect(scheme.onBackground, const Color(0xffe4e1e9)); + expect(scheme.surface, const Color(0xff131318)); + expect(scheme.surfaceDim, const Color(0xff131318)); + expect(scheme.surfaceBright, const Color(0xff39383f)); + expect(scheme.surfaceContainerLowest, const Color(0xff0e0e13)); + expect(scheme.surfaceContainerLow, const Color(0xff1b1b21)); + expect(scheme.surfaceContainer, const Color(0xff1f1f25)); + expect(scheme.surfaceContainerHigh, const Color(0xff2a292f)); + expect(scheme.surfaceContainerHighest, const Color(0xff35343a)); + expect(scheme.onSurface, const Color(0xffe4e1e9)); expect(scheme.surfaceVariant, const Color(0xff46464f)); expect(scheme.onSurfaceVariant, const Color(0xffc8c5d0)); expect(scheme.outline, const Color(0xff918f9a)); expect(scheme.outlineVariant, const Color(0xff46464f)); - expect(scheme.inverseSurface, const Color(0xffe5e1e6)); - expect(scheme.onInverseSurface, const Color(0xff313034)); - expect(scheme.inversePrimary, const Color(0xff4040f3)); + expect(scheme.inverseSurface, const Color(0xffe4e1e9)); + expect(scheme.onInverseSurface, const Color(0xff303036)); + expect(scheme.inversePrimary, const Color(0xff575992)); expect(scheme.surfaceTint, const Color(0xffc0c1ff)); }, skip: isBrowser, // [intended] uses dart:isolate and io. ); diff --git a/packages/flutter/test/material/date_picker_test.dart b/packages/flutter/test/material/date_picker_test.dart index 48d90f42708cf..177a79800e9c4 100644 --- a/packages/flutter/test/material/date_picker_test.dart +++ b/packages/flutter/test/material/date_picker_test.dart @@ -166,9 +166,9 @@ void main() { matching: find.byType(Material), ).first); - expect(dialogMaterial.color, theme.colorScheme.surface); + expect(dialogMaterial.color, theme.colorScheme.surfaceContainerHigh); expect(dialogMaterial.shadowColor, Colors.transparent); - expect(dialogMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(dialogMaterial.surfaceTintColor, Colors.transparent); expect(dialogMaterial.elevation, 6.0); expect( dialogMaterial.shape, @@ -1290,7 +1290,7 @@ void main() { await tester.pumpAndSettle(); expect( Material.of(tester.element(find.text('30'))), - paints..circle()..circle(color: material3 ? theme.colorScheme.onSurfaceVariant.withOpacity(0.12) : theme.colorScheme.onSurfaceVariant.withOpacity(0.12)) + paints..circle()..circle(color: material3 ? theme.colorScheme.onSurfaceVariant.withOpacity(0.1) : theme.colorScheme.onSurfaceVariant.withOpacity(0.12)) ); await gesture.up(); await tester.pumpAndSettle(); diff --git a/packages/flutter/test/material/date_picker_theme_test.dart b/packages/flutter/test/material/date_picker_theme_test.dart index 58bb87aed2b9f..571af49df8421 100644 --- a/packages/flutter/test/material/date_picker_theme_test.dart +++ b/packages/flutter/test/material/date_picker_theme_test.dart @@ -157,10 +157,10 @@ void main() { ), ); - expect(m3.backgroundColor, colorScheme.surface); + expect(m3.backgroundColor, colorScheme.surfaceContainerHigh); expect(m3.elevation, 6); expect(m3.shadowColor, const Color(0x00000000)); // Colors.transparent - expect(m3.surfaceTintColor, colorScheme.surfaceTint); + expect(m3.surfaceTintColor, Colors.transparent); expect(m3.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(28))); expect(m3.headerBackgroundColor, const Color(0x00000000)); // Colors.transparent expect(m3.headerForegroundColor, colorScheme.onSurfaceVariant); @@ -175,14 +175,14 @@ void main() { expect(m3.dayBackgroundColor?.resolve({MaterialState.selected}), colorScheme.primary); expect(m3.dayOverlayColor?.resolve({}), null); expect(m3.dayOverlayColor?.resolve({MaterialState.selected, MaterialState.hovered}), colorScheme.onPrimary.withOpacity(0.08)); - expect(m3.dayOverlayColor?.resolve({MaterialState.selected, MaterialState.focused}), colorScheme.onPrimary.withOpacity(0.12)); + expect(m3.dayOverlayColor?.resolve({MaterialState.selected, MaterialState.focused}), colorScheme.onPrimary.withOpacity(0.1)); expect(m3.dayOverlayColor?.resolve({MaterialState.hovered}), colorScheme.onSurfaceVariant.withOpacity(0.08)); - expect(m3.dayOverlayColor?.resolve({MaterialState.focused}), colorScheme.onSurfaceVariant.withOpacity(0.12)); - expect(m3.dayOverlayColor?.resolve({MaterialState.pressed}), colorScheme.onSurfaceVariant.withOpacity(0.12)); + expect(m3.dayOverlayColor?.resolve({MaterialState.focused}), colorScheme.onSurfaceVariant.withOpacity(0.1)); + expect(m3.dayOverlayColor?.resolve({MaterialState.pressed}), colorScheme.onSurfaceVariant.withOpacity(0.1)); expect(m3.dayOverlayColor?.resolve({MaterialState.selected, MaterialState.hovered, MaterialState.focused}), colorScheme.onPrimary.withOpacity(0.08)); - expect(m3.dayOverlayColor?.resolve({MaterialState.selected, MaterialState.hovered, MaterialState.pressed}), colorScheme.onPrimary.withOpacity(0.12)); + expect(m3.dayOverlayColor?.resolve({MaterialState.selected, MaterialState.hovered, MaterialState.pressed}), colorScheme.onPrimary.withOpacity(0.1)); expect(m3.dayOverlayColor?.resolve({MaterialState.hovered, MaterialState.focused}), colorScheme.onSurfaceVariant.withOpacity(0.08)); - expect(m3.dayOverlayColor?.resolve({MaterialState.hovered, MaterialState.pressed}), colorScheme.onSurfaceVariant.withOpacity(0.12)); + expect(m3.dayOverlayColor?.resolve({MaterialState.hovered, MaterialState.pressed}), colorScheme.onSurfaceVariant.withOpacity(0.1)); expect(m3.todayForegroundColor?.resolve({}), colorScheme.primary); expect(m3.todayForegroundColor?.resolve({MaterialState.disabled}), colorScheme.primary.withOpacity(0.38)); expect(m3.todayBorder, BorderSide(color: colorScheme.primary)); @@ -194,10 +194,10 @@ void main() { expect(m3.yearBackgroundColor?.resolve({MaterialState.selected}), colorScheme.primary); expect(m3.yearOverlayColor?.resolve({}), null); expect(m3.yearOverlayColor?.resolve({MaterialState.selected, MaterialState.hovered}), colorScheme.onPrimary.withOpacity(0.08)); - expect(m3.yearOverlayColor?.resolve({MaterialState.selected, MaterialState.focused}), colorScheme.onPrimary.withOpacity(0.12)); + expect(m3.yearOverlayColor?.resolve({MaterialState.selected, MaterialState.focused}), colorScheme.onPrimary.withOpacity(0.1)); expect(m3.yearOverlayColor?.resolve({MaterialState.hovered}), colorScheme.onSurfaceVariant.withOpacity(0.08)); - expect(m3.yearOverlayColor?.resolve({MaterialState.focused}), colorScheme.onSurfaceVariant.withOpacity(0.12)); - expect(m3.yearOverlayColor?.resolve({MaterialState.pressed}), colorScheme.onSurfaceVariant.withOpacity(0.12)); + expect(m3.yearOverlayColor?.resolve({MaterialState.focused}), colorScheme.onSurfaceVariant.withOpacity(0.1)); + expect(m3.yearOverlayColor?.resolve({MaterialState.pressed}), colorScheme.onSurfaceVariant.withOpacity(0.1)); expect(m3.rangePickerElevation, 0); expect(m3.rangePickerShape, const RoundedRectangleBorder()); expect(m3.rangePickerShadowColor, Colors.transparent); diff --git a/packages/flutter/test/material/date_range_picker_test.dart b/packages/flutter/test/material/date_range_picker_test.dart index eb5b71f311e96..44b9a7611b3f7 100644 --- a/packages/flutter/test/material/date_range_picker_test.dart +++ b/packages/flutter/test/material/date_range_picker_test.dart @@ -181,7 +181,7 @@ void main() { matching: find.byType(Material), ).first); - expect(dialogMaterial.color, theme.colorScheme.surface); + expect(dialogMaterial.color, theme.colorScheme.surfaceContainerHigh); expect(dialogMaterial.shadowColor, Colors.transparent); expect(dialogMaterial.surfaceTintColor, Colors.transparent); expect(dialogMaterial.elevation, 0.0); @@ -201,7 +201,7 @@ void main() { matching: find.byType(Material), ).first); - expect(dialogMaterial.color, theme.colorScheme.surface); + expect(dialogMaterial.color, theme.colorScheme.surfaceContainerHigh); expect(dialogMaterial.shadowColor, Colors.transparent); expect(dialogMaterial.surfaceTintColor, Colors.transparent); expect(dialogMaterial.elevation, 0.0); @@ -798,9 +798,9 @@ void main() { matching: find.byType(Material), ).first); - expect(dialogMaterial.color, theme.colorScheme.surface); + expect(dialogMaterial.color, theme.colorScheme.surfaceContainerHigh); expect(dialogMaterial.shadowColor, Colors.transparent); - expect(dialogMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(dialogMaterial.surfaceTintColor, Colors.transparent); expect(dialogMaterial.elevation, 6.0); expect( dialogMaterial.shape, diff --git a/packages/flutter/test/material/drawer_theme_test.dart b/packages/flutter/test/material/drawer_theme_test.dart index c7a24d2d48337..6b3bf17eedf0a 100644 --- a/packages/flutter/test/material/drawer_theme_test.dart +++ b/packages/flutter/test/material/drawer_theme_test.dart @@ -97,10 +97,10 @@ void main() { scaffoldKey.currentState!.openDrawer(); await tester.pumpAndSettle(); - expect(_drawerMaterial(tester).color, theme.colorScheme.surface); + expect(_drawerMaterial(tester).color, theme.colorScheme.surfaceContainerLow); expect(_drawerMaterial(tester).elevation, 1.0); expect(_drawerMaterial(tester).shadowColor, Colors.transparent); - expect(_drawerMaterial(tester).surfaceTintColor, theme.colorScheme.surfaceTint); + expect(_drawerMaterial(tester).surfaceTintColor, Colors.transparent); expect( _drawerMaterial(tester).shape, const RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(right: Radius.circular(16.0))) @@ -148,10 +148,10 @@ void main() { scaffoldKey.currentState!.openEndDrawer(); await tester.pumpAndSettle(); - expect(_drawerMaterial(tester).color, theme.colorScheme.surface); + expect(_drawerMaterial(tester).color, theme.colorScheme.surfaceContainerLow); expect(_drawerMaterial(tester).elevation, 1.0); expect(_drawerMaterial(tester).shadowColor, Colors.transparent); - expect(_drawerMaterial(tester).surfaceTintColor, theme.colorScheme.surfaceTint); + expect(_drawerMaterial(tester).surfaceTintColor, Colors.transparent); expect( _drawerMaterial(tester).shape, const RoundedRectangleBorder(borderRadius: BorderRadius.horizontal(left: Radius.circular(16.0))) diff --git a/packages/flutter/test/material/dropdown_menu_test.dart b/packages/flutter/test/material/dropdown_menu_test.dart index 683ca4f08c4ee..243e59e4f8fc2 100644 --- a/packages/flutter/test/material/dropdown_menu_test.dart +++ b/packages/flutter/test/material/dropdown_menu_test.dart @@ -62,9 +62,9 @@ void main() { matching: find.byType(Material), ).at(1); Material material = tester.widget(menuMaterial); - expect(material.color, themeData.colorScheme.surface); + expect(material.color, themeData.colorScheme.surfaceContainer); expect(material.shadowColor, themeData.colorScheme.shadow); - expect(material.surfaceTintColor, themeData.colorScheme.surfaceTint); + expect(material.surfaceTintColor, Colors.transparent); expect(material.elevation, 3.0); expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0)))); diff --git a/packages/flutter/test/material/dropdown_menu_theme_test.dart b/packages/flutter/test/material/dropdown_menu_theme_test.dart index 2c02c78684f9b..432f7864f4fad 100644 --- a/packages/flutter/test/material/dropdown_menu_theme_test.dart +++ b/packages/flutter/test/material/dropdown_menu_theme_test.dart @@ -81,9 +81,9 @@ void main() { matching: find.byType(Material), ).at(1); Material material = tester.widget(menuMaterial); - expect(material.color, themeData.colorScheme.surface); + expect(material.color, themeData.colorScheme.surfaceContainer); expect(material.shadowColor, themeData.colorScheme.shadow); - expect(material.surfaceTintColor, themeData.colorScheme.surfaceTint); + expect(material.surfaceTintColor, Colors.transparent); expect(material.elevation, 3.0); expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0)))); diff --git a/packages/flutter/test/material/elevated_button_test.dart b/packages/flutter/test/material/elevated_button_test.dart index f3042f5003074..2e9d958bebf94 100644 --- a/packages/flutter/test/material/elevated_button_test.dart +++ b/packages/flutter/test/material/elevated_button_test.dart @@ -285,7 +285,7 @@ void main() { await gesture.down(center); await tester.pumpAndSettle(); expect(elevation(), 1.0); - expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.primary.withOpacity(0.12))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.primary.withOpacity(0.1))); // Remove pressed and hovered states await gesture.up(); await tester.pumpAndSettle(); @@ -296,7 +296,7 @@ void main() { focusNode.requestFocus(); await tester.pumpAndSettle(); expect(elevation(), 1.0); - expect(overlayColor(), paints..rect(color: theme.colorScheme.primary.withOpacity(0.12))); + expect(overlayColor(), paints..rect(color: theme.colorScheme.primary.withOpacity(0.1))); focusNode.dispose(); }); diff --git a/packages/flutter/test/material/elevated_button_theme_test.dart b/packages/flutter/test/material/elevated_button_theme_test.dart index 1957b7463874e..4645c5040dd68 100644 --- a/packages/flutter/test/material/elevated_button_theme_test.dart +++ b/packages/flutter/test/material/elevated_button_theme_test.dart @@ -178,8 +178,8 @@ void main() { expect(MaterialStateProperty.resolveAs(inkWell.mouseCursor!, enabled), enabledMouseCursor); expect(MaterialStateProperty.resolveAs(inkWell.mouseCursor!, disabled), disabledMouseCursor); expect(inkWell.overlayColor!.resolve(hovered), foregroundColor.withOpacity(0.08)); - expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.24)); - expect(inkWell.overlayColor!.resolve(pressed), foregroundColor.withOpacity(0.24)); + expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.1)); + expect(inkWell.overlayColor!.resolve(pressed), foregroundColor.withOpacity(0.1)); expect(inkWell.enableFeedback, enableFeedback); expect(material.borderRadius, null); expect(material.shape, shape); diff --git a/packages/flutter/test/material/filled_button_test.dart b/packages/flutter/test/material/filled_button_test.dart index 0827808d04f84..e0dcc9f26b582 100644 --- a/packages/flutter/test/material/filled_button_test.dart +++ b/packages/flutter/test/material/filled_button_test.dart @@ -413,7 +413,7 @@ void main() { await gesture.down(center); await tester.pumpAndSettle(); expect(elevation(), 0.0); - expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onPrimary.withOpacity(0.12))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onPrimary.withOpacity(0.1))); // Remove pressed and hovered states await gesture.up(); await tester.pumpAndSettle(); @@ -424,7 +424,7 @@ void main() { focusNode.requestFocus(); await tester.pumpAndSettle(); expect(elevation(), 0.0); - expect(overlayColor(), paints..rect(color: theme.colorScheme.onPrimary.withOpacity(0.12))); + expect(overlayColor(), paints..rect(color: theme.colorScheme.onPrimary.withOpacity(0.1))); focusNode.dispose(); }); @@ -479,7 +479,7 @@ void main() { await gesture.down(center); await tester.pumpAndSettle(); expect(elevation(), 0.0); - expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSecondaryContainer.withOpacity(0.12))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSecondaryContainer.withOpacity(0.1))); // Remove pressed and hovered states await gesture.up(); await tester.pumpAndSettle(); @@ -490,7 +490,7 @@ void main() { focusNode.requestFocus(); await tester.pumpAndSettle(); expect(elevation(), 0.0); - expect(overlayColor(), paints..rect(color: theme.colorScheme.onSecondaryContainer.withOpacity(0.12))); + expect(overlayColor(), paints..rect(color: theme.colorScheme.onSecondaryContainer.withOpacity(0.1))); focusNode.dispose(); }); diff --git a/packages/flutter/test/material/filled_button_theme_test.dart b/packages/flutter/test/material/filled_button_theme_test.dart index 5b0d7c4dbe52f..e3a5fa5b57e84 100644 --- a/packages/flutter/test/material/filled_button_theme_test.dart +++ b/packages/flutter/test/material/filled_button_theme_test.dart @@ -142,8 +142,8 @@ void main() { expect(MaterialStateProperty.resolveAs(inkWell.mouseCursor!, enabled), enabledMouseCursor); expect(MaterialStateProperty.resolveAs(inkWell.mouseCursor!, disabled), disabledMouseCursor); expect(inkWell.overlayColor!.resolve(hovered), foregroundColor.withOpacity(0.08)); - expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.12)); - expect(inkWell.overlayColor!.resolve(pressed), foregroundColor.withOpacity(0.12)); + expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.1)); + expect(inkWell.overlayColor!.resolve(pressed), foregroundColor.withOpacity(0.1)); expect(inkWell.enableFeedback, enableFeedback); expect(material.borderRadius, null); expect(material.shape, shape); diff --git a/packages/flutter/test/material/filter_chip_test.dart b/packages/flutter/test/material/filter_chip_test.dart index 0265c6bc49614..ec24e44d43025 100644 --- a/packages/flutter/test/material/filter_chip_test.dart +++ b/packages/flutter/test/material/filter_chip_test.dart @@ -275,7 +275,7 @@ void main() { Material chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, Colors.transparent); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, RoundedRectangleBorder( @@ -304,7 +304,7 @@ void main() { chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, Colors.transparent); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, RoundedRectangleBorder( @@ -334,7 +334,7 @@ void main() { chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, null); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, const RoundedRectangleBorder( @@ -364,7 +364,7 @@ void main() { chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, null); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, const RoundedRectangleBorder( @@ -410,7 +410,7 @@ void main() { Material chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 1); expect(chipMaterial.shadowColor, theme.colorScheme.shadow); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, const RoundedRectangleBorder( @@ -420,7 +420,7 @@ void main() { ); ShapeDecoration decoration = tester.widget(find.byType(Ink)).decoration! as ShapeDecoration; - expect(decoration.color, null); + expect(decoration.color, theme.colorScheme.surfaceContainerLow); // Test disabled FilterChip.elevated defaults. await tester.pumpWidget( @@ -439,7 +439,7 @@ void main() { chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, theme.colorScheme.shadow); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, const RoundedRectangleBorder( @@ -469,7 +469,7 @@ void main() { chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 1); expect(chipMaterial.shadowColor, null); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, const RoundedRectangleBorder( @@ -499,7 +499,7 @@ void main() { chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, null); - expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(chipMaterial.surfaceTintColor, Colors.transparent); expect( chipMaterial.shape, const RoundedRectangleBorder( diff --git a/packages/flutter/test/material/floating_action_button_theme_test.dart b/packages/flutter/test/material/floating_action_button_theme_test.dart index f3d54f69957ea..17c62e7c66054 100644 --- a/packages/flutter/test/material/floating_action_button_theme_test.dart +++ b/packages/flutter/test/material/floating_action_button_theme_test.dart @@ -38,7 +38,7 @@ void main() { expect(_getRawMaterialButton(tester).elevation, 6); expect(_getRawMaterialButton(tester).highlightElevation, 6); expect(_getRawMaterialButton(tester).shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(16.0)))); - expect(_getRawMaterialButton(tester).splashColor, colorScheme.onPrimaryContainer.withOpacity(0.12)); + expect(_getRawMaterialButton(tester).splashColor, colorScheme.onPrimaryContainer.withOpacity(0.1)); expect(_getRawMaterialButton(tester).constraints, const BoxConstraints.tightFor(width: 56.0, height: 56.0)); expect(_getIconSize(tester).width, 24.0); expect(_getIconSize(tester).height, 24.0); diff --git a/packages/flutter/test/material/icon_button_test.dart b/packages/flutter/test/material/icon_button_test.dart index 80d91f9e0ed11..2a74cf2764d9e 100644 --- a/packages/flutter/test/material/icon_button_test.dart +++ b/packages/flutter/test/material/icon_button_test.dart @@ -1239,7 +1239,7 @@ void main() { // Highlighted (pressed). await gesture.down(center); await tester.pumpAndSettle(); - expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSurfaceVariant.withOpacity(0.12))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSurfaceVariant.withOpacity(0.1))); // Remove pressed and hovered states await gesture.up(); await tester.pumpAndSettle(); @@ -1249,7 +1249,7 @@ void main() { // Focused. focusNode.requestFocus(); await tester.pumpAndSettle(); - expect(overlayColor(), paints..rect(color: theme.colorScheme.onSurfaceVariant.withOpacity(0.12))); + expect(overlayColor(), paints..rect(color: theme.colorScheme.onSurfaceVariant.withOpacity(0.1))); focusNode.dispose(); }); @@ -1380,7 +1380,7 @@ void main() { // Highlighted (pressed). await gesture.down(center); await tester.pumpAndSettle(); - expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onPrimary.withOpacity(0.12))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onPrimary.withOpacity(0.1))); // Remove pressed and hovered states await gesture.up(); await tester.pumpAndSettle(); @@ -1390,7 +1390,7 @@ void main() { // Focused. focusNode.requestFocus(); await tester.pumpAndSettle(); - expect(overlayColor(), paints..rect(color: theme.colorScheme.onPrimary.withOpacity(0.12))); + expect(overlayColor(), paints..rect(color: theme.colorScheme.onPrimary.withOpacity(0.1))); focusNode.dispose(); }); @@ -1636,7 +1636,7 @@ void main() { // Highlighted (pressed). await gesture.down(center); await tester.pumpAndSettle(); - expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSecondaryContainer.withOpacity(0.12))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSecondaryContainer.withOpacity(0.1))); // Remove pressed and hovered states await gesture.up(); await tester.pumpAndSettle(); @@ -1646,7 +1646,7 @@ void main() { // Focused. focusNode.requestFocus(); await tester.pumpAndSettle(); - expect(overlayColor(), paints..rect(color: theme.colorScheme.onSecondaryContainer.withOpacity(0.12))); + expect(overlayColor(), paints..rect(color: theme.colorScheme.onSecondaryContainer.withOpacity(0.1))); focusNode.dispose(); }); @@ -1892,7 +1892,7 @@ void main() { // Highlighted (pressed). await gesture.down(center); await tester.pumpAndSettle(); - expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSurface.withOpacity(0.12))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSurface.withOpacity(0.1))); // Remove pressed and hovered states await gesture.up(); await tester.pumpAndSettle(); diff --git a/packages/flutter/test/material/icon_button_theme_test.dart b/packages/flutter/test/material/icon_button_theme_test.dart index 7cc64cf8744ff..4acf1807f82ba 100644 --- a/packages/flutter/test/material/icon_button_theme_test.dart +++ b/packages/flutter/test/material/icon_button_theme_test.dart @@ -135,8 +135,8 @@ void main() { expect(MaterialStateProperty.resolveAs(inkWell.mouseCursor, enabled), enabledMouseCursor); expect(MaterialStateProperty.resolveAs(inkWell.mouseCursor, disabled), disabledMouseCursor); expect(inkWell.overlayColor!.resolve(hovered), foregroundColor.withOpacity(0.08)); - expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.08)); - expect(inkWell.overlayColor!.resolve(pressed), foregroundColor.withOpacity(0.12)); + expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.1)); + expect(inkWell.overlayColor!.resolve(pressed), foregroundColor.withOpacity(0.1)); expect(inkWell.enableFeedback, enableFeedback); expect(material.borderRadius, null); expect(material.shape, shape); diff --git a/packages/flutter/test/material/list_tile_test.dart b/packages/flutter/test/material/list_tile_test.dart index 5e7dd8593489f..5b5947a40eba1 100644 --- a/packages/flutter/test/material/list_tile_test.dart +++ b/packages/flutter/test/material/list_tile_test.dart @@ -1380,7 +1380,7 @@ void main() { find.byType(Material), paints ..path(color: const Color(0xff000000)) - ..path(color: const Color(0xffece6f3)) + ..path(color: const Color(0xfff7f2fa)) ..save() ..save(), ); @@ -1394,7 +1394,7 @@ void main() { find.byType(Material), paints ..path(color: const Color(0xff000000)) - ..path(color: const Color(0xffece6f3)) + ..path(color: const Color(0xfff7f2fa)) ..save() ..save(), ); diff --git a/packages/flutter/test/material/menu_anchor_test.dart b/packages/flutter/test/material/menu_anchor_test.dart index 56ce7b4f54f67..88d7620d7acf1 100644 --- a/packages/flutter/test/material/menu_anchor_test.dart +++ b/packages/flutter/test/material/menu_anchor_test.dart @@ -289,9 +289,9 @@ void main() { Material material = tester.widget(menuMaterial); expect(opened, isEmpty); - expect(material.color, themeData.colorScheme.surface); + expect(material.color, themeData.colorScheme.surfaceContainer); expect(material.shadowColor, themeData.colorScheme.shadow); - expect(material.surfaceTintColor, themeData.colorScheme.surfaceTint); + expect(material.surfaceTintColor, Colors.transparent); expect(material.elevation, 3.0); expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0)))); @@ -322,9 +322,9 @@ void main() { material = tester.widget(menuMaterial); expect(opened.last, equals(TestMenu.mainMenu1)); - expect(material.color, themeData.colorScheme.surface); + expect(material.color, themeData.colorScheme.surfaceContainer); expect(material.shadowColor, themeData.colorScheme.shadow); - expect(material.surfaceTintColor, themeData.colorScheme.surfaceTint); + expect(material.surfaceTintColor, Colors.transparent); expect(material.elevation, 3.0); expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0)))); @@ -379,9 +379,9 @@ void main() { Material material = tester.widget(menuMaterial); expect(opened, isEmpty); - expect(material.color, themeData.colorScheme.surface); + expect(material.color, themeData.colorScheme.surfaceContainer); expect(material.shadowColor, themeData.colorScheme.shadow); - expect(material.surfaceTintColor, themeData.colorScheme.surfaceTint); + expect(material.surfaceTintColor, Colors.transparent); expect(material.elevation, 3.0); expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0)))); @@ -409,9 +409,9 @@ void main() { .first; material = tester.widget(menuMaterial); - expect(material.color, themeData.colorScheme.surface); + expect(material.color, themeData.colorScheme.surfaceContainer); expect(material.shadowColor, themeData.colorScheme.shadow); - expect(material.surfaceTintColor, themeData.colorScheme.surfaceTint); + expect(material.surfaceTintColor, Colors.transparent); expect(material.elevation, 3.0); expect(material.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4.0)))); diff --git a/packages/flutter/test/material/navigation_bar_test.dart b/packages/flutter/test/material/navigation_bar_test.dart index 1abd469b22f56..1974e25905979 100644 --- a/packages/flutter/test/material/navigation_bar_test.dart +++ b/packages/flutter/test/material/navigation_bar_test.dart @@ -296,8 +296,8 @@ void main() { ), ); - expect(_getMaterial(tester).color, theme.colorScheme.surface); - expect(_getMaterial(tester).surfaceTintColor, theme.colorScheme.surfaceTint); + expect(_getMaterial(tester).color, theme.colorScheme.surfaceContainer); + expect(_getMaterial(tester).surfaceTintColor, Colors.transparent); expect(_getMaterial(tester).elevation, 3); expect(tester.getSize(find.byType(NavigationBar)).height, 80); expect(_getIndicatorDecoration(tester)?.color, theme.colorScheme.secondaryContainer); diff --git a/packages/flutter/test/material/navigation_drawer_test.dart b/packages/flutter/test/material/navigation_drawer_test.dart index 1d571afaae260..849ce1fe60d20 100644 --- a/packages/flutter/test/material/navigation_drawer_test.dart +++ b/packages/flutter/test/material/navigation_drawer_test.dart @@ -181,8 +181,8 @@ void main() { await tester.pump(const Duration(seconds: 1)); // Test drawer Material. - expect(_getMaterial(tester).color, theme.colorScheme.surface); - expect(_getMaterial(tester).surfaceTintColor, theme.colorScheme.surfaceTint); + expect(_getMaterial(tester).color, theme.colorScheme.surfaceContainerLow); + expect(_getMaterial(tester).surfaceTintColor, Colors.transparent); expect(_getMaterial(tester).shadowColor, Colors.transparent); expect(_getMaterial(tester).elevation, 1); // Test indicator decoration. diff --git a/packages/flutter/test/material/navigation_rail_test.dart b/packages/flutter/test/material/navigation_rail_test.dart index dd4e2cab29eb2..dea6254965c08 100644 --- a/packages/flutter/test/material/navigation_rail_test.dart +++ b/packages/flutter/test/material/navigation_rail_test.dart @@ -79,7 +79,7 @@ void main() { ), ); - expect(_railMaterial(tester).color, equals(const Color(0xFFFFFBFE))); // default surface color in M3 colorScheme + expect(_railMaterial(tester).color, equals(const Color(0xfffef7ff))); // default surface color in M3 colorScheme await _pumpNavigationRail( tester, diff --git a/packages/flutter/test/material/outlined_button_test.dart b/packages/flutter/test/material/outlined_button_test.dart index 3bef05df9f051..8fb94679ed68d 100644 --- a/packages/flutter/test/material/outlined_button_test.dart +++ b/packages/flutter/test/material/outlined_button_test.dart @@ -253,7 +253,7 @@ void main() { // Highlighted (pressed). await gesture.down(center); await tester.pumpAndSettle(); - expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.primary.withOpacity(0.12))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.primary.withOpacity(0.1))); // Remove pressed and hovered states await gesture.up(); await tester.pumpAndSettle(); @@ -263,7 +263,7 @@ void main() { // Focused. focusNode.requestFocus(); await tester.pumpAndSettle(); - expect(overlayColor(), paints..rect(color: theme.colorScheme.primary.withOpacity(0.12))); + expect(overlayColor(), paints..rect(color: theme.colorScheme.primary.withOpacity(0.1))); focusNode.dispose(); }); diff --git a/packages/flutter/test/material/outlined_button_theme_test.dart b/packages/flutter/test/material/outlined_button_theme_test.dart index 93e10033f7549..3d71ca4ceef70 100644 --- a/packages/flutter/test/material/outlined_button_theme_test.dart +++ b/packages/flutter/test/material/outlined_button_theme_test.dart @@ -185,8 +185,8 @@ void main() { expect(material.elevation, elevation); expect(MaterialStateProperty.resolveAs(inkWell.mouseCursor, enabled), enabledMouseCursor); expect(MaterialStateProperty.resolveAs(inkWell.mouseCursor, disabled), disabledMouseCursor); - expect(inkWell.overlayColor!.resolve(hovered), foregroundColor.withOpacity(0.04)); - expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.12)); + expect(inkWell.overlayColor!.resolve(hovered), foregroundColor.withOpacity(0.08)); + expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.1)); expect(inkWell.enableFeedback, enableFeedback); expect(material.borderRadius, null); expect(material.shape, shape); diff --git a/packages/flutter/test/material/popup_menu_theme_test.dart b/packages/flutter/test/material/popup_menu_theme_test.dart index ccdf0cbf89018..302e82c33e1f9 100644 --- a/packages/flutter/test/material/popup_menu_theme_test.dart +++ b/packages/flutter/test/material/popup_menu_theme_test.dart @@ -189,9 +189,9 @@ void main() { matching: find.byType(Material), ).last, ); - expect(button.color, theme.colorScheme.surface); + expect(button.color, theme.colorScheme.surfaceContainer); expect(button.shadowColor, theme.colorScheme.shadow); - expect(button.surfaceTintColor, theme.colorScheme.surfaceTint); + expect(button.surfaceTintColor, Colors.transparent); expect(button.shape, RoundedRectangleBorder(borderRadius: BorderRadius.circular(4.0))); expect(button.elevation, 3.0); diff --git a/packages/flutter/test/material/radio_test.dart b/packages/flutter/test/material/radio_test.dart index 33f12724d0647..4ba8c47633366 100644 --- a/packages/flutter/test/material/radio_test.dart +++ b/packages/flutter/test/material/radio_test.dart @@ -1287,7 +1287,7 @@ void main() { expect(focusNode.hasPrimaryFocus, isTrue); expect( Material.of(tester.element(find.byKey(radioKey))), - paints..rect()..circle(color: theme.colorScheme.primary.withOpacity(0.12))..circle(color: focusedFillColor), + paints..rect()..circle(color: theme.colorScheme.primary.withOpacity(0.1))..circle(color: focusedFillColor), ); // Start hovering @@ -1763,7 +1763,7 @@ void main() { expect( Material.of(tester.element(find.byType(Radio))), - paints..circle(color: colors.onSurface.withOpacity(0.12)) + paints..circle(color: colors.onSurface.withOpacity(0.1)) ..circle(color: colors.primary.withOpacity(1)) ); @@ -1774,7 +1774,7 @@ void main() { expect( Material.of(tester.element(find.byType(Radio))), - paints..circle(color: colors.primary.withOpacity(0.12))..circle(color: colors.onSurfaceVariant.withOpacity(1)) + paints..circle(color: colors.primary.withOpacity(0.1))..circle(color: colors.onSurfaceVariant.withOpacity(1)) ); // selected radio in focused state @@ -1785,7 +1785,7 @@ void main() { expect( Material.of(tester.element(find.byType(Radio))), - paints..circle(color: colors.primary.withOpacity(0.12))..circle(color: colors.primary.withOpacity(1)) + paints..circle(color: colors.primary.withOpacity(0.1))..circle(color: colors.primary.withOpacity(1)) ); // unselected radio in focused state @@ -1796,7 +1796,7 @@ void main() { expect( Material.of(tester.element(find.byType(Radio))), - paints..circle(color: colors.onSurface.withOpacity(0.12))..circle(color: colors.onSurface.withOpacity(1)) + paints..circle(color: colors.onSurface.withOpacity(0.1))..circle(color: colors.onSurface.withOpacity(1)) ); // selected radio in hovered state @@ -1962,7 +1962,7 @@ void main() { expect(getRadioMaterial(tester), paints - ..circle(color: theme.colorScheme.onSurface.withOpacity(0.12)) + ..circle(color: theme.colorScheme.onSurface.withOpacity(0.1)) ..circle(color: theme.colorScheme.primary) ); // Remove pressed and hovered states @@ -1977,7 +1977,7 @@ void main() { expect(getRadioMaterial(tester), paints - ..circle(color: theme.colorScheme.primary.withOpacity(0.12)) + ..circle(color: theme.colorScheme.primary.withOpacity(0.1)) ..circle(color: theme.colorScheme.primary) ); focusNode.dispose(); diff --git a/packages/flutter/test/material/search_anchor_test.dart b/packages/flutter/test/material/search_anchor_test.dart index 907ec3684ead7..759e466a0d68d 100644 --- a/packages/flutter/test/material/search_anchor_test.dart +++ b/packages/flutter/test/material/search_anchor_test.dart @@ -1128,8 +1128,8 @@ void main() { await tester.pumpAndSettle(); final Material material = getSearchViewMaterial(tester); expect(material.elevation, 6.0); - expect(material.color, colorScheme.surface); - expect(material.surfaceTintColor, colorScheme.surfaceTint); + expect(material.color, colorScheme.surfaceContainerHigh); + expect(material.surfaceTintColor, Colors.transparent); expect(material.clipBehavior, Clip.antiAlias); final Finder findDivider = find.byType(Divider); @@ -2684,7 +2684,7 @@ void main() { // Test the search view background color. Material material = getSearchViewMaterial(tester); - expect(material.color, theme.colorScheme.surface); + expect(material.color, theme.colorScheme.surfaceContainerHigh); // Change the theme brightness. theme = ThemeData(brightness: Brightness.dark); @@ -2693,7 +2693,7 @@ void main() { // Test the search view background color. material = getSearchViewMaterial(tester); - expect(material.color, theme.colorScheme.surface); + expect(material.color, theme.colorScheme.surfaceContainerHigh); }); testWidgets('Search view widgets can inherit local themes', (WidgetTester tester) async { @@ -2744,7 +2744,7 @@ void main() { // Test the search view background color. final Material searchViewMaterial = getSearchViewMaterial(tester); - expect(searchViewMaterial.color, localTheme.colorScheme.surface); + expect(searchViewMaterial.color, localTheme.colorScheme.surfaceContainerHigh); // Test the search view icons background color. final Material iconButtonMaterial = tester.widget(find.descendant( @@ -3096,10 +3096,10 @@ Future checkSearchBarDefaults(WidgetTester tester, ColorScheme colorScheme expect(material.borderOnForeground, true); expect(material.borderRadius, null); expect(material.clipBehavior, Clip.none); - expect(material.color, colorScheme.surface); + expect(material.color, colorScheme.surfaceContainerHigh); expect(material.elevation, 6.0); expect(material.shadowColor, colorScheme.shadow); - expect(material.surfaceTintColor, colorScheme.surfaceTint); + expect(material.surfaceTintColor, Colors.transparent); expect(material.shape, const StadiumBorder()); final Text helperText = tester.widget(find.text('hint text')); diff --git a/packages/flutter/test/material/segmented_button_test.dart b/packages/flutter/test/material/segmented_button_test.dart index ce4dda4d2f620..0fc3cadf57c19 100644 --- a/packages/flutter/test/material/segmented_button_test.dart +++ b/packages/flutter/test/material/segmented_button_test.dart @@ -606,7 +606,7 @@ void main() { // Highlighted (pressed). await gesture.down(center); await tester.pumpAndSettle(); - expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSurface.withOpacity(0.12))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSurface.withOpacity(0.1))); expect(material.textStyle?.color, theme.colorScheme.onSurface); }); diff --git a/packages/flutter/test/material/slider_test.dart b/packages/flutter/test/material/slider_test.dart index f422c0449bf18..34c50025c567d 100644 --- a/packages/flutter/test/material/slider_test.dart +++ b/packages/flutter/test/material/slider_test.dart @@ -1707,11 +1707,11 @@ void main() { semantics.dispose(); }); - testWidgets('Slider is focusable and has correct focus color', (WidgetTester tester) async { + testWidgets('Material3 - Slider is focusable and has correct focus color', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Slider'); addTearDown(focusNode.dispose); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); double value = 0.5; Widget buildApp({bool enabled = true}) { return MaterialApp( @@ -1743,7 +1743,7 @@ void main() { expect(focusNode.hasPrimaryFocus, isTrue); expect( Material.of(tester.element(find.byType(Slider))), - paints..circle(color: theme.colorScheme.primary.withOpacity(0.12)), + paints..circle(color: theme.colorScheme.primary.withOpacity(0.1)), ); // Check that the overlay does not show when unfocused and disabled. @@ -1752,7 +1752,7 @@ void main() { expect(focusNode.hasPrimaryFocus, isFalse); expect( Material.of(tester.element(find.byType(Slider))), - isNot(paints..circle(color: theme.colorScheme.primary.withOpacity(0.12))), + isNot(paints..circle(color: theme.colorScheme.primary.withOpacity(0.1))), ); }); @@ -1941,10 +1941,10 @@ void main() { ); }); - testWidgets('Slider is draggable and has correct dragged color', (WidgetTester tester) async { + testWidgets('Material3 - Slider is draggable and has correct dragged color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; double value = 0.5; - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final Key sliderKey = UniqueKey(); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); @@ -1978,7 +1978,7 @@ void main() { await tester.pumpAndSettle(); expect( Material.of(tester.element(find.byType(Slider))), - isNot(paints..circle(color: theme.colorScheme.primary.withOpacity(0.12))), + isNot(paints..circle(color: theme.colorScheme.primary.withOpacity(0.1))), ); // Start dragging. @@ -1992,7 +1992,7 @@ void main() { // Slider has overlay when enabled and dragged. expect( Material.of(tester.element(find.byType(Slider))), - paints..circle(color: theme.colorScheme.primary.withOpacity(0.12)), + paints..circle(color: theme.colorScheme.primary.withOpacity(0.1)), ); await drag.up(); @@ -2002,7 +2002,7 @@ void main() { expect(focusNode.hasFocus, false); expect( Material.of(tester.element(find.byType(Slider))), - isNot(paints..circle(color: theme.colorScheme.primary.withOpacity(0.12))), + isNot(paints..circle(color: theme.colorScheme.primary.withOpacity(0.1))), ); // Slider has overlay when enabled, dragged and focused. @@ -2012,7 +2012,7 @@ void main() { expect(focusNode.hasFocus, true); expect( Material.of(tester.element(find.byType(Slider))), - paints..circle(color: theme.colorScheme.primary.withOpacity(0.12)), + paints..circle(color: theme.colorScheme.primary.withOpacity(0.1)), ); }); @@ -3859,14 +3859,15 @@ void main() { ); }); - testWidgets('Slider is focusable and has correct focus color', (WidgetTester tester) async { + testWidgets('Material2 - Slider is focusable and has correct focus color', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(debugLabel: 'Slider'); addTearDown(focusNode.dispose); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; - final ThemeData theme = ThemeData(); + final ThemeData theme = ThemeData(useMaterial3: false); double value = 0.5; Widget buildApp({bool enabled = true}) { return MaterialApp( + theme: theme, home: Material( child: Center( child: StatefulBuilder(builder: (BuildContext context, StateSetter setState) { @@ -3907,16 +3908,17 @@ void main() { ); }); - testWidgets('Slider is draggable and has correct dragged color', (WidgetTester tester) async { + testWidgets('Material2 - Slider is draggable and has correct dragged color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; double value = 0.5; - final ThemeData theme = ThemeData(); + final ThemeData theme = ThemeData(useMaterial3: false); final Key sliderKey = UniqueKey(); final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); Widget buildApp({bool enabled = true}) { return MaterialApp( + theme: theme, home: Material( child: Center( child: StatefulBuilder(builder: (BuildContext context, StateSetter setState) { diff --git a/packages/flutter/test/material/slider_theme_test.dart b/packages/flutter/test/material/slider_theme_test.dart index d389b98391484..ee191cae781ed 100644 --- a/packages/flutter/test/material/slider_theme_test.dart +++ b/packages/flutter/test/material/slider_theme_test.dart @@ -110,7 +110,7 @@ void main() { final ColorScheme colorScheme = theme.colorScheme; const double trackHeight = 4.0; final Color activeTrackColor = Color(colorScheme.primary.value); - final Color inactiveTrackColor = colorScheme.surfaceVariant; + final Color inactiveTrackColor = colorScheme.surfaceContainerHighest; final Color secondaryActiveTrackColor = colorScheme.primary.withOpacity(0.54); final Color disabledActiveTrackColor = colorScheme.onSurface.withOpacity(0.38); final Color disabledInactiveTrackColor = colorScheme.onSurface.withOpacity(0.12); @@ -2077,9 +2077,9 @@ void main() { expect( valueIndicatorBox, paints - ..rrect(color: const Color(0xfffffbfe)) + ..rrect(color: const Color(0xfffef7ff)) ..rrect(color: const Color(0xff6750a4)) - ..rrect(color: const Color(0xffe7e0ec)) + ..rrect(color: const Color(0xffe6e0e9)) ..path(color: Color(theme.colorScheme.primary.value)) ); diff --git a/packages/flutter/test/material/switch_test.dart b/packages/flutter/test/material/switch_test.dart index 596a749c97ad6..3e690c12d54d0 100644 --- a/packages/flutter/test/material/switch_test.dart +++ b/packages/flutter/test/material/switch_test.dart @@ -495,7 +495,7 @@ void main() { ..save() ..rrect( style: PaintingStyle.fill, - color: colors.surfaceVariant, + color: colors.surfaceContainerHighest, rrect: RRect.fromLTRBR(4.0, 8.0, 56.0, 40.0, const Radius.circular(16.0)), ) ..rrect( @@ -560,7 +560,7 @@ void main() { ..save() ..rrect( style: PaintingStyle.fill, - color: colors.surfaceVariant, + color: colors.surfaceContainerHighest, rrect: RRect.fromLTRBR(4.0, 8.0, 56.0, 40.0, const Radius.circular(16.0)), ) ..rrect( @@ -680,7 +680,7 @@ void main() { ..save() ..rrect( style: PaintingStyle.fill, - color: colors.surfaceVariant.withOpacity(0.12), + color: colors.surfaceContainerHighest.withOpacity(0.12), rrect: RRect.fromLTRBR(4.0, 8.0, 56.0, 40.0, const Radius.circular(16.0)), ) ..rrect( @@ -800,7 +800,7 @@ void main() { await tester.pumpAndSettle(); expect(getSwitchMaterial(tester), - paints..circle(color: theme.colorScheme.primary.withOpacity(0.12)) + paints..circle(color: theme.colorScheme.primary.withOpacity(0.1)) ); // On both hovered and focused, the overlay color should show hovered overlay color. @@ -1828,7 +1828,7 @@ void main() { paints ..rrect( style: PaintingStyle.fill, - color: colors.surfaceVariant, + color: colors.surfaceContainerHighest, rrect: RRect.fromLTRBR(4.0, 8.0, 56.0, 40.0, const Radius.circular(16.0)), ) ..rrect( @@ -1849,7 +1849,7 @@ void main() { paints ..rrect( style: PaintingStyle.fill, - color: colors.surfaceVariant.withOpacity(0.12), + color: colors.surfaceContainerHighest.withOpacity(0.12), rrect: RRect.fromLTRBR(4.0, 8.0, 56.0, 40.0, const Radius.circular(16.0)), ) ..rrect( @@ -2392,7 +2392,7 @@ void main() { paints ..rrect( style: PaintingStyle.fill, - color: colors.surfaceVariant.withOpacity(0.12), + color: colors.surfaceContainerHighest.withOpacity(0.12), rrect: RRect.fromLTRBR(4.0, 8.0, 56.0, 40.0, const Radius.circular(16.0)), ) ..rrect( @@ -2428,7 +2428,7 @@ void main() { paints ..rrect( style: PaintingStyle.fill, - color: colors.surfaceVariant, + color: colors.surfaceContainerHighest, rrect: RRect.fromLTRBR(4.0, 8.0, 56.0, 40.0, const Radius.circular(16.0)), ) ..rrect() @@ -2582,7 +2582,7 @@ void main() { color: colors.primary, rrect: RRect.fromLTRBR(4.0, 8.0, 56.0, 40.0, const Radius.circular(16.0)), ) - ..circle(color: colors.primary.withOpacity(0.12)) + ..circle(color: colors.primary.withOpacity(0.1)) ..rrect(color: focusedThumbColor), reason: 'active enabled switch should default track and custom thumb color', ); @@ -3568,7 +3568,7 @@ void main() { expect(Material.of(tester.element(find.byType(Switch))), paints..rrect( - color: colors.surfaceVariant, // track color + color: colors.surfaceContainerHighest, // track color style: PaintingStyle.fill )..rrect( color: colors.outline, // track outline color @@ -3598,7 +3598,7 @@ void main() { expect(Material.of(tester.element(find.byType(Switch))), paints..rrect( - color: colors.surfaceVariant.withOpacity(0.12), // track color + color: colors.surfaceContainerHighest.withOpacity(0.12), // track color style: PaintingStyle.fill, )..rrect( color: colors.onSurface.withOpacity(0.12), // track outline color diff --git a/packages/flutter/test/material/tab_bar_theme_test.dart b/packages/flutter/test/material/tab_bar_theme_test.dart index dcb4fbfdd743e..103c521dfc28a 100644 --- a/packages/flutter/test/material/tab_bar_theme_test.dart +++ b/packages/flutter/test/material/tab_bar_theme_test.dart @@ -153,7 +153,7 @@ void main() { tabBarBox, paints ..line( - color: theme.colorScheme.surfaceVariant, + color: theme.colorScheme.outlineVariant, strokeWidth: 1.0, ) ..rrect(color: theme.colorScheme.primary), @@ -209,7 +209,7 @@ void main() { tabBarBox, paints ..line( - color: theme.colorScheme.surfaceVariant, + color: theme.colorScheme.outlineVariant, strokeWidth: 1.0, ) ..line(color: theme.colorScheme.primary), @@ -637,7 +637,7 @@ void main() { paints // Divider. ..line( - color: theme.colorScheme.surfaceVariant, + color: theme.colorScheme.outlineVariant, strokeWidth: 1.0, ) // Tab indicator. @@ -691,7 +691,7 @@ void main() { paints // Divider. ..line( - color: theme.colorScheme.surfaceVariant, + color: theme.colorScheme.outlineVariant, strokeWidth: 1.0, ) // Tab indicator diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart index 518f36ba7a3ae..71194efaa7758 100644 --- a/packages/flutter/test/material/tabs_test.dart +++ b/packages/flutter/test/material/tabs_test.dart @@ -429,7 +429,7 @@ void main() { await tester.pumpWidget( MaterialApp(theme: theme, home: Material(child: tabBar)), ); - expect(find.byType(TabBar), paints..line(color: material3 ? theme.colorScheme.surfaceVariant : Colors.blue[500])); + expect(find.byType(TabBar), paints..line(color: material3 ? theme.colorScheme.outlineVariant : Colors.blue[500])); }); testWidgets('Tab color - match', (WidgetTester tester) async { @@ -439,7 +439,7 @@ void main() { await tester.pumpWidget( MaterialApp(theme: theme, home: Material(color: const Color(0xff2196f3), child: tabBar)), ); - expect(find.byType(TabBar), paints..line(color: material3 ? theme.colorScheme.surfaceVariant : Colors.white)); + expect(find.byType(TabBar), paints..line(color: material3 ? theme.colorScheme.outlineVariant : Colors.white)); }); testWidgets('Tab color - transparency', (WidgetTester tester) async { @@ -449,7 +449,7 @@ void main() { await tester.pumpWidget( MaterialApp(theme: theme, home: Material(type: MaterialType.transparency, child: tabBar)), ); - expect(find.byType(TabBar), paints..line(color: material3 ? theme.colorScheme.surfaceVariant : Colors.blue[500])); + expect(find.byType(TabBar), paints..line(color: material3 ? theme.colorScheme.outlineVariant : Colors.blue[500])); }); testWidgets('TabBar default selected/unselected label style (primary)', (WidgetTester tester) async { @@ -592,7 +592,7 @@ void main() { paints // Divider ..line( - color: theme.colorScheme.surfaceVariant, + color: theme.colorScheme.outlineVariant, ) // Tab indicator ..line( @@ -626,7 +626,7 @@ void main() { await gesture.down(tester.getCenter(find.text(selectedValue))); await tester.pumpAndSettle(); - expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.primary.withOpacity(0.12))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.primary.withOpacity(0.1))); await gesture.up(); await tester.pumpAndSettle(); @@ -636,7 +636,7 @@ void main() { await gesture.down(tester.getCenter(find.text(selectedValue))); await tester.pumpAndSettle(); - expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.primary.withOpacity(0.12))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.primary.withOpacity(0.1))); await gesture.up(); await tester.pumpAndSettle(); }); @@ -663,7 +663,7 @@ void main() { await gesture.down(tester.getCenter(find.text(selectedValue))); await tester.pumpAndSettle(); - expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSurface.withOpacity(0.12))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSurface.withOpacity(0.1))); await gesture.up(); await tester.pumpAndSettle(); @@ -673,7 +673,7 @@ void main() { await gesture.down(tester.getCenter(find.text(selectedValue))); await tester.pumpAndSettle(); - expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSurface.withOpacity(0.12))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSurface.withOpacity(0.1))); }); testWidgets('TabBar tap selects tab', (WidgetTester tester) async { @@ -4368,7 +4368,7 @@ void main() { await tester.pumpWidget(buildLeftRightApp(themeData: theme, tabs: tabs, value: 'LEFT')); final RenderBox tabBarBox = tester.firstRenderObject(find.byType(TabBar)); expect(tabBarBox, paints..line( - color: material3 ? theme.colorScheme.surfaceVariant : Colors.white, + color: material3 ? theme.colorScheme.outlineVariant : Colors.white, )); }); @@ -4380,7 +4380,7 @@ void main() { await tester.pumpWidget(buildLeftRightApp(themeData: theme, tabs: tabs, value: 'LEFT', automaticIndicatorColorAdjustment: false)); final RenderBox tabBarBox = tester.firstRenderObject(find.byType(TabBar)); expect(tabBarBox, paints..line( - color: material3 ? theme.colorScheme.surfaceVariant : const Color(0xff2196f3), + color: material3 ? theme.colorScheme.outlineVariant : const Color(0xff2196f3), )); }); @@ -6192,14 +6192,14 @@ void main() { inkFeatures, isNot(paints ..rect( - color: theme.colorScheme.onSurface.withOpacity(0.12), + color: theme.colorScheme.onSurface.withOpacity(0.1), )) ); expect( inkFeatures, isNot(paints ..rect( - color: theme.colorScheme.primary.withOpacity(0.12), + color: theme.colorScheme.primary.withOpacity(0.1), )) ); @@ -6210,7 +6210,7 @@ void main() { inkFeatures, paints ..rect( - color: theme.colorScheme.onSurface.withOpacity(0.12), + color: theme.colorScheme.onSurface.withOpacity(0.1), ), ); @@ -6221,7 +6221,7 @@ void main() { inkFeatures, paints ..rect( - color: theme.colorScheme.primary.withOpacity(0.12), + color: theme.colorScheme.primary.withOpacity(0.1), ), ); }); @@ -6241,7 +6241,7 @@ void main() { inkFeatures, isNot(paints ..rect( - color: theme.colorScheme.primary.withOpacity(0.12), + color: theme.colorScheme.primary.withOpacity(0.1), )) ); @@ -6252,7 +6252,7 @@ void main() { inkFeatures, paints ..rect( - color: theme.colorScheme.primary.withOpacity(0.12), + color: theme.colorScheme.primary.withOpacity(0.1), ), ); @@ -6267,7 +6267,7 @@ void main() { inkFeatures, paints ..rect( - color: theme.colorScheme.primary.withOpacity(0.12), + color: theme.colorScheme.primary.withOpacity(0.1), ), ); }); diff --git a/packages/flutter/test/material/text_button_test.dart b/packages/flutter/test/material/text_button_test.dart index 6d7e3e842127c..dad9b2771dcc7 100644 --- a/packages/flutter/test/material/text_button_test.dart +++ b/packages/flutter/test/material/text_button_test.dart @@ -350,7 +350,7 @@ void main() { // Highlighted (pressed). await gesture.down(center); await tester.pumpAndSettle(); - expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.primary.withOpacity(0.12))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.primary.withOpacity(0.1))); // Remove pressed and hovered states await gesture.up(); await tester.pumpAndSettle(); @@ -360,7 +360,7 @@ void main() { // Focused. focusNode.requestFocus(); await tester.pumpAndSettle(); - expect(overlayColor(), paints..rect(color: theme.colorScheme.primary.withOpacity(0.12))); + expect(overlayColor(), paints..rect(color: theme.colorScheme.primary.withOpacity(0.1))); focusNode.dispose(); }); diff --git a/packages/flutter/test/material/text_button_theme_test.dart b/packages/flutter/test/material/text_button_theme_test.dart index c80ee7a82ae97..298febae52220 100644 --- a/packages/flutter/test/material/text_button_theme_test.dart +++ b/packages/flutter/test/material/text_button_theme_test.dart @@ -187,8 +187,8 @@ void main() { expect(material.elevation, elevation); expect(MaterialStateProperty.resolveAs(inkWell.mouseCursor, enabled), enabledMouseCursor); expect(MaterialStateProperty.resolveAs(inkWell.mouseCursor, disabled), disabledMouseCursor); - expect(inkWell.overlayColor!.resolve(hovered), foregroundColor.withOpacity(0.04)); - expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.12)); + expect(inkWell.overlayColor!.resolve(hovered), foregroundColor.withOpacity(0.08)); + expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.1)); expect(inkWell.enableFeedback, enableFeedback); expect(material.borderRadius, null); expect(material.shape, shape); diff --git a/packages/flutter/test/material/theme_data_test.dart b/packages/flutter/test/material/theme_data_test.dart index 7d21bf9841b6a..4b54b4b0f9da4 100644 --- a/packages/flutter/test/material/theme_data_test.dart +++ b/packages/flutter/test/material/theme_data_test.dart @@ -138,34 +138,55 @@ void main() { test('ThemeData can generate a light colorScheme from colorSchemeSeed', () { final ThemeData theme = ThemeData(colorSchemeSeed: Colors.blue); - expect(theme.colorScheme.primary, const Color(0xff0061a4)); + expect(theme.colorScheme.primary, const Color(0xff36618e)); expect(theme.colorScheme.onPrimary, const Color(0xffffffff)); expect(theme.colorScheme.primaryContainer, const Color(0xffd1e4ff)); expect(theme.colorScheme.onPrimaryContainer, const Color(0xff001d36)); + expect(theme.colorScheme.primaryFixed, const Color(0xffd1e4ff)); + expect(theme.colorScheme.primaryFixedDim, const Color(0xffa0cafd)); + expect(theme.colorScheme.onPrimaryFixed, const Color(0xff001d36)); + expect(theme.colorScheme.onPrimaryFixedVariant, const Color(0xff194975)); expect(theme.colorScheme.secondary, const Color(0xff535f70)); expect(theme.colorScheme.onSecondary, const Color(0xffffffff)); expect(theme.colorScheme.secondaryContainer, const Color(0xffd7e3f7)); expect(theme.colorScheme.onSecondaryContainer, const Color(0xff101c2b)); + expect(theme.colorScheme.secondaryFixed, const Color(0xffd7e3f7)); + expect(theme.colorScheme.secondaryFixedDim, const Color(0xffbbc7db)); + expect(theme.colorScheme.onSecondaryFixed, const Color(0xff101c2b)); + expect(theme.colorScheme.onSecondaryFixedVariant, const Color(0xff3b4858)); expect(theme.colorScheme.tertiary, const Color(0xff6b5778)); expect(theme.colorScheme.onTertiary, const Color(0xffffffff)); expect(theme.colorScheme.tertiaryContainer, const Color(0xfff2daff)); expect(theme.colorScheme.onTertiaryContainer, const Color(0xff251431)); + expect(theme.colorScheme.tertiaryFixed, const Color(0xfff2daff)); + expect(theme.colorScheme.tertiaryFixedDim, const Color(0xffd6bee4)); + expect(theme.colorScheme.onTertiaryFixed, const Color(0xff251431)); + expect(theme.colorScheme.onTertiaryFixedVariant, const Color(0xff523f5f)); expect(theme.colorScheme.error, const Color(0xffba1a1a)); expect(theme.colorScheme.onError, const Color(0xffffffff)); expect(theme.colorScheme.errorContainer, const Color(0xffffdad6)); expect(theme.colorScheme.onErrorContainer, const Color(0xff410002)); expect(theme.colorScheme.outline, const Color(0xff73777f)); - expect(theme.colorScheme.background, const Color(0xfffdfcff)); - expect(theme.colorScheme.onBackground, const Color(0xff1a1c1e)); - expect(theme.colorScheme.surface, const Color(0xfffdfcff)); - expect(theme.colorScheme.onSurface, const Color(0xff1a1c1e)); + expect(theme.colorScheme.outlineVariant, const Color(0xffc3c7cf)); + expect(theme.colorScheme.background, const Color(0xfff8f9ff)); + expect(theme.colorScheme.onBackground, const Color(0xff191c20)); + expect(theme.colorScheme.surface, const Color(0xfff8f9ff)); + expect(theme.colorScheme.surfaceBright, const Color(0xfff8f9ff)); + expect(theme.colorScheme.surfaceDim, const Color(0xffd8dae0)); + expect(theme.colorScheme.surfaceContainerLowest, const Color(0xffffffff)); + expect(theme.colorScheme.surfaceContainerLow, const Color(0xfff2f3fa)); + expect(theme.colorScheme.surfaceContainer, const Color(0xffeceef4)); + expect(theme.colorScheme.surfaceContainerHigh, const Color(0xffe6e8ee)); + expect(theme.colorScheme.surfaceContainerHighest, const Color(0xffe1e2e8)); + expect(theme.colorScheme.onSurface, const Color(0xff191c20)); expect(theme.colorScheme.surfaceVariant, const Color(0xffdfe2eb)); expect(theme.colorScheme.onSurfaceVariant, const Color(0xff43474e)); - expect(theme.colorScheme.inverseSurface, const Color(0xff2f3033)); - expect(theme.colorScheme.onInverseSurface, const Color(0xfff1f0f4)); - expect(theme.colorScheme.inversePrimary, const Color(0xff9ecaff)); + expect(theme.colorScheme.inverseSurface, const Color(0xff2e3135)); + expect(theme.colorScheme.onInverseSurface, const Color(0xffeff0f7)); + expect(theme.colorScheme.inversePrimary, const Color(0xffa0cafd)); expect(theme.colorScheme.shadow, const Color(0xff000000)); - expect(theme.colorScheme.surfaceTint, const Color(0xff0061a4)); + expect(theme.colorScheme.scrim, const Color(0xff000000)); + expect(theme.colorScheme.surfaceTint, const Color(0xff36618e)); expect(theme.colorScheme.brightness, Brightness.light); expect(theme.primaryColor, theme.colorScheme.primary); @@ -187,34 +208,55 @@ void main() { brightness: Brightness.dark, ); - expect(theme.colorScheme.primary, const Color(0xff9ecaff)); + expect(theme.colorScheme.primary, const Color(0xffa0cafd)); expect(theme.colorScheme.onPrimary, const Color(0xff003258)); - expect(theme.colorScheme.primaryContainer, const Color(0xff00497d)); + expect(theme.colorScheme.primaryContainer, const Color(0xff194975)); expect(theme.colorScheme.onPrimaryContainer, const Color(0xffd1e4ff)); + expect(theme.colorScheme.primaryFixed, const Color(0xffd1e4ff)); + expect(theme.colorScheme.primaryFixedDim, const Color(0xffa0cafd)); + expect(theme.colorScheme.onPrimaryFixed, const Color(0xff001d36)); + expect(theme.colorScheme.onPrimaryFixedVariant, const Color(0xff194975)); expect(theme.colorScheme.secondary, const Color(0xffbbc7db)); expect(theme.colorScheme.onSecondary, const Color(0xff253140)); expect(theme.colorScheme.secondaryContainer, const Color(0xff3b4858)); expect(theme.colorScheme.onSecondaryContainer, const Color(0xffd7e3f7)); + expect(theme.colorScheme.secondaryFixed, const Color(0xffd7e3f7)); + expect(theme.colorScheme.secondaryFixedDim, const Color(0xffbbc7db)); + expect(theme.colorScheme.onSecondaryFixed, const Color(0xff101c2b)); + expect(theme.colorScheme.onSecondaryFixedVariant, const Color(0xff3b4858)); expect(theme.colorScheme.tertiary, const Color(0xffd6bee4)); expect(theme.colorScheme.onTertiary, const Color(0xff3b2948)); expect(theme.colorScheme.tertiaryContainer, const Color(0xff523f5f)); expect(theme.colorScheme.onTertiaryContainer, const Color(0xfff2daff)); + expect(theme.colorScheme.tertiaryFixed, const Color(0xfff2daff)); + expect(theme.colorScheme.tertiaryFixedDim, const Color(0xffd6bee4)); + expect(theme.colorScheme.onTertiaryFixed, const Color(0xff251431)); + expect(theme.colorScheme.onTertiaryFixedVariant, const Color(0xff523f5f)); expect(theme.colorScheme.error, const Color(0xffffb4ab)); expect(theme.colorScheme.onError, const Color(0xff690005)); expect(theme.colorScheme.errorContainer, const Color(0xff93000a)); - expect(theme.colorScheme.onErrorContainer, const Color(0xffffb4ab)); + expect(theme.colorScheme.onErrorContainer, const Color(0xffffdad6)); expect(theme.colorScheme.outline, const Color(0xff8d9199)); - expect(theme.colorScheme.background, const Color(0xff1a1c1e)); - expect(theme.colorScheme.onBackground, const Color(0xffe2e2e6)); - expect(theme.colorScheme.surface, const Color(0xff1a1c1e)); - expect(theme.colorScheme.onSurface, const Color(0xffe2e2e6)); + expect(theme.colorScheme.outlineVariant, const Color(0xff43474e)); + expect(theme.colorScheme.background, const Color(0xff111418)); + expect(theme.colorScheme.onBackground, const Color(0xffe1e2e8)); + expect(theme.colorScheme.surface, const Color(0xff111418)); + expect(theme.colorScheme.surfaceDim, const Color(0xff111418)); + expect(theme.colorScheme.surfaceBright, const Color(0xff36393e)); + expect(theme.colorScheme.surfaceContainerLowest, const Color(0xff0b0e13)); + expect(theme.colorScheme.surfaceContainerLow, const Color(0xff191c20)); + expect(theme.colorScheme.surfaceContainer, const Color(0xff1d2024)); + expect(theme.colorScheme.surfaceContainerHigh, const Color(0xff272a2f)); + expect(theme.colorScheme.surfaceContainerHighest, const Color(0xff32353a)); + expect(theme.colorScheme.onSurface, const Color(0xffe1e2e8)); expect(theme.colorScheme.surfaceVariant, const Color(0xff43474e)); expect(theme.colorScheme.onSurfaceVariant, const Color(0xffc3c7cf)); - expect(theme.colorScheme.inverseSurface, const Color(0xffe2e2e6)); - expect(theme.colorScheme.onInverseSurface, const Color(0xff2f3033)); - expect(theme.colorScheme.inversePrimary, const Color(0xff0061a4)); + expect(theme.colorScheme.inverseSurface, const Color(0xffe1e2e8)); + expect(theme.colorScheme.onInverseSurface, const Color(0xff2e3135)); + expect(theme.colorScheme.inversePrimary, const Color(0xff36618e)); expect(theme.colorScheme.shadow, const Color(0xff000000)); - expect(theme.colorScheme.surfaceTint, const Color(0xff9ecaff)); + expect(theme.colorScheme.scrim, const Color(0xff000000)); + expect(theme.colorScheme.surfaceTint, const Color(0xffa0cafd)); expect(theme.colorScheme.brightness, Brightness.dark); expect(theme.primaryColor, theme.colorScheme.surface); @@ -233,34 +275,53 @@ void main() { test('ThemeData can generate a default M3 light colorScheme when useMaterial3 is true', () { final ThemeData theme = ThemeData(useMaterial3: true); - expect(theme.colorScheme.primary, const Color(0xFF6750A4)); - expect(theme.colorScheme.onPrimary, const Color(0xFFFFFFFF)); - expect(theme.colorScheme.primaryContainer, const Color(0xFFEADDFF)); - expect(theme.colorScheme.onPrimaryContainer, const Color(0xFF21005D)); - expect(theme.colorScheme.secondary, const Color(0xFF625B71)); - expect(theme.colorScheme.onSecondary, const Color(0xFFFFFFFF)); - expect(theme.colorScheme.secondaryContainer, const Color(0xFFE8DEF8)); - expect(theme.colorScheme.onSecondaryContainer, const Color(0xFF1D192B)); - expect(theme.colorScheme.tertiary, const Color(0xFF7D5260)); - expect(theme.colorScheme.onTertiary, const Color(0xFFFFFFFF)); - expect(theme.colorScheme.tertiaryContainer, const Color(0xFFFFD8E4)); - expect(theme.colorScheme.onTertiaryContainer, const Color(0xFF31111D)); - expect(theme.colorScheme.error, const Color(0xFFB3261E)); - expect(theme.colorScheme.onError, const Color(0xFFFFFFFF)); - expect(theme.colorScheme.errorContainer, const Color(0xFFF9DEDC)); - expect(theme.colorScheme.onErrorContainer, const Color(0xFF410E0B)); - expect(theme.colorScheme.outline, const Color(0xFF79747E)); - expect(theme.colorScheme.background, const Color(0xFFFFFBFE)); - expect(theme.colorScheme.onBackground, const Color(0xFF1C1B1F)); - expect(theme.colorScheme.surface, const Color(0xFFFFFBFE)); - expect(theme.colorScheme.onSurface, const Color(0xFF1C1B1F)); - expect(theme.colorScheme.surfaceVariant, const Color(0xFFE7E0EC)); - expect(theme.colorScheme.onSurfaceVariant, const Color(0xFF49454F)); - expect(theme.colorScheme.inverseSurface, const Color(0xFF313033)); - expect(theme.colorScheme.onInverseSurface, const Color(0xFFF4EFF4)); - expect(theme.colorScheme.inversePrimary, const Color(0xFFD0BCFF)); - expect(theme.colorScheme.shadow, const Color(0xFF000000)); - expect(theme.colorScheme.surfaceTint, const Color(0xFF6750A4)); + expect(theme.colorScheme.primary, const Color(0xff6750a4)); + expect(theme.colorScheme.onPrimary, const Color(0xffffffff)); + expect(theme.colorScheme.primaryContainer, const Color(0xffeaddff)); + expect(theme.colorScheme.onPrimaryContainer, const Color(0xff21005d)); + expect(theme.colorScheme.primaryFixed, const Color(0xffeaddff)); + expect(theme.colorScheme.primaryFixedDim, const Color(0xffd0bcff)); + expect(theme.colorScheme.onPrimaryFixed, const Color(0xff21005d)); + expect(theme.colorScheme.onPrimaryFixedVariant, const Color(0xff4f378b)); + expect(theme.colorScheme.secondary, const Color(0xff625b71)); + expect(theme.colorScheme.onSecondary, const Color(0xffffffff)); + expect(theme.colorScheme.secondaryContainer, const Color(0xffe8def8)); + expect(theme.colorScheme.onSecondaryContainer, const Color(0xff1d192b)); + expect(theme.colorScheme.secondaryFixed, const Color(0xffe8def8)); + expect(theme.colorScheme.secondaryFixedDim, const Color(0xffccc2dc)); + expect(theme.colorScheme.onSecondaryFixed, const Color(0xff1d192b)); + expect(theme.colorScheme.onSecondaryFixedVariant, const Color(0xff4a4458)); + expect(theme.colorScheme.tertiary, const Color(0xff7d5260)); + expect(theme.colorScheme.onTertiary, const Color(0xffffffff)); + expect(theme.colorScheme.tertiaryContainer, const Color(0xffffd8e4)); + expect(theme.colorScheme.onTertiaryContainer, const Color(0xff31111d)); + expect(theme.colorScheme.tertiaryFixed, const Color(0xffffd8e4)); + expect(theme.colorScheme.tertiaryFixedDim, const Color(0xffefb8c8)); + expect(theme.colorScheme.onTertiaryFixed, const Color(0xff31111d)); + expect(theme.colorScheme.onTertiaryFixedVariant, const Color(0xff633b48)); + expect(theme.colorScheme.error, const Color(0xffb3261e)); + expect(theme.colorScheme.onError, const Color(0xffffffff)); + expect(theme.colorScheme.errorContainer, const Color(0xfff9dedc)); + expect(theme.colorScheme.onErrorContainer, const Color(0xff410e0b)); + expect(theme.colorScheme.outline, const Color(0xff79747e)); + expect(theme.colorScheme.background, const Color(0xfffef7ff)); + expect(theme.colorScheme.onBackground, const Color(0xff1d1b20)); + expect(theme.colorScheme.surface, const Color(0xfffef7ff)); + expect(theme.colorScheme.onSurface, const Color(0xff1d1b20)); + expect(theme.colorScheme.surfaceVariant, const Color(0xffe7e0ec)); + expect(theme.colorScheme.onSurfaceVariant, const Color(0xff49454f)); + expect(theme.colorScheme.surfaceBright, const Color(0xfffef7ff)); + expect(theme.colorScheme.surfaceDim, const Color(0xffded8e1)); + expect(theme.colorScheme.surfaceContainer, const Color(0xfff3edf7)); + expect(theme.colorScheme.surfaceContainerHighest, const Color(0xffe6e0e9)); + expect(theme.colorScheme.surfaceContainerHigh, const Color(0xffece6f0)); + expect(theme.colorScheme.surfaceContainerLowest, const Color(0xffffffff)); + expect(theme.colorScheme.surfaceContainerLow, const Color(0xfff7f2fa)); + expect(theme.colorScheme.inverseSurface, const Color(0xff322f35)); + expect(theme.colorScheme.onInverseSurface, const Color(0xfff5eff7)); + expect(theme.colorScheme.inversePrimary, const Color(0xffd0bcff)); + expect(theme.colorScheme.shadow, const Color(0xff000000)); + expect(theme.colorScheme.surfaceTint, const Color(0xff6750a4)); expect(theme.colorScheme.brightness, Brightness.light); expect(theme.primaryColor, theme.colorScheme.primary); @@ -280,34 +341,53 @@ void main() { test('ThemeData.light() can generate a default M3 light colorScheme when useMaterial3 is true', () { final ThemeData theme = ThemeData.light(useMaterial3: true); - expect(theme.colorScheme.primary, const Color(0xFF6750A4)); - expect(theme.colorScheme.onPrimary, const Color(0xFFFFFFFF)); - expect(theme.colorScheme.primaryContainer, const Color(0xFFEADDFF)); - expect(theme.colorScheme.onPrimaryContainer, const Color(0xFF21005D)); - expect(theme.colorScheme.secondary, const Color(0xFF625B71)); - expect(theme.colorScheme.onSecondary, const Color(0xFFFFFFFF)); - expect(theme.colorScheme.secondaryContainer, const Color(0xFFE8DEF8)); - expect(theme.colorScheme.onSecondaryContainer, const Color(0xFF1D192B)); - expect(theme.colorScheme.tertiary, const Color(0xFF7D5260)); - expect(theme.colorScheme.onTertiary, const Color(0xFFFFFFFF)); - expect(theme.colorScheme.tertiaryContainer, const Color(0xFFFFD8E4)); - expect(theme.colorScheme.onTertiaryContainer, const Color(0xFF31111D)); - expect(theme.colorScheme.error, const Color(0xFFB3261E)); - expect(theme.colorScheme.onError, const Color(0xFFFFFFFF)); - expect(theme.colorScheme.errorContainer, const Color(0xFFF9DEDC)); - expect(theme.colorScheme.onErrorContainer, const Color(0xFF410E0B)); - expect(theme.colorScheme.outline, const Color(0xFF79747E)); - expect(theme.colorScheme.background, const Color(0xFFFFFBFE)); - expect(theme.colorScheme.onBackground, const Color(0xFF1C1B1F)); - expect(theme.colorScheme.surface, const Color(0xFFFFFBFE)); - expect(theme.colorScheme.onSurface, const Color(0xFF1C1B1F)); - expect(theme.colorScheme.surfaceVariant, const Color(0xFFE7E0EC)); - expect(theme.colorScheme.onSurfaceVariant, const Color(0xFF49454F)); - expect(theme.colorScheme.inverseSurface, const Color(0xFF313033)); - expect(theme.colorScheme.onInverseSurface, const Color(0xFFF4EFF4)); - expect(theme.colorScheme.inversePrimary, const Color(0xFFD0BCFF)); - expect(theme.colorScheme.shadow, const Color(0xFF000000)); - expect(theme.colorScheme.surfaceTint, const Color(0xFF6750A4)); + expect(theme.colorScheme.primary, const Color(0xff6750a4)); + expect(theme.colorScheme.onPrimary, const Color(0xffffffff)); + expect(theme.colorScheme.primaryContainer, const Color(0xffeaddff)); + expect(theme.colorScheme.onPrimaryContainer, const Color(0xff21005d)); + expect(theme.colorScheme.primaryFixed, const Color(0xffeaddff)); + expect(theme.colorScheme.primaryFixedDim, const Color(0xffd0bcff)); + expect(theme.colorScheme.onPrimaryFixed, const Color(0xff21005d)); + expect(theme.colorScheme.onPrimaryFixedVariant, const Color(0xff4f378b)); + expect(theme.colorScheme.secondary, const Color(0xff625b71)); + expect(theme.colorScheme.onSecondary, const Color(0xffffffff)); + expect(theme.colorScheme.secondaryContainer, const Color(0xffe8def8)); + expect(theme.colorScheme.onSecondaryContainer, const Color(0xff1d192b)); + expect(theme.colorScheme.secondaryFixed, const Color(0xffe8def8)); + expect(theme.colorScheme.secondaryFixedDim, const Color(0xffccc2dc)); + expect(theme.colorScheme.onSecondaryFixed, const Color(0xff1d192b)); + expect(theme.colorScheme.onSecondaryFixedVariant, const Color(0xff4a4458)); + expect(theme.colorScheme.tertiary, const Color(0xff7d5260)); + expect(theme.colorScheme.onTertiary, const Color(0xffffffff)); + expect(theme.colorScheme.tertiaryContainer, const Color(0xffffd8e4)); + expect(theme.colorScheme.onTertiaryContainer, const Color(0xff31111d)); + expect(theme.colorScheme.tertiaryFixed, const Color(0xffffd8e4)); + expect(theme.colorScheme.tertiaryFixedDim, const Color(0xffefb8c8)); + expect(theme.colorScheme.onTertiaryFixed, const Color(0xff31111d)); + expect(theme.colorScheme.onTertiaryFixedVariant, const Color(0xff633b48)); + expect(theme.colorScheme.error, const Color(0xffb3261e)); + expect(theme.colorScheme.onError, const Color(0xffffffff)); + expect(theme.colorScheme.errorContainer, const Color(0xfff9dedc)); + expect(theme.colorScheme.onErrorContainer, const Color(0xff410e0b)); + expect(theme.colorScheme.outline, const Color(0xff79747e)); + expect(theme.colorScheme.background, const Color(0xfffef7ff)); + expect(theme.colorScheme.onBackground, const Color(0xff1d1b20)); + expect(theme.colorScheme.surface, const Color(0xfffef7ff)); + expect(theme.colorScheme.onSurface, const Color(0xff1d1b20)); + expect(theme.colorScheme.surfaceVariant, const Color(0xffe7e0ec)); + expect(theme.colorScheme.onSurfaceVariant, const Color(0xff49454f)); + expect(theme.colorScheme.surfaceBright, const Color(0xfffef7ff)); + expect(theme.colorScheme.surfaceDim, const Color(0xffded8e1)); + expect(theme.colorScheme.surfaceContainer, const Color(0xfff3edf7)); + expect(theme.colorScheme.surfaceContainerHighest, const Color(0xffe6e0e9)); + expect(theme.colorScheme.surfaceContainerHigh, const Color(0xffece6f0)); + expect(theme.colorScheme.surfaceContainerLowest, const Color(0xffffffff)); + expect(theme.colorScheme.surfaceContainerLow, const Color(0xfff7f2fa)); + expect(theme.colorScheme.inverseSurface, const Color(0xff322f35)); + expect(theme.colorScheme.onInverseSurface, const Color(0xfff5eff7)); + expect(theme.colorScheme.inversePrimary, const Color(0xffd0bcff)); + expect(theme.colorScheme.shadow, const Color(0xff000000)); + expect(theme.colorScheme.surfaceTint, const Color(0xff6750a4)); expect(theme.colorScheme.brightness, Brightness.light); expect(theme.primaryColor, theme.colorScheme.primary); @@ -326,35 +406,53 @@ void main() { test('ThemeData.dark() can generate a default M3 dark colorScheme when useMaterial3 is true', () { final ThemeData theme = ThemeData.dark(useMaterial3: true); - - expect(theme.colorScheme.primary, const Color(0xFFD0BCFF)); - expect(theme.colorScheme.onPrimary, const Color(0xFF381E72)); - expect(theme.colorScheme.primaryContainer, const Color(0xFF4F378B)); - expect(theme.colorScheme.onPrimaryContainer, const Color(0xFFEADDFF)); - expect(theme.colorScheme.secondary, const Color(0xFFCCC2DC)); - expect(theme.colorScheme.onSecondary, const Color(0xFF332D41)); - expect(theme.colorScheme.secondaryContainer, const Color(0xFF4A4458)); - expect(theme.colorScheme.onSecondaryContainer, const Color(0xFFE8DEF8)); - expect(theme.colorScheme.tertiary, const Color(0xFFEFB8C8)); - expect(theme.colorScheme.onTertiary, const Color(0xFF492532)); - expect(theme.colorScheme.tertiaryContainer, const Color(0xFF633B48)); - expect(theme.colorScheme.onTertiaryContainer, const Color(0xFFFFD8E4)); - expect(theme.colorScheme.error, const Color(0xFFF2B8B5)); - expect(theme.colorScheme.onError, const Color(0xFF601410)); - expect(theme.colorScheme.errorContainer, const Color(0xFF8C1D18)); - expect(theme.colorScheme.onErrorContainer, const Color(0xFFF9DEDC)); - expect(theme.colorScheme.outline, const Color(0xFF938F99)); - expect(theme.colorScheme.background, const Color(0xFF1C1B1F)); - expect(theme.colorScheme.onBackground, const Color(0xFFE6E1E5)); - expect(theme.colorScheme.surface, const Color(0xFF1C1B1F)); - expect(theme.colorScheme.onSurface, const Color(0xFFE6E1E5)); - expect(theme.colorScheme.surfaceVariant, const Color(0xFF49454F)); - expect(theme.colorScheme.onSurfaceVariant, const Color(0xFFCAC4D0)); - expect(theme.colorScheme.inverseSurface, const Color(0xFFE6E1E5)); - expect(theme.colorScheme.onInverseSurface, const Color(0xFF313033)); - expect(theme.colorScheme.inversePrimary, const Color(0xFF6750A4)); - expect(theme.colorScheme.shadow, const Color(0xFF000000)); - expect(theme.colorScheme.surfaceTint, const Color(0xFFD0BCFF)); + expect(theme.colorScheme.primary, const Color(0xffd0bcff)); + expect(theme.colorScheme.onPrimary, const Color(0xff381e72)); + expect(theme.colorScheme.primaryContainer, const Color(0xff4f378b)); + expect(theme.colorScheme.onPrimaryContainer, const Color(0xffeaddff)); + expect(theme.colorScheme.primaryFixed, const Color(0xffeaddff)); + expect(theme.colorScheme.primaryFixedDim, const Color(0xffd0bcff)); + expect(theme.colorScheme.onPrimaryFixed, const Color(0xff21005d)); + expect(theme.colorScheme.onPrimaryFixedVariant, const Color(0xff4f378b)); + expect(theme.colorScheme.secondary, const Color(0xffccc2dc)); + expect(theme.colorScheme.onSecondary, const Color(0xff332d41)); + expect(theme.colorScheme.secondaryContainer, const Color(0xff4a4458)); + expect(theme.colorScheme.onSecondaryContainer, const Color(0xffe8def8)); + expect(theme.colorScheme.secondaryFixed, const Color(0xffe8def8)); + expect(theme.colorScheme.secondaryFixedDim, const Color(0xffccc2dc)); + expect(theme.colorScheme.onSecondaryFixed, const Color(0xff1d192b)); + expect(theme.colorScheme.onSecondaryFixedVariant, const Color(0xff4a4458)); + expect(theme.colorScheme.tertiary, const Color(0xffefb8c8)); + expect(theme.colorScheme.onTertiary, const Color(0xff492532)); + expect(theme.colorScheme.tertiaryContainer, const Color(0xff633b48)); + expect(theme.colorScheme.onTertiaryContainer, const Color(0xffffd8e4)); + expect(theme.colorScheme.tertiaryFixed, const Color(0xffffd8e4)); + expect(theme.colorScheme.tertiaryFixedDim, const Color(0xffefb8c8)); + expect(theme.colorScheme.onTertiaryFixed, const Color(0xff31111d)); + expect(theme.colorScheme.onTertiaryFixedVariant, const Color(0xff633b48)); + expect(theme.colorScheme.error, const Color(0xfff2b8b5)); + expect(theme.colorScheme.onError, const Color(0xff601410)); + expect(theme.colorScheme.errorContainer, const Color(0xff8c1d18)); + expect(theme.colorScheme.onErrorContainer, const Color(0xfff9dedc)); + expect(theme.colorScheme.outline, const Color(0xff938f99)); + expect(theme.colorScheme.background, const Color(0xff141218)); + expect(theme.colorScheme.onBackground, const Color(0xffe6e0e9)); + expect(theme.colorScheme.surface, const Color(0xff141218)); + expect(theme.colorScheme.onSurface, const Color(0xffe6e0e9)); + expect(theme.colorScheme.surfaceVariant, const Color(0xff49454f)); + expect(theme.colorScheme.onSurfaceVariant, const Color(0xffcac4d0)); + expect(theme.colorScheme.surfaceBright, const Color(0xff3b383e)); + expect(theme.colorScheme.surfaceDim, const Color(0xff141218)); + expect(theme.colorScheme.surfaceContainer, const Color(0xff211f26)); + expect(theme.colorScheme.surfaceContainerHighest, const Color(0xff36343b)); + expect(theme.colorScheme.surfaceContainerHigh, const Color(0xff2b2930)); + expect(theme.colorScheme.surfaceContainerLowest, const Color(0xff0f0d13)); + expect(theme.colorScheme.surfaceContainerLow, const Color(0xff1d1b20)); + expect(theme.colorScheme.inverseSurface, const Color(0xffe6e0e9)); + expect(theme.colorScheme.onInverseSurface, const Color(0xff322f35)); + expect(theme.colorScheme.inversePrimary, const Color(0xff6750a4)); + expect(theme.colorScheme.shadow, const Color(0xff000000)); + expect(theme.colorScheme.surfaceTint, const Color(0xffd0bcff)); expect(theme.colorScheme.brightness, Brightness.dark); expect(theme.primaryColor, theme.colorScheme.surface); diff --git a/packages/flutter/test/material/theme_test.dart b/packages/flutter/test/material/theme_test.dart index d8d71a86c3a45..066f3d467a2bf 100644 --- a/packages/flutter/test/material/theme_test.dart +++ b/packages/flutter/test/material/theme_test.dart @@ -598,7 +598,7 @@ void main() { expect(themeM3.brightness, Brightness.light); expect(themeM3.primaryColor, const Color(0xff6750a4)); - expect(themeM3.scaffoldBackgroundColor, const Color(0xfffffbfe)); // ColorScheme.background + expect(themeM3.scaffoldBackgroundColor, const Color(0xfffef7ff)); // ColorScheme.background expect(themeM3.primaryContrastingColor, Colors.white); expect(themeM3.textTheme.textStyle.fontFamily, 'CupertinoSystemText'); expect(themeM3.textTheme.textStyle.fontSize, 17.0); @@ -621,7 +621,7 @@ void main() { expect(themeM3.brightness, Brightness.dark); expect(themeM3.primaryColor, const Color(0xffd0bcff)); expect(themeM3.primaryContrastingColor, const Color(0xff381e72)); - expect(themeM3.scaffoldBackgroundColor, const Color(0xff1c1b1f)); + expect(themeM3.scaffoldBackgroundColor, const Color(0xff141218)); expect(themeM3.textTheme.textStyle.fontFamily, 'CupertinoSystemText'); expect(themeM3.textTheme.textStyle.fontSize, 17.0); }); diff --git a/packages/flutter/test/material/time_picker_test.dart b/packages/flutter/test/material/time_picker_test.dart index 295e3a8d52923..9a319e22beb0a 100644 --- a/packages/flutter/test/material/time_picker_test.dart +++ b/packages/flutter/test/material/time_picker_test.dart @@ -261,7 +261,7 @@ void main() { expect( dial, paints - ..circle(color: theme.colorScheme.surfaceVariant) // Dial background color. + ..circle(color: theme.colorScheme.surfaceContainerHighest) // Dial background color. ..circle(color: Color(theme.colorScheme.primary.value)), // Dial hand color. ); @@ -284,7 +284,7 @@ void main() { expect( dial, paints - ..circle(color: const Color(0xffff0000)) // Dial background color. + ..circle(color: theme.colorScheme.surfaceContainerHighest) // Dial background color. ..circle(color: Color(theme.colorScheme.primary.value)), // Dial hand color. ); }); diff --git a/packages/flutter/test/material/time_picker_theme_test.dart b/packages/flutter/test/material/time_picker_theme_test.dart index 182ec8079495d..a4098d4d24a74 100644 --- a/packages/flutter/test/material/time_picker_theme_test.dart +++ b/packages/flutter/test/material/time_picker_theme_test.dart @@ -268,7 +268,7 @@ void main() { await tester.pumpAndSettle(const Duration(seconds: 1)); final Material dialogMaterial = _dialogMaterial(tester); - expect(dialogMaterial.color, defaultTheme.colorScheme.surface); + expect(dialogMaterial.color, defaultTheme.colorScheme.surfaceContainerHigh); expect( dialogMaterial.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(28.0))), @@ -278,7 +278,7 @@ void main() { expect( dial, paints - ..circle(color: defaultTheme.colorScheme.surfaceVariant) // Dial background color. + ..circle(color: defaultTheme.colorScheme.surfaceContainerHighest) // Dial background color. ..circle(color: Color(defaultTheme.colorScheme.primary.value)), // Dial hand color. ); @@ -372,7 +372,7 @@ void main() { ); final Material minuteMaterial = _textMaterial(tester, '15'); - expect(minuteMaterial.color, defaultTheme.colorScheme.surfaceVariant); + expect(minuteMaterial.color, defaultTheme.colorScheme.surfaceContainerHighest); expect( minuteMaterial.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(8.0))), @@ -481,7 +481,7 @@ void main() { final InputDecoration hourDecoration = _textField(tester, '7').decoration!; expect(hourDecoration.filled, true); - expect(hourDecoration.fillColor, defaultTheme.colorScheme.surfaceVariant); + expect(hourDecoration.fillColor, defaultTheme.colorScheme.surfaceContainerHighest); expect( hourDecoration.enabledBorder, const OutlineInputBorder( @@ -666,7 +666,7 @@ void main() { Typography.material2021().englishLike.bodyMedium! .merge(Typography.material2021().black.bodyMedium) .merge(timePickerTheme.hourMinuteTextStyle) - .copyWith(color: _selectedColor, decorationColor: const Color(0xff1c1b1f)), + .copyWith(color: _selectedColor, decorationColor: const Color(0xff1d1b20)), ); final RenderParagraph minuteText = _textRenderParagraph(tester, '15'); @@ -675,7 +675,7 @@ void main() { Typography.material2021().englishLike.bodyMedium! .merge(Typography.material2021().black.bodyMedium) .merge(timePickerTheme.hourMinuteTextStyle) - .copyWith(color: _unselectedColor, decorationColor: const Color(0xff1c1b1f)), + .copyWith(color: _unselectedColor, decorationColor: const Color(0xff1d1b20)), ); final RenderParagraph amText = _textRenderParagraph(tester, 'AM'); @@ -684,7 +684,7 @@ void main() { Typography.material2021().englishLike.bodyMedium! .merge(Typography.material2021().black.bodyMedium) .merge(timePickerTheme.hourMinuteTextStyle) - .copyWith(color: _selectedColor, decorationColor: const Color(0xff1c1b1f)), + .copyWith(color: _selectedColor, decorationColor: const Color(0xff1d1b20)), ); final RenderParagraph pmText = _textRenderParagraph(tester, 'PM'); @@ -693,7 +693,7 @@ void main() { Typography.material2021().englishLike.bodyMedium! .merge(Typography.material2021().black.bodyMedium) .merge(timePickerTheme.hourMinuteTextStyle) - .copyWith(color: _unselectedColor, decorationColor: const Color(0xff1c1b1f)), + .copyWith(color: _unselectedColor, decorationColor: const Color(0xff1d1b20)), ); final RenderParagraph helperText = _textRenderParagraph(tester, 'Select time'); diff --git a/packages/flutter/test_fixes/material/color_scheme.dart b/packages/flutter/test_fixes/material/color_scheme.dart index 877d09d9b939f..6eac3918adbcf 100644 --- a/packages/flutter/test_fixes/material/color_scheme.dart +++ b/packages/flutter/test_fixes/material/color_scheme.dart @@ -15,4 +15,22 @@ void main() { colorScheme = colorScheme.copyWith(primaryVariant: Colors.black, secondaryVariant: Colors.white); colorScheme.primaryVariant; // Removing field reference not supported. colorScheme.secondaryVariant; + + // Changes made in https://github.com/flutter/flutter/pull/138521 + ColorScheme colorScheme = ColorScheme(); + colorScheme = ColorScheme(background: Colors.black, onBackground: Colors.white, surfaceVariant: Colors.red); + colorScheme = ColorScheme(background: Colors.black, surface: Colors.orange, onBackground: Colors.white, onSurface: Colors.yellow, surfaceVariant: Colors.red, surfaceContainerHighest: Colors.blue); + colorScheme = ColorScheme.light(background: Colors.black, onBackground: Colors.white, surfaceVariant: Colors.red); + colorScheme = ColorScheme.light(background: Colors.black, surface: Colors.orange, onBackground: Colors.white, onSurface: Colors.yellow, surfaceVariant: Colors.red, surfaceContainerHighest: Colors.blue); + colorScheme = ColorScheme.dark(background: Colors.black, onBackground: Colors.white, surfaceVariant: Colors.red); + colorScheme = ColorScheme.dark(background: Colors.black, surface: Colors.orange, onBackground: Colors.white, onSurface: Colors.yellow, surfaceVariant: Colors.red, surfaceContainerHighest: Colors.blue); + colorScheme = ColorScheme.highContrastLight(background: Colors.black, onBackground: Colors.white, surfaceVariant: Colors.red); + colorScheme = ColorScheme.highContrastLight(background: Colors.black, surface: Colors.orange, onBackground: Colors.white, onSurface: Colors.yellow, surfaceVariant: Colors.red, surfaceContainerHighest: Colors.blue); + colorScheme = ColorScheme.highContrastDark(background: Colors.black, onBackground: Colors.white, surfaceVariant: Colors.red); + colorScheme = ColorScheme.highContrastDark(background: Colors.black, surface: Colors.orange, onBackground: Colors.white, onSurface: Colors.yellow, surfaceVariant: Colors.red, surfaceContainerHighest: Colors.blue); + colorScheme = colorScheme.copyWith(background: Colors.black, onBackground: Colors.white, surfaceVariant: Colors.red); + colorScheme = colorScheme.copyWith(background: Colors.black, surface: Colors.orange, onBackground: Colors.white, onSurface: Colors.yellow, surfaceVariant: Colors.red, surfaceContainerHighest: Colors.blue); + colorScheme.background; + colorScheme.onBackground; + colorScheme.surfaceVariant; } diff --git a/packages/flutter/test_fixes/material/color_scheme.dart.expect b/packages/flutter/test_fixes/material/color_scheme.dart.expect index b270083dfbec7..dc73ce0692cbf 100644 --- a/packages/flutter/test_fixes/material/color_scheme.dart.expect +++ b/packages/flutter/test_fixes/material/color_scheme.dart.expect @@ -15,4 +15,22 @@ void main() { colorScheme = colorScheme.copyWith(); colorScheme.primaryContainer; // Removing field reference not supported. colorScheme.secondaryContainer; + + // Changes made in https://github.com/flutter/flutter/pull/138521 + ColorScheme colorScheme = ColorScheme(); + colorScheme = ColorScheme(surface: Colors.black, onSurface: Colors.white, surfaceContainerHighest: Colors.red); + colorScheme = ColorScheme(surface: Colors.orange, onSurface: Colors.yellow, surfaceContainerHighest: Colors.blue); + colorScheme = ColorScheme.light(surface: Colors.black, onSurface: Colors.white, surfaceContainerHighest: Colors.red); + colorScheme = ColorScheme.light(surface: Colors.orange, onSurface: Colors.yellow, surfaceContainerHighest: Colors.blue); + colorScheme = ColorScheme.dark(surface: Colors.black, onSurface: Colors.white, surfaceContainerHighest: Colors.red); + colorScheme = ColorScheme.dark(surface: Colors.orange, onSurface: Colors.yellow, surfaceContainerHighest: Colors.blue); + colorScheme = ColorScheme.highContrastLight(surface: Colors.black, onSurface: Colors.white, surfaceContainerHighest: Colors.red); + colorScheme = ColorScheme.highContrastLight(surface: Colors.orange, onSurface: Colors.yellow, surfaceContainerHighest: Colors.blue); + colorScheme = ColorScheme.highContrastDark(surface: Colors.black, onSurface: Colors.white, surfaceContainerHighest: Colors.red); + colorScheme = ColorScheme.highContrastDark(surface: Colors.orange, onSurface: Colors.yellow, surfaceContainerHighest: Colors.blue); + colorScheme = colorScheme.copyWith(surface: Colors.black, onSurface: Colors.white, surfaceContainerHighest: Colors.red); + colorScheme = colorScheme.copyWith(surface: Colors.orange, onSurface: Colors.yellow, surfaceContainerHighest: Colors.blue); + colorScheme.surface; + colorScheme.onSurface; + colorScheme.surfaceContainerHighest; } diff --git a/packages/flutter/test_fixes/material/theme_data.dart.expect b/packages/flutter/test_fixes/material/theme_data.dart.expect index 9430d934e38f6..e21ac79faf8e7 100644 --- a/packages/flutter/test_fixes/material/theme_data.dart.expect +++ b/packages/flutter/test_fixes/material/theme_data.dart.expect @@ -412,28 +412,28 @@ void main() { // Changes made in https://github.com/flutter/flutter/pull/110162 ThemeData themeData = ThemeData(); - themeData = ThemeData(colorScheme: ColorScheme(background: Colors.grey)); - themeData = ThemeData(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(background: Colors.grey)); - themeData = ThemeData(colorScheme: ColorScheme.light().copyWith(background: Colors.grey)); - themeData = ThemeData(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, background: Colors.grey)); + themeData = ThemeData(colorScheme: ColorScheme(surface: Colors.grey)); + themeData = ThemeData(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(surface: Colors.grey)); + themeData = ThemeData(colorScheme: ColorScheme.light().copyWith(surface: Colors.grey)); + themeData = ThemeData(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, surface: Colors.grey)); themeData = ThemeData(otherParam: ''); - themeData = ThemeData.raw(colorScheme: ColorScheme(background: Colors.grey)); - themeData = ThemeData.raw(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(background: Colors.grey)); - themeData = ThemeData.raw(colorScheme: ColorScheme.light().copyWith(background: Colors.grey)); - themeData = ThemeData.raw(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, background: Colors.grey)); + themeData = ThemeData.raw(colorScheme: ColorScheme(surface: Colors.grey)); + themeData = ThemeData.raw(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(surface: Colors.grey)); + themeData = ThemeData.raw(colorScheme: ColorScheme.light().copyWith(surface: Colors.grey)); + themeData = ThemeData.raw(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, surface: Colors.grey)); themeData = ThemeData.raw(otherParam: ''); - themeData = themeData.copyWith(colorScheme: ColorScheme(background: Colors.grey)); + themeData = themeData.copyWith(colorScheme: ColorScheme(surface: Colors.grey)); themeData = themeData.copyWith(otherParam: ''); - themeData = themeData.copyWith(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(background: Colors.grey)); - themeData = themeData.copyWith(colorScheme: ColorScheme.light().copyWith(background: Colors.grey)); - themeData = themeData.copyWith(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, background: Colors.grey)); - themeData.colorScheme.background; + themeData = themeData.copyWith(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(surface: Colors.grey)); + themeData = themeData.copyWith(colorScheme: ColorScheme.light().copyWith(surface: Colors.grey)); + themeData = themeData.copyWith(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, surface: Colors.grey)); + themeData.colorScheme.surface; // Changes made in https://github.com/flutter/flutter/pull/110162 ThemeData themeData = ThemeData(); - themeData = ThemeData(colorScheme: ColorScheme(background: Colors.grey).copyWith(error: Colors.red)); - themeData = ThemeData.raw(colorScheme: ColorScheme(background: Colors.grey).copyWith(error: Colors.red)); - themeData = themeData.copyWith(colorScheme: ColorScheme(background: Colors.grey).copyWith(error: Colors.red)); + themeData = ThemeData(colorScheme: ColorScheme(surface: Colors.grey).copyWith(error: Colors.red)); + themeData = ThemeData.raw(colorScheme: ColorScheme(surface: Colors.grey).copyWith(error: Colors.red)); + themeData = themeData.copyWith(colorScheme: ColorScheme(surface: Colors.grey).copyWith(error: Colors.red)); // Changes made in https://github.com/flutter/flutter/pull/111080 ThemeData themeData = ThemeData(); diff --git a/packages/flutter_test/test/accessibility_test.dart b/packages/flutter_test/test/accessibility_test.dart index 2bf455c290f8c..6f58d05144d08 100644 --- a/packages/flutter_test/test/accessibility_test.dart +++ b/packages/flutter_test/test/accessibility_test.dart @@ -330,10 +330,10 @@ void main() { result.reason, 'SemanticsNode#4(Rect.fromLTRB(300.0, 200.0, 500.0, 400.0), ' 'label: "this is a test", textDirection: ltr):\n' - 'Expected contrast ratio of at least 4.5 but found 1.19 for a font ' + 'Expected contrast ratio of at least 4.5 but found 1.16 for a font ' 'size of 14.0.\n' 'The computed colors was:\n' - 'light - Color(0xfffffbfe), dark - Color(0xffffeb3b)\n' + 'light - Color(0xfffef7ff), dark - Color(0xffffeb3b)\n' 'See also: https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html', ); handle.dispose();