Reverts "Reland - Introduce tone-based surfaces and accent color add-ons - Part 2 (#144001)" (#144262)
Reverts flutter/flutter#144001
Initiated by: Piinks
Reason for reverting: Failing goldens at the tip of tree
Original PR Author: QuncCccccc
Reviewed By: {HansMuller}
This change reverts the following previous change:
Original Description:
Reverts flutter/flutter#143973
This is a reland for #138521 with an updated g3fix(cl/605555997). Local test: cl/609608958.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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')}),
|
||||
|
||||
@@ -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")};
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>(Size(${getToken('$tokenGroup.container.width')}, ${getToken('$tokenGroup.container.height')}))''';
|
||||
const MaterialStatePropertyAll<Size>(Size(${getToken('$tokenGroup.container.size')}, ${getToken('$tokenGroup.container.size')}))''';
|
||||
} else {
|
||||
return '''
|
||||
|
||||
const MaterialStatePropertyAll<Size>(Size(40.0, 40.0))''';
|
||||
const MaterialStatePropertyAll<Size>(Size(${getToken('$tokenGroup.state-layer.size')}, ${getToken('$tokenGroup.state-layer.size')}))''';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class _MenuBarDefaultsM3 extends MenuStyle {
|
||||
|
||||
@override
|
||||
MaterialStateProperty<Color?>? get surfaceTintColor {
|
||||
return const MaterialStatePropertyAll<Color?>(${colorOrTransparent('md.comp.menu.container.surface-tint-layer')});
|
||||
return MaterialStatePropertyAll<Color?>(${componentColor('md.comp.menu.container.surface-tint-layer')});
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -242,10 +242,7 @@ class _MenuDefaultsM3 extends MenuStyle {
|
||||
|
||||
@override
|
||||
MaterialStateProperty<Color?>? get surfaceTintColor {
|
||||
return ${componentColor('md.comp.menu.container.surface-tint-layer') == 'null'
|
||||
? 'const MaterialStatePropertyAll<Color?>(Colors.transparent)'
|
||||
: 'MaterialStatePropertyAll<Color?>(${componentColor('md.comp.menu.container.surface-tint-layer')})'
|
||||
};
|
||||
return MaterialStatePropertyAll<Color?>(${componentColor('md.comp.menu.container.surface-tint-layer')});
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -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")};
|
||||
|
||||
@@ -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")};
|
||||
|
||||
@@ -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>($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<Color>? get surfaceTintColor =>
|
||||
${_surfaceTint()}
|
||||
MaterialStatePropertyAll<Color>(${colorOrTransparent("md.comp.search-bar.container.surface-tint-layer.color")});
|
||||
|
||||
@override
|
||||
MaterialStateProperty<Color?>? get overlayColor =>
|
||||
|
||||
@@ -124,23 +124,23 @@ class _${blockName}DefaultsM3 extends SegmentedButtonThemeData {
|
||||
return MaterialStateProperty.resolveWith((Set<MaterialState> 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;
|
||||
|
||||
@@ -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")};
|
||||
|
||||
Reference in New Issue
Block a user