Skip to content

Commit 0d8eafb

Browse files
authored
Reland "Reland - Introduce tone-based surfaces and accent color add-ons - Part 2" (flutter#144273)
1 parent 88f7571 commit 0d8eafb

File tree

181 files changed

+2517
-997
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+2517
-997
lines changed

dev/benchmarks/macrobenchmarks/lib/src/web/material3.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ class Cards extends StatelessWidget {
443443
SizedBox(
444444
width: cardWidth,
445445
child: Card(
446-
color: Theme.of(context).colorScheme.surfaceVariant,
446+
color: Theme.of(context).colorScheme.surfaceContainerHighest,
447447
elevation: 0,
448448
child: Container(
449449
padding: const EdgeInsets.fromLTRB(10, 5, 5, 10),
@@ -1279,7 +1279,7 @@ class _IconToggleButtonState extends State<IconToggleButton> {
12791279
ButtonStyle enabledFilledButtonStyle(bool selected, ColorScheme colors) {
12801280
return IconButton.styleFrom(
12811281
foregroundColor: selected ? colors.onPrimary : colors.primary,
1282-
backgroundColor: selected ? colors.primary : colors.surfaceVariant,
1282+
backgroundColor: selected ? colors.primary : colors.surfaceContainerHighest,
12831283
disabledForegroundColor: colors.onSurface.withOpacity(0.38),
12841284
disabledBackgroundColor: colors.onSurface.withOpacity(0.12),
12851285
hoverColor: selected
@@ -1306,7 +1306,7 @@ ButtonStyle enabledFilledTonalButtonStyle(bool selected, ColorScheme colors) {
13061306
foregroundColor:
13071307
selected ? colors.onSecondaryContainer : colors.onSurfaceVariant,
13081308
backgroundColor:
1309-
selected ? colors.secondaryContainer : colors.surfaceVariant,
1309+
selected ? colors.secondaryContainer : colors.surfaceContainerHighest,
13101310
hoverColor: selected
13111311
? colors.onSecondaryContainer.withOpacity(0.08)
13121312
: colors.onSurfaceVariant.withOpacity(0.08),
@@ -2350,7 +2350,7 @@ class ComponentGroupDecoration extends StatelessWidget {
23502350
child: Card(
23512351
margin: EdgeInsets.zero,
23522352
elevation: 0,
2353-
color: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.3),
2353+
color: Theme.of(context).colorScheme.surfaceContainerHighest.withOpacity(0.3),
23542354
child: Padding(
23552355
padding: const EdgeInsets.symmetric(vertical: 20.0),
23562356
child: Center(

dev/integration_tests/flutter_gallery/lib/demo/calculator/home.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class KeyPad extends StatelessWidget {
202202
),
203203
Expanded(
204204
child: Material(
205-
color: themeData.colorScheme.background,
205+
color: themeData.colorScheme.surface,
206206
child: Column(
207207
children: <Widget>[
208208
CalcKey('\u232B', calcState!.handleDelTap),

dev/integration_tests/flutter_gallery/lib/demo/material/chip_demo.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class _ChipDemoState extends State<ChipDemo> {
203203
assert(name.length > 1);
204204
final int hash = name.hashCode & 0xffff;
205205
final double hue = (360.0 * hash / (1 << 15)) % 360.0;
206-
final double themeValue = HSVColor.fromColor(theme.colorScheme.background).value;
206+
final double themeValue = HSVColor.fromColor(theme.colorScheme.surface).value;
207207
return HSVColor.fromAHSV(1.0, hue, 0.4, themeValue).toColor();
208208
}
209209

dev/integration_tests/flutter_gallery/lib/demo/shrine/app.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,10 @@ const ColorScheme kShrineColorScheme = ColorScheme(
114114
primary: kShrinePink100,
115115
secondary: kShrinePink50,
116116
surface: kShrineSurfaceWhite,
117-
background: kShrineBackgroundWhite,
118117
error: kShrineErrorRed,
119118
onPrimary: kShrineBrown900,
120119
onSecondary: kShrineBrown900,
121120
onSurface: kShrineBrown900,
122-
onBackground: kShrineBrown900,
123121
onError: kShrineSurfaceWhite,
124122
brightness: Brightness.light,
125123
);

dev/integration_tests/flutter_gallery/lib/gallery/themes.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ThemeData _buildDarkTheme() {
2323
secondary: secondaryColor,
2424
onPrimary: Colors.white,
2525
error: const Color(0xFFB00020),
26-
background: const Color(0xFF202124),
26+
surface: const Color(0xFF202124),
2727
);
2828
final ThemeData base = ThemeData(
2929
useMaterial3: false,

dev/tools/gen_defaults/data/badge.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "v0_162",
2+
"version": "v0_206",
33

44
"md.comp.badge.color": "error",
55
"md.comp.badge.large.color": "error",

dev/tools/gen_defaults/data/banner.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
2-
"version": "v0_162",
2+
"version": "v0_206",
33

4-
"md.comp.banner.container.color": "surface",
4+
"md.comp.banner.container.color": "surfaceContainerLow",
55
"md.comp.banner.container.elevation": "md.sys.elevation.level1",
66
"md.comp.banner.container.shape": "md.sys.shape.corner.none",
7-
"md.comp.banner.container.surface-tint-layer.color": "surfaceTint",
87
"md.comp.banner.desktop.with-single-line.container.height": 52.0,
98
"md.comp.banner.desktop.with-three-lines.container.height": 90.0,
109
"md.comp.banner.desktop.with-two-lines.with-image.container.height": 72.0,
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
2-
"version": "v0_162",
2+
"version": "v0_206",
33

4-
"md.comp.bottom-app-bar.container.color": "surface",
4+
"md.comp.bottom-app-bar.container.color": "surfaceContainer",
55
"md.comp.bottom-app-bar.container.elevation": "md.sys.elevation.level2",
66
"md.comp.bottom-app-bar.container.height": 80.0,
7-
"md.comp.bottom-app-bar.container.shape": "md.sys.shape.corner.none",
8-
"md.comp.bottom-app-bar.container.surface-tint-layer.color": "surfaceTint"
7+
"md.comp.bottom-app-bar.container.shape": "md.sys.shape.corner.none"
98
}

dev/tools/gen_defaults/data/button_elevated.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
{
2-
"version": "v0_162",
2+
"version": "v0_206",
33

4-
"md.comp.elevated-button.container.color": "surface",
4+
"md.comp.elevated-button.container.color": "surfaceContainerLow",
55
"md.comp.elevated-button.container.elevation": "md.sys.elevation.level1",
66
"md.comp.elevated-button.container.height": 40.0,
77
"md.comp.elevated-button.container.shadow-color": "shadow",
88
"md.comp.elevated-button.container.shape": "md.sys.shape.corner.full",
9-
"md.comp.elevated-button.container.surface-tint-layer.color": "surfaceTint",
109
"md.comp.elevated-button.disabled.container.color": "onSurface",
1110
"md.comp.elevated-button.disabled.container.elevation": "md.sys.elevation.level0",
1211
"md.comp.elevated-button.disabled.container.opacity": 0.12,
1312
"md.comp.elevated-button.disabled.label-text.color": "onSurface",
1413
"md.comp.elevated-button.disabled.label-text.opacity": 0.38,
1514
"md.comp.elevated-button.focus.container.elevation": "md.sys.elevation.level1",
15+
"md.comp.elevated-button.focus.indicator.color": "secondary",
16+
"md.comp.elevated-button.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset",
17+
"md.comp.elevated-button.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness",
1618
"md.comp.elevated-button.focus.label-text.color": "primary",
1719
"md.comp.elevated-button.focus.state-layer.color": "primary",
1820
"md.comp.elevated-button.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity",

dev/tools/gen_defaults/data/button_filled.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "v0_162",
2+
"version": "v0_206",
33

44
"md.comp.filled-button.container.color": "primary",
55
"md.comp.filled-button.container.elevation": "md.sys.elevation.level0",
@@ -12,6 +12,9 @@
1212
"md.comp.filled-button.disabled.label-text.color": "onSurface",
1313
"md.comp.filled-button.disabled.label-text.opacity": 0.38,
1414
"md.comp.filled-button.focus.container.elevation": "md.sys.elevation.level0",
15+
"md.comp.filled-button.focus.indicator.color": "secondary",
16+
"md.comp.filled-button.focus.indicator.outline.offset": "md.sys.state.focus-indicator.outer-offset",
17+
"md.comp.filled-button.focus.indicator.thickness": "md.sys.state.focus-indicator.thickness",
1518
"md.comp.filled-button.focus.label-text.color": "onPrimary",
1619
"md.comp.filled-button.focus.state-layer.color": "onPrimary",
1720
"md.comp.filled-button.focus.state-layer.opacity": "md.sys.state.focus.state-layer-opacity",

0 commit comments

Comments
 (0)