diff --git a/dev/benchmarks/macrobenchmarks/lib/src/web/material3.dart b/dev/benchmarks/macrobenchmarks/lib/src/web/material3.dart index 728fdf8bb99..58ad3706076 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.surfaceContainerHighest, + color: Theme.of(context).colorScheme.surfaceVariant, 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.surfaceContainerHighest, + backgroundColor: selected ? colors.primary : colors.surfaceVariant, 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.surfaceContainerHighest, + selected ? colors.secondaryContainer : colors.surfaceVariant, 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.surfaceContainerHighest.withOpacity(0.3), + color: Theme.of(context).colorScheme.surfaceVariant.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 58adcb570de..239526c1c66 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.surface, + color: themeData.colorScheme.background, 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 ba561bc955c..19188dc2444 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.surface).value; + final double themeValue = HSVColor.fromColor(theme.colorScheme.background).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 c825b0ba3e1..0b4ff755f49 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/shrine/app.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/shrine/app.dart @@ -114,10 +114,12 @@ 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 2c0e475a4c9..dbaefed98cb 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), - surface: const Color(0xFF202124), + background: 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 06ca3ef7078..471707bd88f 100644 --- a/dev/tools/gen_defaults/data/badge.json +++ b/dev/tools/gen_defaults/data/badge.json @@ -1,5 +1,5 @@ { - "version": "v0_206", + "version": "v0_162", "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 34077c6eae8..728016c2954 100644 --- a/dev/tools/gen_defaults/data/banner.json +++ b/dev/tools/gen_defaults/data/banner.json @@ -1,9 +1,10 @@ { - "version": "v0_206", + "version": "v0_162", - "md.comp.banner.container.color": "surfaceContainerLow", + "md.comp.banner.container.color": "surface", "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 7270ab747e9..1d515d3db2f 100644 --- a/dev/tools/gen_defaults/data/bottom_app_bar.json +++ b/dev/tools/gen_defaults/data/bottom_app_bar.json @@ -1,8 +1,9 @@ { - "version": "v0_206", + "version": "v0_162", - "md.comp.bottom-app-bar.container.color": "surfaceContainer", + "md.comp.bottom-app-bar.container.color": "surface", "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.shape": "md.sys.shape.corner.none", + "md.comp.bottom-app-bar.container.surface-tint-layer.color": "surfaceTint" } diff --git a/dev/tools/gen_defaults/data/button_elevated.json b/dev/tools/gen_defaults/data/button_elevated.json index 88a9708a9fc..abac9705387 100644 --- a/dev/tools/gen_defaults/data/button_elevated.json +++ b/dev/tools/gen_defaults/data/button_elevated.json @@ -1,20 +1,18 @@ { - "version": "v0_206", + "version": "v0_162", - "md.comp.elevated-button.container.color": "surfaceContainerLow", + "md.comp.elevated-button.container.color": "surface", "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 b0e5b01d4d2..3720b261989 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_206", + "version": "v0_162", "md.comp.filled-button.container.color": "primary", "md.comp.filled-button.container.elevation": "md.sys.elevation.level0", @@ -12,9 +12,6 @@ "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 a084860e3ee..badbe27aa33 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_206", + "version": "v0_162", "md.comp.filled-tonal-button.container.color": "secondaryContainer", "md.comp.filled-tonal-button.container.elevation": "md.sys.elevation.level0", @@ -12,9 +12,6 @@ "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 ffe6b2b05e3..897b0aaea1d 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_206", + "version": "v0_162", "md.comp.outlined-button.container.height": 40.0, "md.comp.outlined-button.container.shape": "md.sys.shape.corner.full", @@ -7,9 +7,6 @@ "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 24d527cb372..4d05e244625 100644 --- a/dev/tools/gen_defaults/data/button_text.json +++ b/dev/tools/gen_defaults/data/button_text.json @@ -1,13 +1,10 @@ { - "version": "v0_206", + "version": "v0_162", "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 7178e188ddf..7d071f21f10 100644 --- a/dev/tools/gen_defaults/data/card_elevated.json +++ b/dev/tools/gen_defaults/data/card_elevated.json @@ -1,10 +1,11 @@ { - "version": "v0_206", + "version": "v0_162", - "md.comp.elevated-card.container.color": "surfaceContainerLow", + "md.comp.elevated-card.container.color": "surface", "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, @@ -12,9 +13,6 @@ "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 aaba4abc25b..aac015e44eb 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_206", + "version": "v0_162", - "md.comp.filled-card.container.color": "surfaceContainerHighest", + "md.comp.filled-card.container.color": "surfaceVariant", "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,9 +12,6 @@ "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 e257d4759d1..8e895966ef7 100644 --- a/dev/tools/gen_defaults/data/card_outlined.json +++ b/dev/tools/gen_defaults/data/card_outlined.json @@ -1,10 +1,11 @@ { - "version": "v0_206", + "version": "v0_162", "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, @@ -13,9 +14,6 @@ "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 397356ee7ae..0339df413ac 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_206", + "version": "v0_202", "md.comp.carousel-item.container.color": "surface", "md.comp.carousel-item.container.elevation": "md.sys.elevation.level0", @@ -9,9 +9,6 @@ "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 a6432de2fc7..365abdc3eba 100644 --- a/dev/tools/gen_defaults/data/checkbox.json +++ b/dev/tools/gen_defaults/data/checkbox.json @@ -1,5 +1,5 @@ { - "version": "v0_206", + "version": "v0_162", "md.comp.checkbox.container.size": 18.0, "md.comp.checkbox.error.focus.state-layer.color": "error", @@ -8,9 +8,6 @@ "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 b8ecc620f94..25f18ea8fb0 100644 --- a/dev/tools/gen_defaults/data/chip_assist.json +++ b/dev/tools/gen_defaults/data/chip_assist.json @@ -1,15 +1,16 @@ { - "version": "v0_206", + "version": "v0_162", "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": "surfaceContainerLow", + "md.comp.assist-chip.elevated.container.color": "surface", "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", @@ -24,9 +25,6 @@ "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 7d351069ee8..094f037e88f 100644 --- a/dev/tools/gen_defaults/data/chip_filter.json +++ b/dev/tools/gen_defaults/data/chip_filter.json @@ -1,8 +1,9 @@ { - "version": "v0_206", + "version": "v0_162", "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", @@ -15,7 +16,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": "surfaceContainerLow", + "md.comp.filter-chip.elevated.unselected.container.color": "surface", "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, @@ -32,9 +33,6 @@ "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 80b42b47dd3..260cab06a69 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_206", + "version": "v0_162", "md.comp.input-chip.container.elevation": "md.sys.elevation.level0", "md.comp.input-chip.container.height": 32.0, @@ -11,9 +11,6 @@ "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 e9c1ecb1395..baac7a41a33 100644 --- a/dev/tools/gen_defaults/data/chip_suggestion.json +++ b/dev/tools/gen_defaults/data/chip_suggestion.json @@ -1,15 +1,16 @@ { - "version": "v0_206", + "version": "v0_162", "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": "surfaceContainerLow", + "md.comp.suggestion-chip.elevated.container.color": "surface", "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", @@ -24,9 +25,6 @@ "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 bed87ae9cb4..e36a9ccceec 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_206", + "version": "v0_162", - "md.sys.color.background": "md.ref.palette.neutral6", + "md.sys.color.background": "md.ref.palette.neutral10", "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.neutral6", + "md.sys.color.surface": "md.ref.palette.neutral10", "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 5ca7bdcb2a2..fd7be56a13a 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_206", + "version": "v0_162", - "md.sys.color.background": "md.ref.palette.neutral98", + "md.sys.color.background": "md.ref.palette.neutral99", "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.neutral98", + "md.sys.color.surface": "md.ref.palette.neutral99", "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 a8812e75876..4ab28db36c1 100644 --- a/dev/tools/gen_defaults/data/date_picker_docked.json +++ b/dev/tools/gen_defaults/data/date_picker_docked.json @@ -1,10 +1,11 @@ { - "version": "v0_206", + "version": "v0_162", - "md.comp.date-picker.docked.container.color": "surfaceContainerHigh", + "md.comp.date-picker.docked.container.color": "surface", "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 96c9bf21fec..b6f0faec505 100644 --- a/dev/tools/gen_defaults/data/date_picker_input_modal.json +++ b/dev/tools/gen_defaults/data/date_picker_input_modal.json @@ -1,10 +1,11 @@ { - "version": "v0_206", + "version": "v0_162", - "md.comp.date-input.modal.container.color": "surfaceContainerHigh", + "md.comp.date-input.modal.container.color": "surface", "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 259bd8fad33..84a3ffae84f 100644 --- a/dev/tools/gen_defaults/data/date_picker_modal.json +++ b/dev/tools/gen_defaults/data/date_picker_modal.json @@ -1,10 +1,11 @@ { - "version": "v0_206", + "version": "v0_162", - "md.comp.date-picker.modal.container.color": "surfaceContainerHigh", + "md.comp.date-picker.modal.container.color": "surface", "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 579f2b53798..6fe28cbc6b7 100644 --- a/dev/tools/gen_defaults/data/dialog.json +++ b/dev/tools/gen_defaults/data/dialog.json @@ -1,5 +1,5 @@ { - "version": "v0_206", + "version": "v0_162", "md.comp.dialog.action.focus.label-text.color": "primary", "md.comp.dialog.action.focus.state-layer.color": "primary", @@ -12,9 +12,10 @@ "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": "surfaceContainerHigh", + "md.comp.dialog.container.color": "surface", "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 66d898d7571..9eb61d42066 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_206", + "version": "v0_162", "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 58fc1391465..2f8c946d6a5 100644 --- a/dev/tools/gen_defaults/data/divider.json +++ b/dev/tools/gen_defaults/data/divider.json @@ -1,5 +1,5 @@ { - "version": "v0_206", + "version": "v0_162", "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 365b6a18e76..f1f2939e66f 100644 --- a/dev/tools/gen_defaults/data/elevation.json +++ b/dev/tools/gen_defaults/data/elevation.json @@ -1,5 +1,5 @@ { - "version": "v0_206", + "version": "v0_162", "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 3214de76206..39855aab83a 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_206", + "version": "v0_162", "md.comp.extended-fab.primary.container.color": "primaryContainer", "md.comp.extended-fab.primary.container.elevation": "md.sys.elevation.level3", @@ -8,9 +8,6 @@ "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 aadbb96d1d4..e0c71251b10 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_206", + "version": "v0_162", "md.comp.fab.primary.large.container.color": "primaryContainer", "md.comp.fab.primary.large.container.elevation": "md.sys.elevation.level3", @@ -9,9 +9,6 @@ "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 82da7e3b76d..f5e3d5adb87 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_206", + "version": "v0_162", "md.comp.fab.primary.container.color": "primaryContainer", "md.comp.fab.primary.container.elevation": "md.sys.elevation.level3", @@ -9,9 +9,6 @@ "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 03aa08f2ff8..bde0cd640ba 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_206", + "version": "v0_162", "md.comp.fab.primary.small.container.color": "primaryContainer", "md.comp.fab.primary.small.container.elevation": "md.sys.elevation.level3", @@ -9,9 +9,6 @@ "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 187f534a32e..be7678825ad 100644 --- a/dev/tools/gen_defaults/data/icon_button.json +++ b/dev/tools/gen_defaults/data/icon_button.json @@ -1,11 +1,8 @@ { - "version": "v0_206", + "version": "v0_162", "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", @@ -17,9 +14,8 @@ "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.width": 40.0, + "md.comp.icon-button.state-layer.size": 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 8d827d75923..eebf003b0fd 100644 --- a/dev/tools/gen_defaults/data/icon_button_filled.json +++ b/dev/tools/gen_defaults/data/icon_button_filled.json @@ -1,18 +1,14 @@ { - "version": "v0_206", + "version": "v0_162", "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.width": 40.0, + "md.comp.filled-icon-button.container.size": 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", @@ -38,5 +34,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": "surfaceContainerHighest" + "md.comp.filled-icon-button.unselected.container.color": "surfaceVariant" } 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 9b02d06135d..8d61d263cb7 100644 --- a/dev/tools/gen_defaults/data/icon_button_filled_tonal.json +++ b/dev/tools/gen_defaults/data/icon_button_filled_tonal.json @@ -1,18 +1,14 @@ { - "version": "v0_206", + "version": "v0_162", "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.width": 40.0, + "md.comp.filled-tonal-icon-button.container.size": 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", @@ -38,5 +34,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": "surfaceContainerHighest" + "md.comp.filled-tonal-icon-button.unselected.container.color": "surfaceVariant" } diff --git a/dev/tools/gen_defaults/data/icon_button_outlined.json b/dev/tools/gen_defaults/data/icon_button_outlined.json index 2edf60d22e5..7c0106684a2 100644 --- a/dev/tools/gen_defaults/data/icon_button_outlined.json +++ b/dev/tools/gen_defaults/data/icon_button_outlined.json @@ -1,18 +1,14 @@ { - "version": "v0_206", + "version": "v0_162", - "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.width": 40.0, + "md.comp.outlined-icon-button.container.size": 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 442b203d521..a557a2da27d 100644 --- a/dev/tools/gen_defaults/data/list.json +++ b/dev/tools/gen_defaults/data/list.json @@ -1,11 +1,6 @@ { - "version": "v0_206", + "version": "v0_162", - "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", @@ -42,11 +37,10 @@ "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": 24.0, + "md.comp.list.list-item.leading-icon.size": 18.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, @@ -64,7 +58,6 @@ "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 76cb65cd0e8..97915454770 100644 --- a/dev/tools/gen_defaults/data/menu.json +++ b/dev/tools/gen_defaults/data/menu.json @@ -1,15 +1,10 @@ { - "version": "v0_206", + "version": "v0_162", - "md.comp.menu.container.color": "surfaceContainer", + "md.comp.menu.container.color": "surface", "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.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" + "md.comp.menu.container.surface-tint-layer.color": "surfaceTint", + "md.comp.menu.list-item.selected.container.color": "surfaceVariant" } diff --git a/dev/tools/gen_defaults/data/motion.json b/dev/tools/gen_defaults/data/motion.json index 4b708de7ea4..90c1fab6ad1 100644 --- a/dev/tools/gen_defaults/data/motion.json +++ b/dev/tools/gen_defaults/data/motion.json @@ -1,5 +1,5 @@ { - "version": "v0_206", + "version": "v0_162", "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 7803d9fdf4b..c972fba4ca5 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_206", + "version": "v0_162", "md.comp.navigation-bar.active.focus.icon.color": "onSecondaryContainer", "md.comp.navigation-bar.active.focus.label-text.color": "onSurface", @@ -16,13 +16,11 @@ "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": "surfaceContainer", + "md.comp.navigation-bar.container.color": "surface", "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.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.container.surface-tint-layer.color": "surfaceTint", "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 6eda37d009d..c33b58d8d47 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_206", + "version": "v0_162", "md.comp.navigation-drawer.active.focus.icon.color": "onSecondaryContainer", "md.comp.navigation-drawer.active.focus.label-text.color": "onSecondaryContainer", @@ -17,12 +17,11 @@ "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", @@ -42,9 +41,7 @@ "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 f58bd1ae5bb..23c164b5791 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_206", + "version": "v0_162", "md.comp.navigation-rail.active.focus.icon.color": "onSecondaryContainer", "md.comp.navigation-rail.active.focus.label-text.color": "onSurface", @@ -35,6 +35,17 @@ "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 d3873d17738..3dc16c3df1a 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_206", + "version": "v0_162", "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,9 +13,8 @@ "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.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.divider.color": "surfaceVariant", + "md.comp.primary-navigation-tab.divider.height": 1.0, "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 3b172c57285..ab773d1cee4 100644 --- a/dev/tools/gen_defaults/data/navigation_tab_secondary.json +++ b/dev/tools/gen_defaults/data/navigation_tab_secondary.json @@ -1,17 +1,14 @@ { - "version": "v0_206", + "version": "v0_162", - "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.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.divider.color": "surfaceVariant", + "md.comp.secondary-navigation-tab.divider.height": 1.0, "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 89fe3ef8ad3..fbdddbf3a10 100644 --- a/dev/tools/gen_defaults/data/palette.json +++ b/dev/tools/gen_defaults/data/palette.json @@ -1,5 +1,5 @@ { - "version": "v0_206", + "version": "v0_162", "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": "0xFF1D1B20", + "md.ref.palette.neutral10": "0xFF1C1B1F", "md.ref.palette.neutral100": "0xFFFFFFFF", - "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.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.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 8af3fbfc9f8..0a78f60ad4f 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_206", + "version": "v0_162", "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 1f80069d475..47aaa9b06f6 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_206", + "version": "v0_162", "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": "surfaceContainerHighest", + "md.comp.linear-progress-indicator.track.color": "surfaceVariant", "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 df8cafa024d..b42e6962069 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_206", + "version": "v0_162", "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 f329a9c1f41..8c3ba0c1d38 100644 --- a/dev/tools/gen_defaults/data/search_bar.json +++ b/dev/tools/gen_defaults/data/search_bar.json @@ -1,15 +1,13 @@ { - "version": "v0_206", + "version": "v0_158", "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": "surfaceContainerHigh", + "md.comp.search-bar.container.color": "surface", "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.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.container.surface-tint-layer.color": "surfaceTint", "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 a53dd32debf..506f5a2a15a 100644 --- a/dev/tools/gen_defaults/data/search_view.json +++ b/dev/tools/gen_defaults/data/search_view.json @@ -1,8 +1,9 @@ { - "version": "v0_206", + "version": "v0_158", - "md.comp.search-view.container.color": "surfaceContainerHigh", + "md.comp.search-view.container.color": "surface", "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 8d3488bac59..b5aed0515a9 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_206", + "version": "v0_162", "md.comp.outlined-segmented-button.container.height": 40.0, "md.comp.outlined-segmented-button.disabled.icon.color": "onSurface", @@ -8,9 +8,6 @@ "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 0176c0b06a5..988cd5be1dc 100644 --- a/dev/tools/gen_defaults/data/shape.json +++ b/dev/tools/gen_defaults/data/shape.json @@ -1,5 +1,5 @@ { - "version": "v0_206", + "version": "v0_162", "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 e137916a0e0..53e4c227e12 100644 --- a/dev/tools/gen_defaults/data/sheet_bottom.json +++ b/dev/tools/gen_defaults/data/sheet_bottom.json @@ -1,15 +1,14 @@ { - "version": "v0_206", + "version": "v0_162", - "md.comp.sheet.bottom.docked.container.color": "surfaceContainerLow", + "md.comp.sheet.bottom.docked.container.color": "surface", "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.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" + "md.comp.sheet.bottom.docked.standard.container.elevation": "md.sys.elevation.level1" } diff --git a/dev/tools/gen_defaults/data/slider.json b/dev/tools/gen_defaults/data/slider.json index 9dfda742b14..f7d7579e273 100644 --- a/dev/tools/gen_defaults/data/slider.json +++ b/dev/tools/gen_defaults/data/slider.json @@ -1,5 +1,5 @@ { - "version": "v0_206", + "version": "v0_162", "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": "surfaceContainerHighest", + "md.comp.slider.inactive.track.color": "surfaceVariant", "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 e2cfbd2be40..79e059815bf 100644 --- a/dev/tools/gen_defaults/data/snackbar.json +++ b/dev/tools/gen_defaults/data/snackbar.json @@ -1,5 +1,5 @@ { - "version": "v0_206", + "version": "v0_162", "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 6556e10b772..e7bb1ce8063 100644 --- a/dev/tools/gen_defaults/data/state.json +++ b/dev/tools/gen_defaults/data/state.json @@ -1,8 +1,8 @@ { - "version": "v0_206", + "version": "v0_162", "md.sys.state.dragged.state-layer-opacity": 0.16, - "md.sys.state.focus.state-layer-opacity": 0.1, + "md.sys.state.focus.state-layer-opacity": 0.12, "md.sys.state.hover.state-layer-opacity": 0.08, - "md.sys.state.pressed.state-layer-opacity": 0.1 + "md.sys.state.pressed.state-layer-opacity": 0.12 } diff --git a/dev/tools/gen_defaults/data/switch.json b/dev/tools/gen_defaults/data/switch.json index dd45bed57c8..c8c5b511065 100644 --- a/dev/tools/gen_defaults/data/switch.json +++ b/dev/tools/gen_defaults/data/switch.json @@ -1,5 +1,5 @@ { - "version": "v0_206", + "version": "v0_162", "md.comp.switch.disabled.selected.handle.color": "surface", "md.comp.switch.disabled.selected.handle.opacity": 1.0, @@ -9,13 +9,10 @@ "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": "surfaceContainerHighest", + "md.comp.switch.disabled.unselected.icon.color": "surfaceVariant", "md.comp.switch.disabled.unselected.icon.opacity": 0.38, - "md.comp.switch.disabled.unselected.track.color": "surfaceContainerHighest", + "md.comp.switch.disabled.unselected.track.color": "surfaceVariant", "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, @@ -47,29 +44,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": "surfaceContainerHighest", + "md.comp.switch.unselected.focus.icon.color": "surfaceVariant", "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": "surfaceContainerHighest", + "md.comp.switch.unselected.focus.track.color": "surfaceVariant", "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": "surfaceContainerHighest", + "md.comp.switch.unselected.hover.icon.color": "surfaceVariant", "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": "surfaceContainerHighest", + "md.comp.switch.unselected.hover.track.color": "surfaceVariant", "md.comp.switch.unselected.hover.track.outline.color": "outline", - "md.comp.switch.unselected.icon.color": "surfaceContainerHighest", + "md.comp.switch.unselected.icon.color": "surfaceVariant", "md.comp.switch.unselected.icon.size": 16.0, "md.comp.switch.unselected.pressed.handle.color": "onSurfaceVariant", - "md.comp.switch.unselected.pressed.icon.color": "surfaceContainerHighest", + "md.comp.switch.unselected.pressed.icon.color": "surfaceVariant", "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": "surfaceContainerHighest", + "md.comp.switch.unselected.pressed.track.color": "surfaceVariant", "md.comp.switch.unselected.pressed.track.outline.color": "outline", - "md.comp.switch.unselected.track.color": "surfaceContainerHighest", + "md.comp.switch.unselected.track.color": "surfaceVariant", "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 d1eb6756623..f0f2f2f3935 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_206", + "version": "v0_162", "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": "surfaceContainerHighest", + "md.comp.filled-text-field.container.color": "surfaceVariant", "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,7 +44,6 @@ "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 44d5ae6ad62..26f442d47d7 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_206", + "version": "v0_162", "md.comp.outlined-text-field.caret.color": "primary", "md.comp.outlined-text-field.container.shape": "md.sys.shape.corner.extra-small", @@ -17,7 +17,6 @@ "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", @@ -36,8 +35,6 @@ "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 0eeb1fcb9ad..019da1e61db 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_206", + "version": "v0_162", "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 e2e14681685..3ac8ae33c58 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_206", + "version": "v0_162", - "md.comp.time-picker.clock-dial.color": "surfaceContainerHighest", + "md.comp.time-picker.clock-dial.color": "surfaceVariant", "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": "surfaceContainerHigh", + "md.comp.time-picker.container.color": "surface", "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,6 +46,7 @@ "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", @@ -64,7 +65,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": "surfaceContainerHighest", + "md.comp.time-picker.time-selector.unselected.container.color": "surfaceVariant", "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 9da1d8c0fce..bc2d979d76e 100644 --- a/dev/tools/gen_defaults/data/top_app_bar_large.json +++ b/dev/tools/gen_defaults/data/top_app_bar_large.json @@ -1,10 +1,11 @@ { - "version": "v0_206", + "version": "v0_162", "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 9a5e6d941ca..39ff113b618 100644 --- a/dev/tools/gen_defaults/data/top_app_bar_medium.json +++ b/dev/tools/gen_defaults/data/top_app_bar_medium.json @@ -1,10 +1,11 @@ { - "version": "v0_206", + "version": "v0_162", "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 24f5affa6c1..90053e02f26 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_206", + "version": "v0_162", "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 02dbc654486..f32100baadb 100644 --- a/dev/tools/gen_defaults/data/typeface.json +++ b/dev/tools/gen_defaults/data/typeface.json @@ -1,5 +1,5 @@ { - "version": "v0_206", + "version": "v0_162", "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 12446e1df3a..e40d24932f6 100644 --- a/dev/tools/gen_defaults/generated/used_tokens.csv +++ b/dev/tools/gen_defaults/generated/used_tokens.csv @@ -1,5 +1,7 @@ -Versions used, v0_206 +Versions used, v0_162, v0_202, v0_158 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, @@ -23,11 +25,13 @@ 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, @@ -71,6 +75,7 @@ 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, @@ -119,6 +124,7 @@ 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, @@ -128,6 +134,7 @@ 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, @@ -148,6 +155,7 @@ 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, @@ -202,9 +210,8 @@ 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.width, +md.comp.filled-icon-button.container.size, md.comp.filled-icon-button.disabled.container.color, md.comp.filled-icon-button.disabled.container.opacity, md.comp.filled-icon-button.disabled.icon.color, @@ -293,9 +300,8 @@ 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.width, +md.comp.filled-tonal-icon-button.container.size, 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, @@ -319,6 +325,8 @@ 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, @@ -356,6 +364,7 @@ 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, @@ -416,6 +425,7 @@ 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, @@ -423,6 +433,7 @@ 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, @@ -433,11 +444,12 @@ 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, @@ -471,11 +483,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.width, +md.comp.outlined-icon-button.container.size, 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, @@ -544,6 +556,8 @@ 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, @@ -581,6 +595,7 @@ 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, @@ -591,6 +606,7 @@ 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, @@ -600,6 +616,8 @@ 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, @@ -610,8 +628,10 @@ 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, @@ -781,6 +801,7 @@ 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, @@ -802,21 +823,10 @@ 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.neutral96, -md.ref.palette.neutral98, +md.ref.palette.neutral99, md.ref.palette.primary10, md.ref.palette.primary100, md.ref.palette.primary20, @@ -851,43 +861,24 @@ 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 4cd61fc66f3..c9eca9ac738 100644 --- a/dev/tools/gen_defaults/lib/action_chip_template.dart +++ b/dev/tools/gen_defaults/lib/action_chip_template.dart @@ -52,9 +52,7 @@ class _${blockName}DefaultsM3 extends ChipThemeData { ? ${componentColor("$tokenGroup$flatVariant.disabled.container")} : ${componentColor("$tokenGroup$elevatedVariant.disabled.container")}; } - return _chipVariant == _ChipVariant.flat - ? ${componentColor("$tokenGroup$flatVariant.container")} - : ${componentColor("$tokenGroup$elevatedVariant.container")}; + return ${componentColor("$tokenGroup$flatVariant.container")}; }); @override diff --git a/dev/tools/gen_defaults/lib/banner_template.dart b/dev/tools/gen_defaults/lib/banner_template.dart index a24657a9a56..7d622b86f40 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 => ${colorOrTransparent("md.comp.banner.container.surface-tint-layer.color")}; + Color? get surfaceTintColor => ${color("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 8b2ee0f1827..00e0e987127 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 => ${colorOrTransparent('md.comp.bottom-app-bar.container.surface-tint-layer')}; + Color? get surfaceTintColor => ${componentColor('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 03da35cf7e9..e355b639e6b 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 => ${colorOrTransparent("md.comp.sheet.bottom.docked.container.surface-tint-layer")}; + Color? get surfaceTintColor => ${componentColor("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 eb6c2d702fc..a09ad6e4a2b 100644 --- a/dev/tools/gen_defaults/lib/color_scheme_template.dart +++ b/dev/tools/gen_defaults/lib/color_scheme_template.dart @@ -32,26 +32,14 @@ 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')}), @@ -59,13 +47,6 @@ 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')}), @@ -86,26 +67,14 @@ 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')}), @@ -113,13 +82,6 @@ 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 88de944de86..6a21403c801 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.modal.container")}; + Color? get backgroundColor => ${componentColor("md.comp.navigation-drawer.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 27ef2fb6837..1bf0346ac07 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.unselected.container")}; + : ${componentColor("$tokenGroup$elevatedVariant.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 32d65e3c707..7031fd3cce2 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.height') && tokenAvailable('$tokenGroup.container.width')) { + if (tokenAvailable('$tokenGroup.container.size')) { return ''' - const MaterialStatePropertyAll(Size(${getToken('$tokenGroup.container.width')}, ${getToken('$tokenGroup.container.height')}))'''; + const MaterialStatePropertyAll(Size(${getToken('$tokenGroup.container.size')}, ${getToken('$tokenGroup.container.size')}))'''; } else { return ''' - const MaterialStatePropertyAll(Size(40.0, 40.0))'''; + const MaterialStatePropertyAll(Size(${getToken('$tokenGroup.state-layer.size')}, ${getToken('$tokenGroup.state-layer.size')}))'''; } } diff --git a/dev/tools/gen_defaults/lib/menu_template.dart b/dev/tools/gen_defaults/lib/menu_template.dart index aaef8459af3..cb09087d8d7 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 const MaterialStatePropertyAll(${colorOrTransparent('md.comp.menu.container.surface-tint-layer')}); + return MaterialStatePropertyAll(${componentColor('md.comp.menu.container.surface-tint-layer')}); } @override @@ -242,10 +242,7 @@ class _MenuDefaultsM3 extends MenuStyle { @override MaterialStateProperty? get surfaceTintColor { - return ${componentColor('md.comp.menu.container.surface-tint-layer') == 'null' - ? 'const MaterialStatePropertyAll(Colors.transparent)' - : 'MaterialStatePropertyAll(${componentColor('md.comp.menu.container.surface-tint-layer')})' - }; + return 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 0d0ec5c0476..13288262657 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.modal.container")}; + Color? get backgroundColor => ${componentColor("md.comp.navigation-drawer.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 a29828adb11..bed11d0b8b0 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 => ${colorOrTransparent("md.comp.menu.container.surface-tint-layer.color")}; + Color? get surfaceTintColor => ${color("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 4b1acebdf78..670121b9cb5 100644 --- a/dev/tools/gen_defaults/lib/search_bar_template.dart +++ b/dev/tools/gen_defaults/lib/search_bar_template.dart @@ -10,15 +10,6 @@ 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 { @@ -42,7 +33,7 @@ class _SearchBarDefaultsM3 extends SearchBarThemeData { @override MaterialStateProperty? get surfaceTintColor => - ${_surfaceTint()} + MaterialStatePropertyAll(${colorOrTransparent("md.comp.search-bar.container.surface-tint-layer.color")}); @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 4d1254ea109..8f9e8f6a3dd 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.1); + return selectedColor?.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return selectedColor?.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return selectedColor?.withOpacity(0.1); + return selectedColor?.withOpacity(0.12); } } else { if (states.contains(MaterialState.pressed)) { - return unselectedColor?.withOpacity(0.1); + return unselectedColor?.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return unselectedColor?.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return unselectedColor?.withOpacity(0.1); + return unselectedColor?.withOpacity(0.12); } } return Colors.transparent; diff --git a/dev/tools/gen_defaults/lib/tabs_template.dart b/dev/tools/gen_defaults/lib/tabs_template.dart index 0dca79409f3..25c895744af 100644 --- a/dev/tools/gen_defaults/lib/tabs_template.dart +++ b/dev/tools/gen_defaults/lib/tabs_template.dart @@ -21,13 +21,11 @@ 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.divider")}; + Color? get dividerColor => ${componentColor("md.comp.primary-navigation-tab.divider")}; - // This value comes from Divider widget defaults. Token db deprecated 'primary-navigation-tab.divider.height' token. @override - double? get dividerHeight => ${getToken("md.comp.divider.thickness")}; + double? get dividerHeight => ${getToken('md.comp.primary-navigation-tab.divider.height')}; @override Color? get indicatorColor => ${componentColor("md.comp.primary-navigation-tab.active-indicator")}; @@ -95,13 +93,11 @@ 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.divider")}; + Color? get dividerColor => ${componentColor("md.comp.secondary-navigation-tab.divider")}; - // This value comes from Divider widget defaults. Token db deprecated 'secondary-navigation-tab.divider.height' token. @override - double? get dividerHeight => ${getToken("md.comp.divider.thickness")}; + double? get dividerHeight => ${getToken('md.comp.secondary-navigation-tab.divider.height')}; @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 deleted file mode 100644 index 51ce183f9e2..00000000000 --- a/examples/api/lib/material/color_scheme/color_scheme.0.dart +++ /dev/null @@ -1,309 +0,0 @@ -// 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 e3b2b964580..0dad9253839 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.surface, + color: colorScheme.background, 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.surface, + : colorScheme.background, child: Padding( padding: const EdgeInsets.all(5.0), child: ConstrainedBox( @@ -305,12 +305,21 @@ 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: 'onSurfaceVariant', color: colorScheme.onSurfaceVariant, onColor: colorScheme.surfaceContainerHighest), + label: 'surfaceVariant', color: colorScheme.surfaceVariant, onColor: colorScheme.onSurfaceVariant), + ColorChip( + label: 'onSurfaceVariant', color: colorScheme.onSurfaceVariant, onColor: colorScheme.surfaceVariant), ], ), 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 f904102678b..556c884ed6b 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.surfaceContainerHighest, + color: colorScheme.surfaceVariant, 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 336a48a04e8..4bf358123b8 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.surface, + color: colorScheme.background, 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 edca9572d83..007b95683fb 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.surface); + expect(getScaffoldMaterial().color, lightTheme.colorScheme.background); 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.surface, darkTheme.colorScheme.surface, 0.5), + Color.lerp(lightTheme.colorScheme.background, darkTheme.colorScheme.background, 0.5), ); await tester.pumpAndSettle(); // The Scaffold background color is now fully dark. - expect(getScaffoldMaterial().color, darkTheme.colorScheme.surface); + expect(getScaffoldMaterial().color, darkTheme.colorScheme.background); // 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(0xff333731)); + expect(getScaffoldMaterial().color, const Color(0xff3c3e3b)); await tester.pumpAndSettle(); // The Scaffold background color is now fully light. - expect(getScaffoldMaterial().color, lightTheme.colorScheme.surface); + expect(getScaffoldMaterial().color, lightTheme.colorScheme.background); // 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.surface); + expect(getScaffoldMaterial().color, darkTheme.colorScheme.background); }); } diff --git a/examples/api/test/material/card/card.2_test.dart b/examples/api/test/material/card/card.2_test.dart index b9753bfdf88..1c0d93affba 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(0xfff7f2fa)); + expect(defaultCard.color, const Color(0xfffffbfe)); expect(defaultCard.shadowColor, const Color(0xff000000)); - expect(defaultCard.surfaceTintColor, Colors.transparent); + expect(defaultCard.surfaceTintColor, const Color(0xff6750a4)); 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(0xffe6e0e9)); + expect(filledCard.color, const Color(0xffe7e0ec)); 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(0xfffef7ff)); + expect(outlinedCard.color, const Color(0xfffffbfe)); expect(outlinedCard.shadowColor, const Color(0xff000000)); - expect(outlinedCard.surfaceTintColor, Colors.transparent); + expect(outlinedCard.surfaceTintColor, const Color(0xff6750a4)); }); } 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 deleted file mode 100644 index 492a71884b9..00000000000 --- a/examples/api/test/material/color_scheme/color_scheme.0_test.dart +++ /dev/null @@ -1,41 +0,0 @@ -// 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 ccbc9192555..e2b50634911 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(0x00fef7ff); + const Color unselectedColor = Color(0x00fffbfe); /// 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(0x00fef7ff); + const Color unselectedColor = Color(0x00fffbfe); /// 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(0x00fef7ff); + const Color unselectedColor = Color(0x00fffbfe); /// 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 7156debc64c..6e7c3d18a36 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,435 +26,6 @@ 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 c819c48fece..31e85ded65e 100644 --- a/packages/flutter/lib/src/material/action_chip.dart +++ b/packages/flutter/lib/src/material/action_chip.dart @@ -280,9 +280,7 @@ class _ActionChipDefaultsM3 extends ChipThemeData { ? null : _colors.onSurface.withOpacity(0.12); } - return _chipVariant == _ChipVariant.flat - ? null - : _colors.surfaceContainerLow; + return null; }); @override @@ -291,7 +289,7 @@ class _ActionChipDefaultsM3 extends ChipThemeData { : _colors.shadow; @override - Color? get surfaceTintColor => Colors.transparent; + Color? get surfaceTintColor => _colors.surfaceTint; @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 286d8c43efd..1f5c8dc979b 100644 --- a/packages/flutter/lib/src/material/app_bar.dart +++ b/packages/flutter/lib/src/material/app_bar.dart @@ -848,17 +848,6 @@ 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!; @@ -1124,7 +1113,7 @@ class _AppBarState extends State { ?? appBarTheme.systemOverlayStyle ?? defaults.systemOverlayStyle ?? _systemOverlayStyleForBrightness( - ThemeData.estimateBrightnessForColor(effectiveBackgroundColor), + ThemeData.estimateBrightnessForColor(backgroundColor), // Make the status bar transparent for M3 so the elevation overlay // color is picked up by the statusbar. theme.useMaterial3 ? const Color(0x00000000) : null, @@ -1135,7 +1124,7 @@ class _AppBarState extends State { child: AnnotatedRegion( value: overlayStyle, child: Material( - color: theme.useMaterial3 ? effectiveBackgroundColor : backgroundColor, + color: backgroundColor, elevation: effectiveElevation, type: widget.forceMaterialTransparency ? MaterialType.transparency @@ -1145,10 +1134,7 @@ class _AppBarState extends State { ?? defaults.shadowColor, surfaceTintColor: widget.surfaceTintColor ?? appBarTheme.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), + ?? defaults.surfaceTintColor, shape: widget.shape ?? appBarTheme.shape ?? defaults.shape, child: Semantics( explicitChildNodes: true, @@ -2355,7 +2341,7 @@ class _AppBarDefaultsM3 extends AppBarTheme { Color? get shadowColor => Colors.transparent; @override - Color? get surfaceTintColor => Colors.transparent; + Color? get surfaceTintColor => _colors.surfaceTint; @override IconThemeData? get iconTheme => IconThemeData( diff --git a/packages/flutter/lib/src/material/banner.dart b/packages/flutter/lib/src/material/banner.dart index 67d15b8b759..7ff0a5c9079 100644 --- a/packages/flutter/lib/src/material/banner.dart +++ b/packages/flutter/lib/src/material/banner.dart @@ -6,7 +6,6 @@ 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'; @@ -154,18 +153,16 @@ class MaterialBanner extends StatefulWidget { /// The color of the surface of this [MaterialBanner]. /// /// If `null`, [MaterialBannerThemeData.backgroundColor] is used. If that is - /// also `null`, [ColorScheme.surfaceContainerLow] of [ThemeData.colorScheme] is used. + /// also `null`, [ColorScheme.surface] 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 [Colors.transparent]. + /// is also null, the default value is [ColorScheme.surfaceTint]. /// - /// 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 [Material.surfaceTintColor] for more details on how this + /// overlay is applied. final Color? surfaceTintColor; /// The color of the shadow below the [MaterialBanner]. @@ -486,10 +483,10 @@ class _BannerDefaultsM3 extends MaterialBannerThemeData { late final TextTheme _textTheme = Theme.of(context).textTheme; @override - Color? get backgroundColor => _colors.surfaceContainerLow; + Color? get backgroundColor => _colors.surface; @override - Color? get surfaceTintColor => Colors.transparent; + Color? get surfaceTintColor => _colors.surfaceTint; @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 c06954bc258..430c717e5c5 100644 --- a/packages/flutter/lib/src/material/bottom_app_bar.dart +++ b/packages/flutter/lib/src/material/bottom_app_bar.dart @@ -94,9 +94,8 @@ 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 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. + /// [ThemeData.bottomAppBarTheme] is used. If that's null then + /// [ThemeData.bottomAppBarColor] is used. final Color? color; /// The z-coordinate at which to place this bottom app bar relative to its @@ -130,17 +129,18 @@ class BottomAppBar extends StatefulWidget { /// A custom color for the Material 3 surface-tint elevation effect. /// - /// 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. + /// 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. /// /// If this property is null, then [BottomAppBarTheme.surfaceTintColor] - /// of [ThemeData.bottomAppBarTheme] is used. If that is also null, the default - /// value is [Colors.transparent]. + /// of [ThemeData.bottomAppBarTheme] is used. + /// If that is also null, [ColorScheme.surfaceTint] is used. /// /// 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.surfaceContainer; + Color? get color => _colors.surface; @override - Color? get surfaceTintColor => Colors.transparent; + Color? get surfaceTintColor => _colors.surfaceTint; @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 1d62275b9ff..0f40afe1475 100644 --- a/packages/flutter/lib/src/material/bottom_sheet.dart +++ b/packages/flutter/lib/src/material/bottom_sheet.dart @@ -147,7 +147,8 @@ class BottomSheet extends StatefulWidget { /// The bottom sheet drag handle's color. /// /// Defaults to [BottomSheetThemeData.dragHandleColor]. - /// If that is also null, defaults to [ColorScheme.onSurfaceVariant]. + /// If that is also null, defaults to [ColorScheme.onSurfaceVariant] + /// with an opacity of 0.4. final Color? dragHandleColor; /// Defaults to [BottomSheetThemeData.dragHandleSize]. @@ -1404,16 +1405,16 @@ class _BottomSheetDefaultsM3 extends BottomSheetThemeData { late final ColorScheme _colors = Theme.of(context).colorScheme; @override - Color? get backgroundColor => _colors.surfaceContainerLow; + Color? get backgroundColor => _colors.surface; @override - Color? get surfaceTintColor => Colors.transparent; + Color? get surfaceTintColor => _colors.surfaceTint; @override Color? get shadowColor => Colors.transparent; @override - Color? get dragHandleColor => _colors.onSurfaceVariant; + Color? get dragHandleColor => _colors.onSurfaceVariant.withOpacity(0.4); @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 36a01d0c34f..95667be1f6d 100644 --- a/packages/flutter/lib/src/material/card.dart +++ b/packages/flutter/lib/src/material/card.dart @@ -119,8 +119,14 @@ 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.surfaceContainerLow] of + /// and [ThemeData.useMaterial3] is true, then [ColorScheme.surface] of /// [ThemeData.colorScheme] is used. Otherwise, [ThemeData.cardColor] is used. final Color? color; @@ -133,16 +139,11 @@ 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 [Colors.transparent]. + /// The default is null. /// /// See [Material.surfaceTintColor] for more details on how this /// overlay is applied. @@ -285,13 +286,13 @@ class _CardDefaultsM3 extends CardTheme { late final ColorScheme _colors = Theme.of(context).colorScheme; @override - Color? get color => _colors.surfaceContainerLow; + Color? get color => _colors.surface; @override Color? get shadowColor => _colors.shadow; @override - Color? get surfaceTintColor => Colors.transparent; + Color? get surfaceTintColor => _colors.surfaceTint; @override ShapeBorder? get shape =>const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12.0))); @@ -318,7 +319,7 @@ class _FilledCardDefaultsM3 extends CardTheme { late final ColorScheme _colors = Theme.of(context).colorScheme; @override - Color? get color => _colors.surfaceContainerHighest; + Color? get color => _colors.surfaceVariant; @override Color? get shadowColor => _colors.shadow; @@ -357,7 +358,7 @@ class _OutlinedCardDefaultsM3 extends CardTheme { Color? get shadowColor => _colors.shadow; @override - Color? get surfaceTintColor => Colors.transparent; + Color? get surfaceTintColor => _colors.surfaceTint; @override ShapeBorder? get shape => diff --git a/packages/flutter/lib/src/material/checkbox.dart b/packages/flutter/lib/src/material/checkbox.dart index 5d289aca6d5..b898e2cf06e 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.1); + return _colors.error.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.error.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.error.withOpacity(0.1); + return _colors.error.withOpacity(0.12); } } if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return _colors.onSurface.withOpacity(0.1); + return _colors.onSurface.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.1); + return _colors.primary.withOpacity(0.12); } return Colors.transparent; } if (states.contains(MaterialState.pressed)) { - return _colors.primary.withOpacity(0.1); + return _colors.primary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurface.withOpacity(0.1); + return _colors.onSurface.withOpacity(0.12); } return Colors.transparent; }); diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart index 5fdf1817135..52a405ad93e 100644 --- a/packages/flutter/lib/src/material/chip.dart +++ b/packages/flutter/lib/src/material/chip.dart @@ -212,12 +212,9 @@ abstract interface class ChipAttributes { /// Color of the chip's surface tint overlay when its elevation is /// greater than 0. /// - /// 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]. + /// If this is null and [ThemeData.useMaterial3] is true, then + /// [ColorScheme.surfaceTint] color is used. Otherwise, it defaults + /// to null. Color? get surfaceTintColor; /// Theme used for all icons in the chip. @@ -2377,7 +2374,7 @@ class _ChipDefaultsM3 extends ChipThemeData { Color? get shadowColor => Colors.transparent; @override - Color? get surfaceTintColor => Colors.transparent; + Color? get surfaceTintColor => _colors.surfaceTint; @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 14885ec994f..fa03a133a01 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 - : _colors.surfaceContainerLow; + : null; }); @override @@ -316,7 +316,7 @@ class _ChoiceChipDefaultsM3 extends ChipThemeData { : _colors.shadow; @override - Color? get surfaceTintColor => Colors.transparent; + Color? get surfaceTintColor => _colors.surfaceTint; @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 eaa01ace6ba..4b6a0ff1b98 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 45 colors based on the +/// A set of 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,13 +64,6 @@ 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} @@ -102,11 +95,10 @@ class ColorScheme with Diagnosticable { /// * [onSecondary] /// * [error] /// * [onError] - /// * [surface] - /// * [onSurface] - /// DEPRECATED: /// * [background] /// * [onBackground] + /// * [surface] + /// * [onSurface] const ColorScheme({ required this.brightness, required this.primary, @@ -137,6 +129,8 @@ 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, @@ -146,6 +140,7 @@ class ColorScheme with Diagnosticable { Color? surfaceContainer, Color? surfaceContainerHigh, Color? surfaceContainerHighest, + Color? surfaceVariant, Color? onSurfaceVariant, Color? outline, Color? outlineVariant, @@ -155,21 +150,6 @@ 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, @@ -199,6 +179,7 @@ class ColorScheme with Diagnosticable { _surfaceContainer = surfaceContainer, _surfaceContainerHigh = surfaceContainerHigh, _surfaceContainerHighest = surfaceContainerHighest, + _surfaceVariant = surfaceVariant, _onSurfaceVariant = onSurfaceVariant, _outline = outline, _outlineVariant = outlineVariant, @@ -207,11 +188,7 @@ class ColorScheme with Diagnosticable { _inverseSurface = inverseSurface, _onInverseSurface = onInverseSurface, _inversePrimary = inversePrimary, - _surfaceTint = surfaceTint, - // DEPRECATED (newest deprecations at the bottom) - _background = background, - _onBackground = onBackground, - _surfaceVariant = surfaceVariant; + _surfaceTint = surfaceTint; /// Generate a [ColorScheme] derived from the given `seedColor`. /// @@ -242,41 +219,25 @@ 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? surfaceDim, - Color? surfaceBright, - Color? surfaceContainerLowest, - Color? surfaceContainerLow, - Color? surfaceContainer, - Color? surfaceContainerHigh, - Color? surfaceContainerHighest, + Color? surfaceVariant, Color? onSurfaceVariant, Color? inverseSurface, Color? onInverseSurface, @@ -284,82 +245,43 @@ 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 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); - } - + final Scheme scheme = switch (brightness) { + Brightness.light => Scheme.light(seedColor.value), + Brightness.dark => Scheme.dark(seedColor.value), + }; 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)), + 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), 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)), ); } @@ -416,6 +338,8 @@ 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, @@ -425,6 +349,7 @@ class ColorScheme with Diagnosticable { Color? surfaceContainer, Color? surfaceContainerHigh, Color? surfaceContainerHighest, + Color? surfaceVariant, Color? onSurfaceVariant, Color? outline, Color? outlineVariant, @@ -434,21 +359,6 @@ 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, @@ -478,6 +388,7 @@ class ColorScheme with Diagnosticable { _surfaceContainer = surfaceContainer, _surfaceContainerHigh = surfaceContainerHigh, _surfaceContainerHighest = surfaceContainerHighest, + _surfaceVariant = surfaceVariant, _onSurfaceVariant = onSurfaceVariant, _outline = outline, _outlineVariant = outlineVariant, @@ -486,11 +397,7 @@ class ColorScheme with Diagnosticable { _inverseSurface = inverseSurface, _onInverseSurface = onInverseSurface, _inversePrimary = inversePrimary, - _surfaceTint = surfaceTint, - // DEPRECATED (newest deprecations at the bottom) - _background = background, - _onBackground = onBackground, - _surfaceVariant = surfaceVariant; + _surfaceTint = surfaceTint; /// Create the dark color scheme that matches the /// [baseline Material 2 color scheme](https://material.io/design/color/dark-theme.html#ui-application). @@ -550,6 +457,8 @@ 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, @@ -559,6 +468,7 @@ class ColorScheme with Diagnosticable { Color? surfaceContainer, Color? surfaceContainerHigh, Color? surfaceContainerHighest, + Color? surfaceVariant, Color? onSurfaceVariant, Color? outline, Color? outlineVariant, @@ -568,21 +478,6 @@ 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, @@ -612,6 +507,7 @@ class ColorScheme with Diagnosticable { _surfaceContainer = surfaceContainer, _surfaceContainerHigh = surfaceContainerHigh, _surfaceContainerHighest = surfaceContainerHighest, + _surfaceVariant = surfaceVariant, _onSurfaceVariant = onSurfaceVariant, _outline = outline, _outlineVariant = outlineVariant, @@ -620,11 +516,7 @@ class ColorScheme with Diagnosticable { _inverseSurface = inverseSurface, _onInverseSurface = onInverseSurface, _inversePrimary = inversePrimary, - _surfaceTint = surfaceTint, - // DEPRECATED (newest deprecations at the bottom) - _background = background, - _onBackground = onBackground, - _surfaceVariant = surfaceVariant; + _surfaceTint = surfaceTint; /// 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). @@ -679,6 +571,8 @@ 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, @@ -688,6 +582,7 @@ class ColorScheme with Diagnosticable { Color? surfaceContainer, Color? surfaceContainerHigh, Color? surfaceContainerHighest, + Color? surfaceVariant, Color? onSurfaceVariant, Color? outline, Color? outlineVariant, @@ -697,21 +592,6 @@ 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, @@ -741,6 +621,7 @@ class ColorScheme with Diagnosticable { _surfaceContainer = surfaceContainer, _surfaceContainerHigh = surfaceContainerHigh, _surfaceContainerHighest = surfaceContainerHighest, + _surfaceVariant = surfaceVariant, _onSurfaceVariant = onSurfaceVariant, _outline = outline, _outlineVariant = outlineVariant, @@ -749,11 +630,7 @@ class ColorScheme with Diagnosticable { _inverseSurface = inverseSurface, _onInverseSurface = onInverseSurface, _inversePrimary = inversePrimary, - _surfaceTint = surfaceTint, - // DEPRECATED (newest deprecations at the bottom) - _background = background, - _onBackground = onBackground, - _surfaceVariant = surfaceVariant; + _surfaceTint = surfaceTint; /// Create a high contrast ColorScheme based on the dark /// [baseline Material 2 color scheme](https://material.io/design/color/dark-theme.html#ui-application). @@ -813,6 +690,8 @@ 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, @@ -822,6 +701,7 @@ class ColorScheme with Diagnosticable { Color? surfaceContainer, Color? surfaceContainerHigh, Color? surfaceContainerHighest, + Color? surfaceVariant, Color? onSurfaceVariant, Color? outline, Color? outlineVariant, @@ -831,21 +711,6 @@ 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, @@ -875,6 +740,7 @@ class ColorScheme with Diagnosticable { _surfaceContainer = surfaceContainer, _surfaceContainerHigh = surfaceContainerHigh, _surfaceContainerHighest = surfaceContainerHighest, + _surfaceVariant = surfaceVariant, _onSurfaceVariant = onSurfaceVariant, _outline = outline, _outlineVariant = outlineVariant, @@ -883,11 +749,7 @@ class ColorScheme with Diagnosticable { _inverseSurface = inverseSurface, _onInverseSurface = onInverseSurface, _inversePrimary = inversePrimary, - _surfaceTint = surfaceTint, - // DEPRECATED (newest deprecations at the bottom) - _background = background, - _onBackground = onBackground, - _surfaceVariant = surfaceVariant; + _surfaceTint = surfaceTint; /// Creates a color scheme from a [MaterialColor] swatch. /// @@ -916,15 +778,14 @@ 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, ); } @@ -1088,6 +949,16 @@ 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; @@ -1101,10 +972,6 @@ 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; @@ -1197,26 +1064,6 @@ 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({ @@ -1249,6 +1096,8 @@ class ColorScheme with Diagnosticable { Color? onError, Color? errorContainer, Color? onErrorContainer, + Color? background, + Color? onBackground, Color? surface, Color? onSurface, Color? surfaceDim, @@ -1258,6 +1107,7 @@ class ColorScheme with Diagnosticable { Color? surfaceContainer, Color? surfaceContainerHigh, Color? surfaceContainerHighest, + Color? surfaceVariant, Color? onSurfaceVariant, Color? outline, Color? outlineVariant, @@ -1267,21 +1117,6 @@ 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, @@ -1313,6 +1148,8 @@ 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, @@ -1322,6 +1159,7 @@ 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, @@ -1331,10 +1169,6 @@ 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, ); } @@ -1375,6 +1209,8 @@ 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), @@ -1384,6 +1220,7 @@ 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), @@ -1393,10 +1230,6 @@ 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), ); } @@ -1438,6 +1271,8 @@ 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 @@ -1447,6 +1282,7 @@ 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 @@ -1455,11 +1291,7 @@ class ColorScheme with Diagnosticable { && other.inverseSurface == inverseSurface && other.onInverseSurface == onInverseSurface && other.inversePrimary == inversePrimary - && other.surfaceTint == surfaceTint - // DEPRECATED (newest deprecations at the bottom) - && other.background == background - && other.onBackground == onBackground - && other.surfaceVariant == surfaceVariant; + && other.surfaceTint == surfaceTint; } @override @@ -1481,6 +1313,8 @@ class ColorScheme with Diagnosticable { onError, errorContainer, onErrorContainer, + background, + onBackground, Object.hash( surface, onSurface, @@ -1491,6 +1325,7 @@ class ColorScheme with Diagnosticable { surfaceContainer, surfaceContainerHigh, surfaceContainerHighest, + surfaceVariant, onSurfaceVariant, outline, outlineVariant, @@ -1513,10 +1348,6 @@ class ColorScheme with Diagnosticable { tertiaryFixedDim, onTertiaryFixed, onTertiaryFixedVariant, - // DEPRECATED (newest deprecations at the bottom) - background, - onBackground, - surfaceVariant, ) ), ); @@ -1554,6 +1385,8 @@ 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)); @@ -1563,6 +1396,7 @@ 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)); @@ -1572,10 +1406,6 @@ 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`. @@ -1619,41 +1449,25 @@ 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? surfaceDim, - Color? surfaceBright, - Color? surfaceContainerLowest, - Color? surfaceContainerLow, - Color? surfaceContainer, - Color? surfaceContainerHigh, - Color? surfaceContainerHighest, + Color? surfaceVariant, Color? onSurfaceVariant, Color? inverseSurface, Color? onInverseSurface, @@ -1661,21 +1475,6 @@ 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 = @@ -1688,66 +1487,42 @@ class ColorScheme with Diagnosticable { final List scoredResults = Score.score(colorToCount, desired: 1); final ui.Color baseColor = Color(scoredResults.first); - 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); - } + final Scheme scheme = switch (brightness) { + Brightness.light => Scheme.light(baseColor.value), + Brightness.dark => Scheme.dark(baseColor.value), + }; - 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)), + 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), 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 cd81c2eee0a..d2c75856b38 100644 --- a/packages/flutter/lib/src/material/date_picker_theme.dart +++ b/packages/flutter/lib/src/material/date_picker_theme.dart @@ -227,11 +227,6 @@ 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]. @@ -853,7 +848,7 @@ class _DatePickerDefaultsM3 extends DatePickerThemeData { late final TextTheme _textTheme = _theme.textTheme; @override - Color? get backgroundColor => _colors.surfaceContainerHigh; + Color? get backgroundColor => _colors.surface; @override ButtonStyle get cancelButtonStyle { @@ -869,7 +864,7 @@ class _DatePickerDefaultsM3 extends DatePickerThemeData { Color? get shadowColor => Colors.transparent; @override - Color? get surfaceTintColor => Colors.transparent; + Color? get surfaceTintColor => _colors.surfaceTint; @override Color? get headerBackgroundColor => Colors.transparent; @@ -916,23 +911,23 @@ class _DatePickerDefaultsM3 extends DatePickerThemeData { MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return _colors.onPrimary.withOpacity(0.1); + return _colors.onPrimary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onPrimary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onPrimary.withOpacity(0.1); + return _colors.onPrimary.withOpacity(0.12); } } else { if (states.contains(MaterialState.pressed)) { - return _colors.onSurfaceVariant.withOpacity(0.1); + return _colors.onSurfaceVariant.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSurfaceVariant.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurfaceVariant.withOpacity(0.1); + return _colors.onSurfaceVariant.withOpacity(0.12); } } return null; @@ -983,23 +978,23 @@ class _DatePickerDefaultsM3 extends DatePickerThemeData { MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { if (states.contains(MaterialState.pressed)) { - return _colors.onPrimary.withOpacity(0.1); + return _colors.onPrimary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onPrimary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onPrimary.withOpacity(0.1); + return _colors.onPrimary.withOpacity(0.12); } } else { if (states.contains(MaterialState.pressed)) { - return _colors.onSurfaceVariant.withOpacity(0.1); + return _colors.onSurfaceVariant.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSurfaceVariant.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurfaceVariant.withOpacity(0.1); + return _colors.onSurfaceVariant.withOpacity(0.12); } } return null; @@ -1018,13 +1013,13 @@ class _DatePickerDefaultsM3 extends DatePickerThemeData { MaterialStateProperty? get rangeSelectionOverlayColor => MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.pressed)) { - return _colors.onPrimaryContainer.withOpacity(0.1); + return _colors.onPrimaryContainer.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onPrimaryContainer.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onPrimaryContainer.withOpacity(0.1); + return _colors.onPrimaryContainer.withOpacity(0.12); } return null; }); diff --git a/packages/flutter/lib/src/material/dialog.dart b/packages/flutter/lib/src/material/dialog.dart index 3d8336fc011..cb2af1eb448 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`, [ColorScheme.surfaceContainerHigh] is used in Material 3. + /// If `null`, [ThemeData.dialogBackgroundColor] is used. /// {@endtemplate} final Color? backgroundColor; @@ -135,12 +135,8 @@ class Dialog extends StatelessWidget { /// /// If [ThemeData.useMaterial3] is false property has no effect. /// - /// 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]. + /// If null and [ThemeData.useMaterial3] is true then [ThemeData]'s + /// [ColorScheme.surfaceTint] will be used. /// /// To disable this feature, set [surfaceTintColor] to [Colors.transparent]. /// @@ -1652,13 +1648,13 @@ class _DialogDefaultsM3 extends DialogTheme { Color? get iconColor => _colors.secondary; @override - Color? get backgroundColor => _colors.surfaceContainerHigh; + Color? get backgroundColor => _colors.surface; @override Color? get shadowColor => Colors.transparent; @override - Color? get surfaceTintColor => Colors.transparent; + Color? get surfaceTintColor => _colors.surfaceTint; @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 e27eb149a6b..dc12c4b5408 100644 --- a/packages/flutter/lib/src/material/drawer.dart +++ b/packages/flutter/lib/src/material/drawer.dart @@ -175,15 +175,13 @@ class Drawer extends StatelessWidget { /// The color used as a surface tint overlay on the drawer's background color, /// which reflects the drawer's [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 [ThemeData.useMaterial3] is false property has no effect. + /// + /// If null and [ThemeData.useMaterial3] is true then [ThemeData]'s + /// [ColorScheme.surfaceTint] will be used. /// /// 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. @@ -793,10 +791,10 @@ class _DrawerDefaultsM3 extends DrawerThemeData { late final TextDirection direction = Directionality.of(context); @override - Color? get backgroundColor => Theme.of(context).colorScheme.surfaceContainerLow; + Color? get backgroundColor => Theme.of(context).colorScheme.surface; @override - Color? get surfaceTintColor => Colors.transparent; + Color? get surfaceTintColor => Theme.of(context).colorScheme.surfaceTint; @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 9a00c589ce1..3380abd9d68 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.surfaceContainerLow + /// * others - Theme.colorScheme.surface /// * `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.1) + /// * focused or pressed - Theme.colorScheme.primary(0.12) /// * `shadowColor` - Theme.colorScheme.shadow - /// * `surfaceTintColor` - Colors.transparent + /// * `surfaceTintColor` - Theme.colorScheme.surfaceTint /// * `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.1); + return overlay.withOpacity(0.24); } if (states.contains(MaterialState.hovered)) { return overlay.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return overlay.withOpacity(0.1); + return overlay.withOpacity(0.24); } return null; } @@ -629,7 +629,7 @@ class _ElevatedButtonDefaultsM3 extends ButtonStyle { if (states.contains(MaterialState.disabled)) { return _colors.onSurface.withOpacity(0.12); } - return _colors.surfaceContainerLow; + return _colors.surface; }); @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.1); + return _colors.primary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.1); + return _colors.primary.withOpacity(0.12); } return null; }); @@ -662,7 +662,7 @@ class _ElevatedButtonDefaultsM3 extends ButtonStyle { @override MaterialStateProperty? get surfaceTintColor => - const MaterialStatePropertyAll(Colors.transparent); + MaterialStatePropertyAll(_colors.surfaceTint); @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 e84a4925331..438aade9c37 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.1) + /// * focused or pressed - Theme.colorScheme.onSecondaryContainer(0.12) /// * `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.1); + return overlay.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return overlay.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return overlay.withOpacity(0.1); + return overlay.withOpacity(0.12); } 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.1); + return _colors.onPrimary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onPrimary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onPrimary.withOpacity(0.1); + return _colors.onPrimary.withOpacity(0.12); } 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.1); + return _colors.onSecondaryContainer.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSecondaryContainer.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSecondaryContainer.withOpacity(0.1); + return _colors.onSecondaryContainer.withOpacity(0.12); } return null; }); diff --git a/packages/flutter/lib/src/material/filter_chip.dart b/packages/flutter/lib/src/material/filter_chip.dart index bede721c0f7..4cc1403983d 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 - : _colors.surfaceContainerLow; + : null; }); @override @@ -347,7 +347,7 @@ class _FilterChipDefaultsM3 extends ChipThemeData { : _colors.shadow; @override - Color? get surfaceTintColor => Colors.transparent; + Color? get surfaceTintColor => _colors.surfaceTint; @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 06aed53f5a6..1b32b6af738 100644 --- a/packages/flutter/lib/src/material/floating_action_button.dart +++ b/packages/flutter/lib/src/material/floating_action_button.dart @@ -283,22 +283,19 @@ class FloatingActionButton extends StatelessWidget { /// The color to use for filling the button when the button has input focus. /// - /// In Material3, defaults to [ColorScheme.onPrimaryContainer] with opacity 0.1. - /// In Material 2, it defaults to [ThemeData.focusColor] for the current theme. + /// 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 in Material 2. In - /// Material 3, defaults to [ColorScheme.onPrimaryContainer] with opacity 0.08. + /// Defaults to [ThemeData.hoverColor] for the current theme. 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 in Material 2; [ColorScheme.onPrimaryContainer] - /// with opacity 0.1 is used in Material 3. + /// null, [ThemeData.splashColor] is used. final Color? splashColor; /// The tag to apply to the button's [Hero] widget. @@ -811,8 +808,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.1); - @override Color? get focusColor => _colors.onPrimaryContainer.withOpacity(0.1); + @override Color? get splashColor => _colors.onPrimaryContainer.withOpacity(0.12); + @override Color? get focusColor => _colors.onPrimaryContainer.withOpacity(0.12); @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 bee7558d070..8b0a9e0a529 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.1) - /// * hovered - Theme.colorScheme.onSurfaceVariant(0.08) - /// * pressed or focused - Theme.colorScheme.onSurfaceVariant(0.1) + /// * focused or pressed - Theme.colorScheme.primary(0.12) + /// * hovered or focused - Theme.colorScheme.onSurfaceVariant(0.08) + /// * pressed - Theme.colorScheme.onSurfaceVariant(0.12) /// * 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.1); + return highlightColor ?? foregroundColor?.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return hoverColor ?? foregroundColor?.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return focusColor ?? foregroundColor?.withOpacity(0.1); + return focusColor ?? foregroundColor?.withOpacity(0.12); } } if (states.contains(MaterialState.pressed)) { - return highlightColor ?? foregroundColor?.withOpacity(0.1); + return highlightColor ?? foregroundColor?.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return hoverColor ?? foregroundColor?.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return focusColor ?? foregroundColor?.withOpacity(0.1); + return focusColor ?? foregroundColor?.withOpacity(0.08); } 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.1); + return _colors.primary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.1); + return _colors.primary.withOpacity(0.12); } } if (states.contains(MaterialState.pressed)) { - return _colors.onSurfaceVariant.withOpacity(0.1); + return _colors.onSurfaceVariant.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSurfaceVariant.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurfaceVariant.withOpacity(0.1); + return _colors.onSurfaceVariant.withOpacity(0.12); } return Colors.transparent; }); @@ -1229,7 +1229,7 @@ class _FilledIconButtonDefaultsM3 extends ButtonStyle { return _colors.primary; } if (toggleable) { // toggleable but unselected case - return _colors.surfaceContainerHighest; + return _colors.surfaceVariant; } 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.1); + return _colors.onPrimary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onPrimary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onPrimary.withOpacity(0.1); + return _colors.onPrimary.withOpacity(0.12); } } if (toggleable) { // toggleable but unselected case if (states.contains(MaterialState.pressed)) { - return _colors.primary.withOpacity(0.1); + return _colors.primary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.1); + return _colors.primary.withOpacity(0.12); } } if (states.contains(MaterialState.pressed)) { - return _colors.onPrimary.withOpacity(0.1); + return _colors.onPrimary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onPrimary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onPrimary.withOpacity(0.1); + return _colors.onPrimary.withOpacity(0.12); } return Colors.transparent; }); @@ -1375,7 +1375,7 @@ class _FilledTonalIconButtonDefaultsM3 extends ButtonStyle { return _colors.secondaryContainer; } if (toggleable) { // toggleable but unselected case - return _colors.surfaceContainerHighest; + return _colors.surfaceVariant; } 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.1); + return _colors.onSecondaryContainer.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSecondaryContainer.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSecondaryContainer.withOpacity(0.1); + return _colors.onSecondaryContainer.withOpacity(0.12); } } if (toggleable) { // toggleable but unselected case if (states.contains(MaterialState.pressed)) { - return _colors.onSurfaceVariant.withOpacity(0.1); + return _colors.onSurfaceVariant.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSurfaceVariant.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurfaceVariant.withOpacity(0.1); + return _colors.onSurfaceVariant.withOpacity(0.12); } } if (states.contains(MaterialState.pressed)) { - return _colors.onSecondaryContainer.withOpacity(0.1); + return _colors.onSecondaryContainer.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSecondaryContainer.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSecondaryContainer.withOpacity(0.1); + return _colors.onSecondaryContainer.withOpacity(0.12); } 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.1); + return _colors.onInverseSurface.withOpacity(0.12); } 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.1); + return _colors.onSurface.withOpacity(0.12); } 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 136826b0e65..f9d72f04f9f 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.surfaceContainerHighest; + return _colors.surfaceVariant; }); @override diff --git a/packages/flutter/lib/src/material/menu_anchor.dart b/packages/flutter/lib/src/material/menu_anchor.dart index ab05d34e717..16f084628f2 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.surfaceContainer); + return MaterialStatePropertyAll(_colors.surface); } @override @@ -3713,7 +3713,7 @@ class _MenuBarDefaultsM3 extends MenuStyle { @override MaterialStateProperty? get surfaceTintColor { - return const MaterialStatePropertyAll(Colors.transparent); + return MaterialStatePropertyAll(_colors.surfaceTint); } @override @@ -3823,13 +3823,13 @@ class _MenuButtonDefaultsM3 extends ButtonStyle { return MaterialStateProperty.resolveWith( (Set states) { if (states.contains(MaterialState.pressed)) { - return _colors.onSurface.withOpacity(0.1); + return _colors.onSurface.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurface.withOpacity(0.1); + return _colors.onSurface.withOpacity(0.12); } return Colors.transparent; }, @@ -3912,12 +3912,12 @@ class _MenuDefaultsM3 extends MenuStyle { @override MaterialStateProperty get backgroundColor { - return MaterialStatePropertyAll(_colors.surfaceContainer); + return MaterialStatePropertyAll(_colors.surface); } @override MaterialStateProperty? get surfaceTintColor { - return const MaterialStatePropertyAll(Colors.transparent); + return MaterialStatePropertyAll(_colors.surfaceTint); } @override diff --git a/packages/flutter/lib/src/material/navigation_bar.dart b/packages/flutter/lib/src/material/navigation_bar.dart index a17697ed60d..6bad2342e5a 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.surfaceContainer]. If that is false, the default blends [ColorScheme.surface] + /// [ColorScheme.surface]. If that is false, the default blends [ColorScheme.surface] /// and [ColorScheme.onSurface] using an [ElevationOverlay]. final Color? backgroundColor; @@ -162,13 +162,8 @@ 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 [Colors.transparent]. + /// is also null, the default value is [ColorScheme.surfaceTint]. /// /// See [Material.surfaceTintColor] for more details on how this /// overlay is applied. @@ -1368,11 +1363,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.surfaceContainer; + @override Color? get backgroundColor => _colors.surface; @override Color? get shadowColor => Colors.transparent; - @override Color? get surfaceTintColor => Colors.transparent; + @override Color? get surfaceTintColor => _colors.surfaceTint; @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 edd9946c9b7..8ce07e90d50 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.surfaceContainerLow]. + /// If that is also null, then it falls back to [ColorScheme.surface]. final Color? backgroundColor; /// The color used for the drop shadow to indicate elevation. @@ -80,16 +80,11 @@ 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, the default value is [Colors.transparent]. + /// If that is also null, then it falls back to [Material.surfaceTintColor]'s default. final Color? surfaceTintColor; /// The elevation of the [NavigationDrawer] itself. @@ -716,10 +711,10 @@ class _NavigationDrawerDefaultsM3 extends NavigationDrawerThemeData { late final TextTheme _textTheme = Theme.of(context).textTheme; @override - Color? get backgroundColor => _colors.surfaceContainerLow; + Color? get backgroundColor => _colors.surface; @override - Color? get surfaceTintColor => Colors.transparent; + Color? get surfaceTintColor => _colors.surfaceTint; @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 35be3346063..3ca3b7caf38 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.1) + /// * focused or pressed - Theme.colorScheme.primary(0.12) /// * 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.1); + return foreground.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { - return foreground.withOpacity(0.08); + return foreground.withOpacity(0.04); } if (states.contains(MaterialState.focused)) { - return foreground.withOpacity(0.1); + return foreground.withOpacity(0.12); } 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.1); + return _colors.primary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.1); + return _colors.primary.withOpacity(0.12); } return null; }); diff --git a/packages/flutter/lib/src/material/popup_menu.dart b/packages/flutter/lib/src/material/popup_menu.dart index 8746b3465bf..fdddc102824 100644 --- a/packages/flutter/lib/src/material/popup_menu.dart +++ b/packages/flutter/lib/src/material/popup_menu.dart @@ -8,7 +8,6 @@ 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'; @@ -1195,13 +1194,8 @@ 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 [Colors.transparent]. + /// is also null, the default value is [ColorScheme.surfaceTint]. /// /// See [Material.surfaceTintColor] for more details on how this /// overlay is applied. @@ -1257,8 +1251,7 @@ class PopupMenuButton extends StatefulWidget { /// /// If this property is null, then [PopupMenuThemeData.color] is used. /// If [PopupMenuThemeData.color] is also null, then - /// [ThemeData.cardColor] is used in Material 2. In Material3, defaults to - /// [ColorScheme.surfaceContainer]. + /// Theme.of(context).cardColor is used. final Color? color; /// If provided, this color is used for the button icon. @@ -1520,13 +1513,13 @@ class _PopupMenuDefaultsM3 extends PopupMenuThemeData { } @override - Color? get color => _colors.surfaceContainer; + Color? get color => _colors.surface; @override Color? get shadowColor => _colors.shadow; @override - Color? get surfaceTintColor => Colors.transparent; + Color? get surfaceTintColor => _colors.surfaceTint; @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 8b4cf3f7248..ed53025c77c 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.surfaceContainerHighest; + Color get linearTrackColor => _colors.surfaceVariant; @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 d0c97e3b408..f41dda57cb9 100644 --- a/packages/flutter/lib/src/material/radio.dart +++ b/packages/flutter/lib/src/material/radio.dart @@ -330,17 +330,9 @@ 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 in Material 2, the value of [ColorScheme.secondary] with alpha + /// then the value of [ColorScheme.secondary] with alpha /// [kRadialReactionAlpha], [ThemeData.focusColor] and [ThemeData.hoverColor] - /// 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) + /// is used in the pressed, focused and hovered state. final MaterialStateProperty? overlayColor; /// {@template flutter.material.radio.splashRadius} @@ -680,24 +672,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.1); + return _colors.onSurface.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.1); + return _colors.primary.withOpacity(0.12); } return Colors.transparent; } if (states.contains(MaterialState.pressed)) { - return _colors.primary.withOpacity(0.1); + return _colors.primary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurface.withOpacity(0.1); + return _colors.onSurface.withOpacity(0.12); } return Colors.transparent; }); diff --git a/packages/flutter/lib/src/material/search_anchor.dart b/packages/flutter/lib/src/material/search_anchor.dart index 70184692b95..88d8d516b90 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.surfaceContainerHigh]. + /// If this is also null, then the default value is [ColorScheme.surface]. final Color? viewBackgroundColor; /// The elevation of the search view's [Material]. @@ -239,10 +239,7 @@ class SearchAnchor extends StatefulWidget { /// The surface tint color of the search view's [Material]. /// - /// 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 [Material.surfaceTintColor] for more details. /// /// If null, the value of [SearchViewThemeData.surfaceTintColor] will be used. /// If this is also null, then the default value is [ColorScheme.surfaceTint]. @@ -1195,7 +1192,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.surfaceContainerHigh]. + /// If this is also null, then the default value is [ColorScheme.surface]. final MaterialStateProperty? backgroundColor; /// The shadow color of the search bar's [Material]. @@ -1206,13 +1203,10 @@ class SearchBar extends StatefulWidget { /// The surface tint color of the search bar's [Material]. /// - /// 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 [Material.surfaceTintColor] for more details. /// /// If null, the value of [SearchBarThemeData.surfaceTintColor] will be used. - /// If this is also null, then the default value is [Colors.transparent]. + /// If this is also null, then the default value is [ColorScheme.surfaceTint]. final MaterialStateProperty? surfaceTintColor; /// The highlight color that's typically used to indicate that @@ -1451,7 +1445,7 @@ class _SearchBarDefaultsM3 extends SearchBarThemeData { @override MaterialStateProperty? get backgroundColor => - MaterialStatePropertyAll(_colors.surfaceContainerHigh); + MaterialStatePropertyAll(_colors.surface); @override MaterialStateProperty? get elevation => @@ -1463,13 +1457,13 @@ class _SearchBarDefaultsM3 extends SearchBarThemeData { @override MaterialStateProperty? get surfaceTintColor => - const MaterialStatePropertyAll(Colors.transparent); + MaterialStatePropertyAll(_colors.surfaceTint); @override MaterialStateProperty? get overlayColor => MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.pressed)) { - return _colors.onSurface.withOpacity(0.1); + return _colors.onSurface.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); @@ -1526,13 +1520,13 @@ class _SearchViewDefaultsM3 extends SearchViewThemeData { static double fullScreenBarHeight = 72.0; @override - Color? get backgroundColor => _colors.surfaceContainerHigh; + Color? get backgroundColor => _colors.surface; @override double? get elevation => 6.0; @override - Color? get surfaceTintColor => Colors.transparent; + Color? get surfaceTintColor => _colors.surfaceTint; // No default side diff --git a/packages/flutter/lib/src/material/segmented_button.dart b/packages/flutter/lib/src/material/segmented_button.dart index 540513e82c6..b2dd0e12393 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.1); + return _colors.onSecondaryContainer.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSecondaryContainer.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSecondaryContainer.withOpacity(0.1); + return _colors.onSecondaryContainer.withOpacity(0.12); } } else { if (states.contains(MaterialState.pressed)) { - return _colors.onSurface.withOpacity(0.1); + return _colors.onSurface.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurface.withOpacity(0.1); + return _colors.onSurface.withOpacity(0.12); } } 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.1); + return selectedColor?.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return selectedColor?.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return selectedColor?.withOpacity(0.1); + return selectedColor?.withOpacity(0.12); } } else { if (states.contains(MaterialState.pressed)) { - return unselectedColor?.withOpacity(0.1); + return unselectedColor?.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return unselectedColor?.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return unselectedColor?.withOpacity(0.1); + return unselectedColor?.withOpacity(0.12); } } return Colors.transparent; diff --git a/packages/flutter/lib/src/material/slider.dart b/packages/flutter/lib/src/material/slider.dart index 0719926cf6f..c60042ec680 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.surfaceContainerHighest] will be used, otherwise [ColorScheme.primary] + /// [ColorScheme.surfaceVariant] 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.1 when slider thumb + /// slider thumb is hovered and with an opacity of 0.12 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.surfaceContainerHighest; + Color? get inactiveTrackColor => _colors.surfaceVariant; @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.1); + return _colors.primary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.1); + return _colors.primary.withOpacity(0.12); } return Colors.transparent; diff --git a/packages/flutter/lib/src/material/snack_bar.dart b/packages/flutter/lib/src/material/snack_bar.dart index 78e1b2eb81e..dd9f6f876f6 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 35a3dae5507..4bab5708555 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.surfaceContainerHighest.withOpacity(0.12); + return _colors.surfaceVariant.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.surfaceContainerHighest; + return _colors.surfaceVariant; } if (states.contains(MaterialState.hovered)) { - return _colors.surfaceContainerHighest; + return _colors.surfaceVariant; } if (states.contains(MaterialState.focused)) { - return _colors.surfaceContainerHighest; + return _colors.surfaceVariant; } - return _colors.surfaceContainerHighest; + return _colors.surfaceVariant; }); } @@ -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.1); + return _colors.primary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.1); + return _colors.primary.withOpacity(0.12); } return null; } if (states.contains(MaterialState.pressed)) { - return _colors.onSurface.withOpacity(0.1); + return _colors.onSurface.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurface.withOpacity(0.1); + return _colors.onSurface.withOpacity(0.12); } return null; }); @@ -2169,7 +2169,7 @@ class _SwitchConfigM3 with _SwitchConfig { if (states.contains(MaterialState.selected)) { return _colors.onSurface.withOpacity(0.38); } - return _colors.surfaceContainerHighest.withOpacity(0.38); + return _colors.surfaceVariant.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.surfaceContainerHighest; + return _colors.surfaceVariant; } if (states.contains(MaterialState.hovered)) { - return _colors.surfaceContainerHighest; + return _colors.surfaceVariant; } if (states.contains(MaterialState.focused)) { - return _colors.surfaceContainerHighest; + return _colors.surfaceVariant; } - return _colors.surfaceContainerHighest; + return _colors.surfaceVariant; }); } diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart index dd37970fe2d..22edc9d34c8 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 false, [TabBarTheme.dividerColor] + /// If null and [ThemeData.useMaterial3] is true, [TabBarTheme.dividerColor] /// color is used. If that is null and [ThemeData.useMaterial3] is true, - /// [ColorScheme.outlineVariant] will be used, otherwise divider will not be drawn. + /// [ColorScheme.surfaceVariant] will be used, otherwise divider will not be drawn. final Color? dividerColor; /// The height of the divider. @@ -1121,17 +1121,9 @@ 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 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) + /// 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. final MaterialStateProperty? overlayColor; /// {@macro flutter.widgets.scrollable.dragStartBehavior} @@ -2367,11 +2359,9 @@ 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.outlineVariant; + Color? get dividerColor => _colors.surfaceVariant; - // This value comes from Divider widget defaults. Token db deprecated 'primary-navigation-tab.divider.height' token. @override double? get dividerHeight => 1.0; @@ -2395,24 +2385,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.1); + return _colors.primary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.1); + return _colors.primary.withOpacity(0.12); } return null; } if (states.contains(MaterialState.pressed)) { - return _colors.primary.withOpacity(0.1); + return _colors.primary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurface.withOpacity(0.1); + return _colors.onSurface.withOpacity(0.12); } return null; }); @@ -2441,11 +2431,9 @@ 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.outlineVariant; + Color? get dividerColor => _colors.surfaceVariant; - // This value comes from Divider widget defaults. Token db deprecated 'secondary-navigation-tab.divider.height' token. @override double? get dividerHeight => 1.0; @@ -2469,24 +2457,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.1); + return _colors.onSurface.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurface.withOpacity(0.1); + return _colors.onSurface.withOpacity(0.12); } return null; } if (states.contains(MaterialState.pressed)) { - return _colors.onSurface.withOpacity(0.1); + return _colors.onSurface.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.onSurface.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.onSurface.withOpacity(0.1); + return _colors.onSurface.withOpacity(0.12); } return null; }); diff --git a/packages/flutter/lib/src/material/text_button.dart b/packages/flutter/lib/src/material/text_button.dart index 078b44d5127..669217aeec2 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.1) + /// * focused or pressed - Theme.colorScheme.primary(0.12) /// * 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.1); + return primary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { - return primary.withOpacity(0.08); + return primary.withOpacity(0.04); } if (states.contains(MaterialState.focused)) { - return primary.withOpacity(0.1); + return primary.withOpacity(0.12); } 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.1); + return _colors.primary.withOpacity(0.12); } if (states.contains(MaterialState.hovered)) { return _colors.primary.withOpacity(0.08); } if (states.contains(MaterialState.focused)) { - return _colors.primary.withOpacity(0.1); + return _colors.primary.withOpacity(0.12); } return null; }); diff --git a/packages/flutter/lib/src/material/theme_data.dart b/packages/flutter/lib/src/material/theme_data.dart index 73b0c2e0810..e2f69ae00a8 100644 --- a/packages/flutter/lib/src/material/theme_data.dart +++ b/packages/flutter/lib/src/material/theme_data.dart @@ -2654,49 +2654,30 @@ 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(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), + background: Color(0xFFFFFBFE), + onBackground: Color(0xFF1C1B1F), + surface: Color(0xFFFFFBFE), + onSurface: Color(0xFF1C1B1F), surfaceVariant: Color(0xFFE7E0EC), onSurfaceVariant: Color(0xFF49454F), outline: Color(0xFF79747E), outlineVariant: Color(0xFFCAC4D0), shadow: Color(0xFF000000), scrim: Color(0xFF000000), - inverseSurface: Color(0xFF322F35), - onInverseSurface: Color(0xFFF5EFF7), + inverseSurface: Color(0xFF313033), + onInverseSurface: Color(0xFFF4EFF4), inversePrimary: Color(0xFFD0BCFF), // The surfaceTint color is set to the same color as the primary. surfaceTint: Color(0xFF6750A4), @@ -2708,49 +2689,30 @@ 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(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), + background: Color(0xFF1C1B1F), + onBackground: Color(0xFFE6E1E5), + surface: Color(0xFF1C1B1F), + onSurface: Color(0xFFE6E1E5), surfaceVariant: Color(0xFF49454F), onSurfaceVariant: Color(0xFFCAC4D0), outline: Color(0xFF938F99), outlineVariant: Color(0xFF49454F), shadow: Color(0xFF000000), scrim: Color(0xFF000000), - inverseSurface: Color(0xFFE6E0E9), - onInverseSurface: Color(0xFF322F35), + inverseSurface: Color(0xFFE6E1E5), + onInverseSurface: Color(0xFF313033), 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 1fe8d502c43..731417bb862 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.surfaceContainerHigh; + return _colors.surface; } @override @@ -3445,7 +3445,7 @@ class _TimePickerDefaultsM3 extends _TimePickerDefaults { @override Color get dialBackgroundColor { - return _colors.surfaceContainerHighest; + return _colors.surfaceVariant; } @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.1; + const double focusOpacity = 0.12; overlayColor = _colors.onPrimaryContainer.withOpacity(focusOpacity); } return Color.alphaBlend(overlayColor, _colors.primaryContainer); } else { - Color overlayColor = _colors.surfaceContainerHighest; + Color overlayColor = _colors.surfaceVariant; 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.1; + const double focusOpacity = 0.12; overlayColor = _colors.onSurface.withOpacity(focusOpacity); } - return Color.alphaBlend(overlayColor, _colors.surfaceContainerHighest); + return Color.alphaBlend(overlayColor, _colors.surfaceVariant); } }); } diff --git a/packages/flutter/lib/src/material/time_picker_theme.dart b/packages/flutter/lib/src/material/time_picker_theme.dart index 1ba598ada4f..0c104134ec9 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.surfaceContainerHigh]. + /// [ColorScheme.background]. 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.onSurface.withOpacity(0.38), + /// Theme.of(context).colorScheme.onBackground.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.surfaceContainerHighest] color. + /// dial background color defaults [ColorScheme.surfaceVariant] 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 c4194e4e8b5..2e5aee9acbd 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.surface; + /// Color get barrierColor => Theme.of(navigator.context).colorScheme.background; /// ``` /// /// {@end-tool} diff --git a/packages/flutter/test/material/action_chip_test.dart b/packages/flutter/test/material/action_chip_test.dart index a350df4b55a..9006b86bcb8 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); expect( chipMaterial.shape, const RoundedRectangleBorder( @@ -245,7 +245,7 @@ void main() { ); ShapeDecoration decoration = tester.widget(find.byType(Ink)).decoration! as ShapeDecoration; - expect(decoration.color, theme.colorScheme.surfaceContainerLow); + expect(decoration.color, null); // 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); expect( chipMaterial.shape, const RoundedRectangleBorder( diff --git a/packages/flutter/test/material/app_test.dart b/packages/flutter/test/material/app_test.dart index 6ac9981cf1f..d72d990fbd4 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, lightTheme.colorScheme.surface); + expect(tester.widget(find.byType(Material)).color, const Color(0xfffffbfe)); // 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(0xffc3bdc5)); + expect(tester.widget(find.byType(Material)).color, const Color(0xffc6c3c6)); // Let the animation finish. await tester.pumpAndSettle(); // Scaffold background color is fully updated to dark theme. - expect(tester.widget(find.byType(Material)).color, darkTheme.colorScheme.surface); + expect(tester.widget(find.byType(Material)).color, const Color(0xff1c1b1f)); // 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(0xffe7e1e9)); + expect(tester.widget(find.byType(Material)).color, const Color(0xffe9e5e9)); // Let the animation finish. await tester.pumpAndSettle(); // Scaffold background color is fully updated to dark theme. - expect(tester.widget(find.byType(Material)).color, darkTheme.colorScheme.surface); + expect(tester.widget(find.byType(Material)).color, const Color(0xff1c1b1f)); // 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(darkTheme.colorScheme.surface)); - expect(tester.widget(find.byType(Material)).color, lightTheme.colorScheme.surface); + expect(tester.widget(find.byType(Material)).color, isNot(const Color(0xff1c1b1f))); + expect(tester.widget(find.byType(Material)).color, const Color(0xfffffbfe)); }); 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 8a6d2e58f42..ca4c9022d59 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.surfaceContainerLow); - expect(material.surfaceTintColor, Colors.transparent); + expect(material.color, theme.colorScheme.surface); + expect(material.surfaceTintColor, theme.colorScheme.surfaceTint); 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.surfaceContainerLow); - expect(material.surfaceTintColor, Colors.transparent); + expect(material.color, theme.colorScheme.surface); + expect(material.surfaceTintColor, theme.colorScheme.surfaceTint); 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.surfaceContainerLow); + expect(material.color, colorScheme.surface); }); 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.surfaceContainerLow); + expect(material.color, colorScheme.surface); }); 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 3eeff6825b6..9d1916dcf03 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.surfaceContainer, + color: colorScheme.surface, ), ), ), @@ -367,9 +367,8 @@ 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.surfaceContainer, colorScheme.surfaceTint, elevation); - expect(physicalShape.color, isNot(overlayColor)); - expect(physicalShape.color, colorScheme.surfaceContainer); + final Color overlayColor = ElevationOverlay.applySurfaceTint(colorScheme.surface, colorScheme.surfaceTint, elevation); + expect(physicalShape.color, overlayColor); }); // 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 ca0f8651f04..371ca9e13f7 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.surfaceContainer); + expect(widget.color, theme.colorScheme.surface); 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 5ac634e914b..8d1358dcc96 100644 --- a/packages/flutter/test/material/bottom_sheet_test.dart +++ b/packages/flutter/test/material/bottom_sheet_test.dart @@ -944,8 +944,7 @@ void main() { final Material material = tester.widget(finder); expect(material.color, surfaceColor); - // Surface tint is no longer used by default. - expect(material.surfaceTintColor, Colors.transparent); + expect(material.surfaceTintColor, surfaceTintColor); 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 a1a483a4156..bf51ff15bf4 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.surfaceContainerLow); + expect(material.color, theme.colorScheme.surface); 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.surfaceContainerLow); + expect(material.color, theme.colorScheme.surface); }); 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 a0ab6df82c2..64a9e456dc8 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.surfaceContainerLow); + expect(material.color, colors.surface); expect(material.shadowColor, colors.shadow); - expect(material.surfaceTintColor, Colors.transparent); // Don't use surface tint. Toned surface container is used instead. + expect(material.surfaceTintColor, colors.surfaceTint); // Default primary color 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.surfaceContainerHighest); + expect(material.color, colors.surfaceVariant); 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.transparent); + expect(material.surfaceTintColor, colors.surfaceTint); 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 2cb4748f0ec..2e22d13132a 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.surfaceContainerLow); + expect(material.color, theme.colorScheme.surface); expect(material.shadowColor, theme.colorScheme.shadow); - expect(material.surfaceTintColor, Colors.transparent); // Default primary color + expect(material.surfaceTintColor, theme.colorScheme.surfaceTint); // 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.surfaceContainerLow); + expect(material.color, themeData.colorScheme.surface); }); 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 dafa56c2da0..74f89a0a675 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.1)), + paints..circle(color: colors.primary.withOpacity(0.12)), 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.1)), + paints..circle(color: colors.onSurface.withOpacity(0.12)), 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.1)), + paints..circle(color: colors.onSurface.withOpacity(0.12)), 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.1))..path(color: themeData.colorScheme.error)..path(color: themeData.colorScheme.onError) + paints..circle(color: themeData.colorScheme.error.withOpacity(0.12))..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.1)) + ..circle(color: themeData.colorScheme.error.withOpacity(0.12)) ..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 441fac3bc63..04a613dbe95 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); expect( chipMaterial.shape, RoundedRectangleBorder( @@ -269,7 +269,7 @@ void main() { chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, null); - expect(chipMaterial.surfaceTintColor, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); expect( chipMaterial.shape, const RoundedRectangleBorder( @@ -355,7 +355,7 @@ void main() { ); ShapeDecoration decoration = tester.widget(find.byType(Ink)).decoration! as ShapeDecoration; - expect(decoration.color, theme.colorScheme.surfaceContainerLow); + expect(decoration.color, null); // 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); 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 17eba66e0e7..c597a37783a 100644 --- a/packages/flutter/test/material/color_scheme_test.dart +++ b/packages/flutter/test/material/color_scheme_test.dart @@ -249,55 +249,36 @@ 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(0xff36618e)); + expect(scheme.primary, const Color(0xff0061a4)); 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(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.background, const Color(0xfffdfcff)); + expect(scheme.onBackground, const Color(0xff1a1c1e)); + expect(scheme.surface, const Color(0xfffdfcff)); + expect(scheme.onSurface, const Color(0xff1a1c1e)); expect(scheme.surfaceVariant, const Color(0xffdfe2eb)); expect(scheme.onSurfaceVariant, const Color(0xff43474e)); - expect(scheme.inverseSurface, const Color(0xff2e3135)); - expect(scheme.onInverseSurface, const Color(0xffeff0f7)); - expect(scheme.inversePrimary, const Color(0xffa0cafd)); + expect(scheme.inverseSurface, const Color(0xff2f3033)); + expect(scheme.onInverseSurface, const Color(0xfff1f0f4)); + expect(scheme.inversePrimary, const Color(0xff9ecaff)); expect(scheme.shadow, const Color(0xff000000)); expect(scheme.scrim, const Color(0xff000000)); - expect(scheme.surfaceTint, const Color(0xff36618e)); + expect(scheme.surfaceTint, const Color(0xff0061a4)); expect(scheme.brightness, Brightness.light); }); @@ -308,26 +289,14 @@ 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), @@ -335,13 +304,6 @@ 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), @@ -360,26 +322,14 @@ 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)); @@ -387,13 +337,6 @@ 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)); @@ -409,55 +352,36 @@ 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(0xffa0cafd)); + expect(scheme.primary, const Color(0xff9ecaff)); expect(scheme.onPrimary, const Color(0xff003258)); - expect(scheme.primaryContainer, const Color(0xff194975)); + expect(scheme.primaryContainer, const Color(0xff00497d)); 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(0xffffdad6)); + expect(scheme.onErrorContainer, const Color(0xffffb4ab)); expect(scheme.outline, const Color(0xff8d9199)); expect(scheme.outlineVariant, const Color(0xff43474e)); - 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.background, const Color(0xff1a1c1e)); + expect(scheme.onBackground, const Color(0xffe2e2e6)); + expect(scheme.surface, const Color(0xff1a1c1e)); + expect(scheme.onSurface, const Color(0xffe2e2e6)); expect(scheme.surfaceVariant, const Color(0xff43474e)); expect(scheme.onSurfaceVariant, const Color(0xffc3c7cf)); - expect(scheme.inverseSurface, const Color(0xffe1e2e8)); - expect(scheme.onInverseSurface, const Color(0xff2e3135)); - expect(scheme.inversePrimary, const Color(0xff36618e)); + expect(scheme.inverseSurface, const Color(0xffe2e2e6)); + expect(scheme.onInverseSurface, const Color(0xff2f3033)); + expect(scheme.inversePrimary, const Color(0xff0061a4)); expect(scheme.shadow, const Color(0xff000000)); expect(scheme.scrim, const Color(0xff000000)); - expect(scheme.surfaceTint, const Color(0xffa0cafd)); + expect(scheme.surfaceTint, const Color(0xff9ecaff)); expect(scheme.brightness, Brightness.dark); }); @@ -473,26 +397,14 @@ 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); @@ -502,13 +414,6 @@ 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); @@ -529,55 +434,36 @@ void main() { await ColorScheme.fromImageProvider(provider: image); expect(scheme.brightness, Brightness.light); - expect(scheme.primary, const Color(0xff575992)); + expect(scheme.primary, const Color(0xff4040f3)); expect(scheme.onPrimary, const Color(0xffffffff)); expect(scheme.primaryContainer, const Color(0xffe1e0ff)); - 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.onPrimaryContainer, const Color(0xff06006c)); 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(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.background, const Color(0xfffffbff)); + expect(scheme.onBackground, const Color(0xff1c1b1f)); + expect(scheme.surface, const Color(0xfffffbff)); + expect(scheme.onSurface, const Color(0xff1c1b1f)); 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(0xff303036)); - expect(scheme.onInverseSurface, const Color(0xfff3eff7)); + expect(scheme.inverseSurface, const Color(0xff313034)); + expect(scheme.onInverseSurface, const Color(0xfff3eff4)); expect(scheme.inversePrimary, const Color(0xffc0c1ff)); - expect(scheme.surfaceTint, const Color(0xff575992)); + expect(scheme.surfaceTint, const Color(0xff4040f3)); }, skip: isBrowser, // [intended] uses dart:typed_data. ); @@ -589,51 +475,32 @@ void main() { provider: image, brightness: Brightness.dark); expect(scheme.primary, const Color(0xffc0c1ff)); - expect(scheme.onPrimary, const Color(0xff292a60)); - expect(scheme.primaryContainer, const Color(0xff3f4178)); + expect(scheme.onPrimary, const Color(0xff0f00aa)); + expect(scheme.primaryContainer, const Color(0xff2218dd)); 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(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.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.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(0xffe4e1e9)); - expect(scheme.onInverseSurface, const Color(0xff303036)); - expect(scheme.inversePrimary, const Color(0xff575992)); + expect(scheme.inverseSurface, const Color(0xffe5e1e6)); + expect(scheme.onInverseSurface, const Color(0xff313034)); + expect(scheme.inversePrimary, const Color(0xff4040f3)); 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 177a79800e9..48d90f42708 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.surfaceContainerHigh); + expect(dialogMaterial.color, theme.colorScheme.surface); expect(dialogMaterial.shadowColor, Colors.transparent); - expect(dialogMaterial.surfaceTintColor, Colors.transparent); + expect(dialogMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); 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.1) : theme.colorScheme.onSurfaceVariant.withOpacity(0.12)) + paints..circle()..circle(color: material3 ? theme.colorScheme.onSurfaceVariant.withOpacity(0.12) : 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 571af49df84..58bb87aed2b 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.surfaceContainerHigh); + expect(m3.backgroundColor, colorScheme.surface); expect(m3.elevation, 6); expect(m3.shadowColor, const Color(0x00000000)); // Colors.transparent - expect(m3.surfaceTintColor, Colors.transparent); + expect(m3.surfaceTintColor, colorScheme.surfaceTint); 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.1)); + expect(m3.dayOverlayColor?.resolve({MaterialState.selected, MaterialState.focused}), colorScheme.onPrimary.withOpacity(0.12)); expect(m3.dayOverlayColor?.resolve({MaterialState.hovered}), colorScheme.onSurfaceVariant.withOpacity(0.08)); - 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.focused}), colorScheme.onSurfaceVariant.withOpacity(0.12)); + expect(m3.dayOverlayColor?.resolve({MaterialState.pressed}), colorScheme.onSurfaceVariant.withOpacity(0.12)); 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.1)); + expect(m3.dayOverlayColor?.resolve({MaterialState.selected, MaterialState.hovered, MaterialState.pressed}), colorScheme.onPrimary.withOpacity(0.12)); 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.1)); + expect(m3.dayOverlayColor?.resolve({MaterialState.hovered, MaterialState.pressed}), colorScheme.onSurfaceVariant.withOpacity(0.12)); 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.1)); + expect(m3.yearOverlayColor?.resolve({MaterialState.selected, MaterialState.focused}), colorScheme.onPrimary.withOpacity(0.12)); expect(m3.yearOverlayColor?.resolve({MaterialState.hovered}), colorScheme.onSurfaceVariant.withOpacity(0.08)); - expect(m3.yearOverlayColor?.resolve({MaterialState.focused}), colorScheme.onSurfaceVariant.withOpacity(0.1)); - expect(m3.yearOverlayColor?.resolve({MaterialState.pressed}), colorScheme.onSurfaceVariant.withOpacity(0.1)); + expect(m3.yearOverlayColor?.resolve({MaterialState.focused}), colorScheme.onSurfaceVariant.withOpacity(0.12)); + expect(m3.yearOverlayColor?.resolve({MaterialState.pressed}), colorScheme.onSurfaceVariant.withOpacity(0.12)); 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 44b9a7611b3..eb5b71f311e 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.surfaceContainerHigh); + expect(dialogMaterial.color, theme.colorScheme.surface); 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.surfaceContainerHigh); + expect(dialogMaterial.color, theme.colorScheme.surface); 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.surfaceContainerHigh); + expect(dialogMaterial.color, theme.colorScheme.surface); expect(dialogMaterial.shadowColor, Colors.transparent); - expect(dialogMaterial.surfaceTintColor, Colors.transparent); + expect(dialogMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); 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 6b3bf17eedf..c7a24d2d483 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.surfaceContainerLow); + expect(_drawerMaterial(tester).color, theme.colorScheme.surface); expect(_drawerMaterial(tester).elevation, 1.0); expect(_drawerMaterial(tester).shadowColor, Colors.transparent); - expect(_drawerMaterial(tester).surfaceTintColor, Colors.transparent); + expect(_drawerMaterial(tester).surfaceTintColor, theme.colorScheme.surfaceTint); 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.surfaceContainerLow); + expect(_drawerMaterial(tester).color, theme.colorScheme.surface); expect(_drawerMaterial(tester).elevation, 1.0); expect(_drawerMaterial(tester).shadowColor, Colors.transparent); - expect(_drawerMaterial(tester).surfaceTintColor, Colors.transparent); + expect(_drawerMaterial(tester).surfaceTintColor, theme.colorScheme.surfaceTint); 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 243e59e4f8f..683ca4f08c4 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.surfaceContainer); + expect(material.color, themeData.colorScheme.surface); expect(material.shadowColor, themeData.colorScheme.shadow); - expect(material.surfaceTintColor, Colors.transparent); + expect(material.surfaceTintColor, themeData.colorScheme.surfaceTint); 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 432f7864f4f..2c02c78684f 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.surfaceContainer); + expect(material.color, themeData.colorScheme.surface); expect(material.shadowColor, themeData.colorScheme.shadow); - expect(material.surfaceTintColor, Colors.transparent); + expect(material.surfaceTintColor, themeData.colorScheme.surfaceTint); 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 2e9d958bebf..f3042f50030 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.1))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.primary.withOpacity(0.12))); // 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.1))); + expect(overlayColor(), paints..rect(color: theme.colorScheme.primary.withOpacity(0.12))); 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 4645c5040dd..1957b746387 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.1)); - expect(inkWell.overlayColor!.resolve(pressed), foregroundColor.withOpacity(0.1)); + expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.24)); + expect(inkWell.overlayColor!.resolve(pressed), foregroundColor.withOpacity(0.24)); 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 e0dcc9f26b5..0827808d04f 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.1))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onPrimary.withOpacity(0.12))); // 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.1))); + expect(overlayColor(), paints..rect(color: theme.colorScheme.onPrimary.withOpacity(0.12))); 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.1))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSecondaryContainer.withOpacity(0.12))); // 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.1))); + expect(overlayColor(), paints..rect(color: theme.colorScheme.onSecondaryContainer.withOpacity(0.12))); 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 e3a5fa5b57e..5b0d7c4dbe5 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.1)); - expect(inkWell.overlayColor!.resolve(pressed), foregroundColor.withOpacity(0.1)); + expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.12)); + expect(inkWell.overlayColor!.resolve(pressed), foregroundColor.withOpacity(0.12)); 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 ec24e44d430..0265c6bc496 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); expect( chipMaterial.shape, RoundedRectangleBorder( @@ -334,7 +334,7 @@ void main() { chipMaterial = getMaterial(tester); expect(chipMaterial.elevation, 0); expect(chipMaterial.shadowColor, null); - expect(chipMaterial.surfaceTintColor, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); expect( chipMaterial.shape, const RoundedRectangleBorder( @@ -420,7 +420,7 @@ void main() { ); ShapeDecoration decoration = tester.widget(find.byType(Ink)).decoration! as ShapeDecoration; - expect(decoration.color, theme.colorScheme.surfaceContainerLow); + expect(decoration.color, null); // 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); 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, Colors.transparent); + expect(chipMaterial.surfaceTintColor, theme.colorScheme.surfaceTint); 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 17c62e7c660..f3d54f69957 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.1)); + expect(_getRawMaterialButton(tester).splashColor, colorScheme.onPrimaryContainer.withOpacity(0.12)); 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 2a74cf2764d..80d91f9e0ed 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.1))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSurfaceVariant.withOpacity(0.12))); // 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.1))); + expect(overlayColor(), paints..rect(color: theme.colorScheme.onSurfaceVariant.withOpacity(0.12))); 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.1))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onPrimary.withOpacity(0.12))); // 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.1))); + expect(overlayColor(), paints..rect(color: theme.colorScheme.onPrimary.withOpacity(0.12))); 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.1))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSecondaryContainer.withOpacity(0.12))); // 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.1))); + expect(overlayColor(), paints..rect(color: theme.colorScheme.onSecondaryContainer.withOpacity(0.12))); 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.1))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSurface.withOpacity(0.12))); // 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 4acf1807f82..7cc64cf8744 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.1)); - expect(inkWell.overlayColor!.resolve(pressed), foregroundColor.withOpacity(0.1)); + expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.08)); + expect(inkWell.overlayColor!.resolve(pressed), foregroundColor.withOpacity(0.12)); 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 5b5947a40eb..5e7dd859348 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(0xfff7f2fa)) + ..path(color: const Color(0xffece6f3)) ..save() ..save(), ); @@ -1394,7 +1394,7 @@ void main() { find.byType(Material), paints ..path(color: const Color(0xff000000)) - ..path(color: const Color(0xfff7f2fa)) + ..path(color: const Color(0xffece6f3)) ..save() ..save(), ); diff --git a/packages/flutter/test/material/menu_anchor_test.dart b/packages/flutter/test/material/menu_anchor_test.dart index 88d7620d7ac..56ce7b4f54f 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.surfaceContainer); + expect(material.color, themeData.colorScheme.surface); expect(material.shadowColor, themeData.colorScheme.shadow); - expect(material.surfaceTintColor, Colors.transparent); + expect(material.surfaceTintColor, themeData.colorScheme.surfaceTint); 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.surfaceContainer); + expect(material.color, themeData.colorScheme.surface); expect(material.shadowColor, themeData.colorScheme.shadow); - expect(material.surfaceTintColor, Colors.transparent); + expect(material.surfaceTintColor, themeData.colorScheme.surfaceTint); 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.surfaceContainer); + expect(material.color, themeData.colorScheme.surface); expect(material.shadowColor, themeData.colorScheme.shadow); - expect(material.surfaceTintColor, Colors.transparent); + expect(material.surfaceTintColor, themeData.colorScheme.surfaceTint); 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.surfaceContainer); + expect(material.color, themeData.colorScheme.surface); expect(material.shadowColor, themeData.colorScheme.shadow); - expect(material.surfaceTintColor, Colors.transparent); + expect(material.surfaceTintColor, themeData.colorScheme.surfaceTint); 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 1974e259059..1abd469b22f 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.surfaceContainer); - expect(_getMaterial(tester).surfaceTintColor, Colors.transparent); + expect(_getMaterial(tester).color, theme.colorScheme.surface); + expect(_getMaterial(tester).surfaceTintColor, theme.colorScheme.surfaceTint); 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 849ce1fe60d..1d571afaae2 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.surfaceContainerLow); - expect(_getMaterial(tester).surfaceTintColor, Colors.transparent); + expect(_getMaterial(tester).color, theme.colorScheme.surface); + expect(_getMaterial(tester).surfaceTintColor, theme.colorScheme.surfaceTint); 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 dea6254965c..dd4e2cab29e 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(0xfffef7ff))); // default surface color in M3 colorScheme + expect(_railMaterial(tester).color, equals(const Color(0xFFFFFBFE))); // 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 8fb94679ed6..3bef05df9f0 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.1))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.primary.withOpacity(0.12))); // 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.1))); + expect(overlayColor(), paints..rect(color: theme.colorScheme.primary.withOpacity(0.12))); 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 3d71ca4ceef..93e10033f75 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.08)); - expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.1)); + expect(inkWell.overlayColor!.resolve(hovered), foregroundColor.withOpacity(0.04)); + expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.12)); 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 302e82c33e1..ccdf0cbf890 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.surfaceContainer); + expect(button.color, theme.colorScheme.surface); expect(button.shadowColor, theme.colorScheme.shadow); - expect(button.surfaceTintColor, Colors.transparent); + expect(button.surfaceTintColor, theme.colorScheme.surfaceTint); 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 4ba8c476333..33f12724d06 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.1))..circle(color: focusedFillColor), + paints..rect()..circle(color: theme.colorScheme.primary.withOpacity(0.12))..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.1)) + paints..circle(color: colors.onSurface.withOpacity(0.12)) ..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.1))..circle(color: colors.onSurfaceVariant.withOpacity(1)) + paints..circle(color: colors.primary.withOpacity(0.12))..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.1))..circle(color: colors.primary.withOpacity(1)) + paints..circle(color: colors.primary.withOpacity(0.12))..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.1))..circle(color: colors.onSurface.withOpacity(1)) + paints..circle(color: colors.onSurface.withOpacity(0.12))..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.1)) + ..circle(color: theme.colorScheme.onSurface.withOpacity(0.12)) ..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.1)) + ..circle(color: theme.colorScheme.primary.withOpacity(0.12)) ..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 759e466a0d6..907ec3684ea 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.surfaceContainerHigh); - expect(material.surfaceTintColor, Colors.transparent); + expect(material.color, colorScheme.surface); + expect(material.surfaceTintColor, colorScheme.surfaceTint); 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.surfaceContainerHigh); + expect(material.color, theme.colorScheme.surface); // 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.surfaceContainerHigh); + expect(material.color, theme.colorScheme.surface); }); 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.surfaceContainerHigh); + expect(searchViewMaterial.color, localTheme.colorScheme.surface); // 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.surfaceContainerHigh); + expect(material.color, colorScheme.surface); expect(material.elevation, 6.0); expect(material.shadowColor, colorScheme.shadow); - expect(material.surfaceTintColor, Colors.transparent); + expect(material.surfaceTintColor, colorScheme.surfaceTint); 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 0fc3cadf57c..ce4dda4d2f6 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.1))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSurface.withOpacity(0.12))); 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 34c50025c56..f422c0449bf 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('Material3 - Slider is focusable and has correct focus color', (WidgetTester tester) async { + testWidgets('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: true); 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.1)), + paints..circle(color: theme.colorScheme.primary.withOpacity(0.12)), ); // 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.1))), + isNot(paints..circle(color: theme.colorScheme.primary.withOpacity(0.12))), ); }); @@ -1941,10 +1941,10 @@ void main() { ); }); - testWidgets('Material3 - Slider is draggable and has correct dragged color', (WidgetTester tester) async { + testWidgets('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: true); 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.1))), + isNot(paints..circle(color: theme.colorScheme.primary.withOpacity(0.12))), ); // 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.1)), + paints..circle(color: theme.colorScheme.primary.withOpacity(0.12)), ); 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.1))), + isNot(paints..circle(color: theme.colorScheme.primary.withOpacity(0.12))), ); // 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.1)), + paints..circle(color: theme.colorScheme.primary.withOpacity(0.12)), ); }); @@ -3859,15 +3859,14 @@ void main() { ); }); - testWidgets('Material2 - Slider is focusable and has correct focus color', (WidgetTester tester) async { + testWidgets('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: false); + final ThemeData theme = ThemeData(); double value = 0.5; Widget buildApp({bool enabled = true}) { return MaterialApp( - theme: theme, home: Material( child: Center( child: StatefulBuilder(builder: (BuildContext context, StateSetter setState) { @@ -3908,17 +3907,16 @@ void main() { ); }); - testWidgets('Material2 - Slider is draggable and has correct dragged color', (WidgetTester tester) async { + testWidgets('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: false); + final ThemeData theme = ThemeData(); 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 ee191cae781..d389b983914 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.surfaceContainerHighest; + final Color inactiveTrackColor = colorScheme.surfaceVariant; 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(0xfffef7ff)) + ..rrect(color: const Color(0xfffffbfe)) ..rrect(color: const Color(0xff6750a4)) - ..rrect(color: const Color(0xffe6e0e9)) + ..rrect(color: const Color(0xffe7e0ec)) ..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 3e690c12d54..596a749c97a 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.surfaceContainerHighest, + color: colors.surfaceVariant, 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.surfaceContainerHighest, + color: colors.surfaceVariant, 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.surfaceContainerHighest.withOpacity(0.12), + color: colors.surfaceVariant.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.1)) + paints..circle(color: theme.colorScheme.primary.withOpacity(0.12)) ); // 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.surfaceContainerHighest, + color: colors.surfaceVariant, 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.surfaceContainerHighest.withOpacity(0.12), + color: colors.surfaceVariant.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.surfaceContainerHighest.withOpacity(0.12), + color: colors.surfaceVariant.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.surfaceContainerHighest, + color: colors.surfaceVariant, 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.1)) + ..circle(color: colors.primary.withOpacity(0.12)) ..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.surfaceContainerHighest, // track color + color: colors.surfaceVariant, // 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.surfaceContainerHighest.withOpacity(0.12), // track color + color: colors.surfaceVariant.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 103c521dfc2..dcb4fbfdd74 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.outlineVariant, + color: theme.colorScheme.surfaceVariant, strokeWidth: 1.0, ) ..rrect(color: theme.colorScheme.primary), @@ -209,7 +209,7 @@ void main() { tabBarBox, paints ..line( - color: theme.colorScheme.outlineVariant, + color: theme.colorScheme.surfaceVariant, strokeWidth: 1.0, ) ..line(color: theme.colorScheme.primary), @@ -637,7 +637,7 @@ void main() { paints // Divider. ..line( - color: theme.colorScheme.outlineVariant, + color: theme.colorScheme.surfaceVariant, strokeWidth: 1.0, ) // Tab indicator. @@ -691,7 +691,7 @@ void main() { paints // Divider. ..line( - color: theme.colorScheme.outlineVariant, + color: theme.colorScheme.surfaceVariant, strokeWidth: 1.0, ) // Tab indicator diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart index 71194efaa77..518f36ba7a3 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.outlineVariant : Colors.blue[500])); + expect(find.byType(TabBar), paints..line(color: material3 ? theme.colorScheme.surfaceVariant : 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.outlineVariant : Colors.white)); + expect(find.byType(TabBar), paints..line(color: material3 ? theme.colorScheme.surfaceVariant : 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.outlineVariant : Colors.blue[500])); + expect(find.byType(TabBar), paints..line(color: material3 ? theme.colorScheme.surfaceVariant : 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.outlineVariant, + color: theme.colorScheme.surfaceVariant, ) // 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.1))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.primary.withOpacity(0.12))); 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.1))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.primary.withOpacity(0.12))); 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.1))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSurface.withOpacity(0.12))); 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.1))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.onSurface.withOpacity(0.12))); }); 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.outlineVariant : Colors.white, + color: material3 ? theme.colorScheme.surfaceVariant : 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.outlineVariant : const Color(0xff2196f3), + color: material3 ? theme.colorScheme.surfaceVariant : const Color(0xff2196f3), )); }); @@ -6192,14 +6192,14 @@ void main() { inkFeatures, isNot(paints ..rect( - color: theme.colorScheme.onSurface.withOpacity(0.1), + color: theme.colorScheme.onSurface.withOpacity(0.12), )) ); expect( inkFeatures, isNot(paints ..rect( - color: theme.colorScheme.primary.withOpacity(0.1), + color: theme.colorScheme.primary.withOpacity(0.12), )) ); @@ -6210,7 +6210,7 @@ void main() { inkFeatures, paints ..rect( - color: theme.colorScheme.onSurface.withOpacity(0.1), + color: theme.colorScheme.onSurface.withOpacity(0.12), ), ); @@ -6221,7 +6221,7 @@ void main() { inkFeatures, paints ..rect( - color: theme.colorScheme.primary.withOpacity(0.1), + color: theme.colorScheme.primary.withOpacity(0.12), ), ); }); @@ -6241,7 +6241,7 @@ void main() { inkFeatures, isNot(paints ..rect( - color: theme.colorScheme.primary.withOpacity(0.1), + color: theme.colorScheme.primary.withOpacity(0.12), )) ); @@ -6252,7 +6252,7 @@ void main() { inkFeatures, paints ..rect( - color: theme.colorScheme.primary.withOpacity(0.1), + color: theme.colorScheme.primary.withOpacity(0.12), ), ); @@ -6267,7 +6267,7 @@ void main() { inkFeatures, paints ..rect( - color: theme.colorScheme.primary.withOpacity(0.1), + color: theme.colorScheme.primary.withOpacity(0.12), ), ); }); diff --git a/packages/flutter/test/material/text_button_test.dart b/packages/flutter/test/material/text_button_test.dart index dad9b2771dc..6d7e3e84212 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.1))); + expect(overlayColor(), paints..rect()..rect(color: theme.colorScheme.primary.withOpacity(0.12))); // 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.1))); + expect(overlayColor(), paints..rect(color: theme.colorScheme.primary.withOpacity(0.12))); 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 298febae522..c80ee7a82ae 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.08)); - expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.1)); + expect(inkWell.overlayColor!.resolve(hovered), foregroundColor.withOpacity(0.04)); + expect(inkWell.overlayColor!.resolve(focused), foregroundColor.withOpacity(0.12)); 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 4b54b4b0f9d..7d21bf9841b 100644 --- a/packages/flutter/test/material/theme_data_test.dart +++ b/packages/flutter/test/material/theme_data_test.dart @@ -138,55 +138,34 @@ void main() { test('ThemeData can generate a light colorScheme from colorSchemeSeed', () { final ThemeData theme = ThemeData(colorSchemeSeed: Colors.blue); - expect(theme.colorScheme.primary, const Color(0xff36618e)); + expect(theme.colorScheme.primary, const Color(0xff0061a4)); 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.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.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.surfaceVariant, const Color(0xffdfe2eb)); expect(theme.colorScheme.onSurfaceVariant, const Color(0xff43474e)); - expect(theme.colorScheme.inverseSurface, const Color(0xff2e3135)); - expect(theme.colorScheme.onInverseSurface, const Color(0xffeff0f7)); - expect(theme.colorScheme.inversePrimary, const Color(0xffa0cafd)); + expect(theme.colorScheme.inverseSurface, const Color(0xff2f3033)); + expect(theme.colorScheme.onInverseSurface, const Color(0xfff1f0f4)); + expect(theme.colorScheme.inversePrimary, const Color(0xff9ecaff)); expect(theme.colorScheme.shadow, const Color(0xff000000)); - expect(theme.colorScheme.scrim, const Color(0xff000000)); - expect(theme.colorScheme.surfaceTint, const Color(0xff36618e)); + expect(theme.colorScheme.surfaceTint, const Color(0xff0061a4)); expect(theme.colorScheme.brightness, Brightness.light); expect(theme.primaryColor, theme.colorScheme.primary); @@ -208,55 +187,34 @@ void main() { brightness: Brightness.dark, ); - expect(theme.colorScheme.primary, const Color(0xffa0cafd)); + expect(theme.colorScheme.primary, const Color(0xff9ecaff)); expect(theme.colorScheme.onPrimary, const Color(0xff003258)); - expect(theme.colorScheme.primaryContainer, const Color(0xff194975)); + expect(theme.colorScheme.primaryContainer, const Color(0xff00497d)); 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(0xffffdad6)); + expect(theme.colorScheme.onErrorContainer, const Color(0xffffb4ab)); expect(theme.colorScheme.outline, const Color(0xff8d9199)); - 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.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.surfaceVariant, const Color(0xff43474e)); expect(theme.colorScheme.onSurfaceVariant, const Color(0xffc3c7cf)); - expect(theme.colorScheme.inverseSurface, const Color(0xffe1e2e8)); - expect(theme.colorScheme.onInverseSurface, const Color(0xff2e3135)); - expect(theme.colorScheme.inversePrimary, const Color(0xff36618e)); + expect(theme.colorScheme.inverseSurface, const Color(0xffe2e2e6)); + expect(theme.colorScheme.onInverseSurface, const Color(0xff2f3033)); + expect(theme.colorScheme.inversePrimary, const Color(0xff0061a4)); expect(theme.colorScheme.shadow, const Color(0xff000000)); - expect(theme.colorScheme.scrim, const Color(0xff000000)); - expect(theme.colorScheme.surfaceTint, const Color(0xffa0cafd)); + expect(theme.colorScheme.surfaceTint, const Color(0xff9ecaff)); expect(theme.colorScheme.brightness, Brightness.dark); expect(theme.primaryColor, theme.colorScheme.surface); @@ -275,53 +233,34 @@ 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.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.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.brightness, Brightness.light); expect(theme.primaryColor, theme.colorScheme.primary); @@ -341,53 +280,34 @@ 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.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.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.brightness, Brightness.light); expect(theme.primaryColor, theme.colorScheme.primary); @@ -406,53 +326,35 @@ 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.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.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.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 066f3d467a2..d8d71a86c3a 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(0xfffef7ff)); // ColorScheme.background + expect(themeM3.scaffoldBackgroundColor, const Color(0xfffffbfe)); // 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(0xff141218)); + expect(themeM3.scaffoldBackgroundColor, const Color(0xff1c1b1f)); 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 9a319e22beb..295e3a8d529 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.surfaceContainerHighest) // Dial background color. + ..circle(color: theme.colorScheme.surfaceVariant) // Dial background color. ..circle(color: Color(theme.colorScheme.primary.value)), // Dial hand color. ); @@ -284,7 +284,7 @@ void main() { expect( dial, paints - ..circle(color: theme.colorScheme.surfaceContainerHighest) // Dial background color. + ..circle(color: const Color(0xffff0000)) // 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 a4098d4d24a..182ec807949 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.surfaceContainerHigh); + expect(dialogMaterial.color, defaultTheme.colorScheme.surface); 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.surfaceContainerHighest) // Dial background color. + ..circle(color: defaultTheme.colorScheme.surfaceVariant) // 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.surfaceContainerHighest); + expect(minuteMaterial.color, defaultTheme.colorScheme.surfaceVariant); 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.surfaceContainerHighest); + expect(hourDecoration.fillColor, defaultTheme.colorScheme.surfaceVariant); 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(0xff1d1b20)), + .copyWith(color: _selectedColor, decorationColor: const Color(0xff1c1b1f)), ); 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(0xff1d1b20)), + .copyWith(color: _unselectedColor, decorationColor: const Color(0xff1c1b1f)), ); 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(0xff1d1b20)), + .copyWith(color: _selectedColor, decorationColor: const Color(0xff1c1b1f)), ); 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(0xff1d1b20)), + .copyWith(color: _unselectedColor, decorationColor: const Color(0xff1c1b1f)), ); 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 6eac3918adb..877d09d9b93 100644 --- a/packages/flutter/test_fixes/material/color_scheme.dart +++ b/packages/flutter/test_fixes/material/color_scheme.dart @@ -15,22 +15,4 @@ 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 dc73ce0692c..b270083dfbe 100644 --- a/packages/flutter/test_fixes/material/color_scheme.dart.expect +++ b/packages/flutter/test_fixes/material/color_scheme.dart.expect @@ -15,22 +15,4 @@ 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 e21ac79faf8..9430d934e38 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(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(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(otherParam: ''); - 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(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(otherParam: ''); - themeData = themeData.copyWith(colorScheme: ColorScheme(surface: Colors.grey)); + themeData = themeData.copyWith(colorScheme: ColorScheme(background: Colors.grey)); themeData = themeData.copyWith(otherParam: ''); - 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; + 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; // Changes made in https://github.com/flutter/flutter/pull/110162 ThemeData themeData = ThemeData(); - 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)); + 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)); // 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 6f58d05144d..2bf455c290f 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.16 for a font ' + 'Expected contrast ratio of at least 4.5 but found 1.19 for a font ' 'size of 14.0.\n' 'The computed colors was:\n' - 'light - Color(0xfffef7ff), dark - Color(0xffffeb3b)\n' + 'light - Color(0xfffffbfe), dark - Color(0xffffeb3b)\n' 'See also: https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html', ); handle.dispose();