Unverified Commit 1ed23124 authored by Eilidh Southren's avatar Eilidh Southren Committed by GitHub

Deprecate ThemeDate.bottomAppBarColor (#111080)

* test commit

* Deprecate BottomAppBarColor field

* test commit

* Deprecate BottomAppBarColor field

* Update fix_data.yaml & tests

* remove text.txt

* Update PR ID values

* Update fix_data.yaml

* Make deprecation changes non-breaking

* Whitespace formatting

* Modify docstring, retain bottomAppBarColor default

* Modify theme_data_test.dart

* Update docstrings
parent 91e9c624
...@@ -17,6 +17,80 @@ ...@@ -17,6 +17,80 @@
version: 1 version: 1
transforms: transforms:
# Changes made in https://github.com/flutter/flutter/pull/111080
- title: "Migrate to 'BottomAppBarTheme.color'"
date: 2022-09-07
element:
uris: [ 'material.dart' ]
constructor: ''
inClass: 'ThemeData'
oneOf:
- if: "bottomAppBarColor != ''"
changes:
- kind: 'removeParameter'
name: 'bottomAppBarColor'
- kind: 'addParameter'
index: 73
name: 'bottomAppBarTheme'
style: optional_named
argumentValue:
expression: 'BottomAppBarTheme(color: {% bottomAppBarColor %})'
requiredIf: "bottomAppBarColor != ''"
variables:
bottomAppBarColor:
kind: 'fragment'
value: 'arguments[bottomAppBarColor]'
# Changes made in https://github.com/flutter/flutter/pull/111080
- title: "Migrate to 'BottomAppBarTheme.color'"
date: 2022-09-07
element:
uris: [ 'material.dart' ]
constructor: 'raw'
inClass: 'ThemeData'
oneOf:
- if: "bottomAppBarColor != ''"
changes:
- kind: 'removeParameter'
name: 'bottomAppBarColor'
- kind: 'addParameter'
index: 73
name: 'bottomAppBarTheme'
style: optional_named
argumentValue:
expression: 'BottomAppBarTheme(color: {% bottomAppBarColor %})'
requiredIf: "bottomAppBarColor != ''"
variables:
bottomAppBarColor:
kind: 'fragment'
value: 'arguments[bottomAppBarColor]'
# Changes made in https://github.com/flutter/flutter/pull/111080
- title: "Migrate to 'BottomAppBarTheme.color'"
date: 2022-09-06
element:
uris: [ 'material.dart' ]
method: 'copyWith'
inClass: 'ThemeData'
oneOf:
- if: "bottomAppBarColor != ''"
changes:
- kind: 'removeParameter'
name: 'bottomAppBarColor'
- kind: 'addParameter'
index: 73
name: 'bottomAppBarTheme'
style: optional_named
argumentValue:
expression: 'BottomAppBarTheme(color: {% bottomAppBarColor %})'
requiredIf: "bottomAppBarColor != ''"
variables:
bottomAppBarColor:
kind: 'fragment'
value: 'arguments[bottomAppBarColor]'
# Changes made in https://github.com/flutter/flutter/pull/110162 # Changes made in https://github.com/flutter/flutter/pull/110162
- title: "Migrate to 'ColorScheme.background'" - title: "Migrate to 'ColorScheme.background'"
date: 2022-08-24 date: 2022-08-24
......
...@@ -295,7 +295,6 @@ class ThemeData with Diagnosticable { ...@@ -295,7 +295,6 @@ class ThemeData with Diagnosticable {
// [colorScheme] is the preferred way to configure colors. The other color // [colorScheme] is the preferred way to configure colors. The other color
// properties (as well as primaryColorBrightness, and primarySwatch) // properties (as well as primaryColorBrightness, and primarySwatch)
// will gradually be phased out, see https://github.com/flutter/flutter/issues/91772. // will gradually be phased out, see https://github.com/flutter/flutter/issues/91772.
Color? bottomAppBarColor,
Brightness? brightness, Brightness? brightness,
Color? canvasColor, Color? canvasColor,
Color? cardColor, Color? cardColor,
...@@ -432,6 +431,11 @@ class ThemeData with Diagnosticable { ...@@ -432,6 +431,11 @@ class ThemeData with Diagnosticable {
'This feature was deprecated after v3.3.0-0.5.pre.', 'This feature was deprecated after v3.3.0-0.5.pre.',
) )
Color? backgroundColor, Color? backgroundColor,
@Deprecated(
'Use BottomAppBarTheme.color instead. '
'This feature was deprecated after v3.3.0-0.6.pre.',
)
Color? bottomAppBarColor,
}) { }) {
// GENERAL CONFIGURATION // GENERAL CONFIGURATION
cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault(); cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault();
...@@ -505,7 +509,6 @@ class ThemeData with Diagnosticable { ...@@ -505,7 +509,6 @@ class ThemeData with Diagnosticable {
shadowColor ??= Colors.black; shadowColor ??= Colors.black;
canvasColor ??= isDark ? Colors.grey[850]! : Colors.grey[50]!; canvasColor ??= isDark ? Colors.grey[850]! : Colors.grey[50]!;
scaffoldBackgroundColor ??= canvasColor; scaffoldBackgroundColor ??= canvasColor;
bottomAppBarColor ??= isDark ? Colors.grey[800]! : Colors.white;
cardColor ??= isDark ? Colors.grey[800]! : Colors.white; cardColor ??= isDark ? Colors.grey[800]! : Colors.white;
dividerColor ??= isDark ? const Color(0x1FFFFFFF) : const Color(0x1F000000); dividerColor ??= isDark ? const Color(0x1FFFFFFF) : const Color(0x1F000000);
// Create a ColorScheme that is backwards compatible as possible // Create a ColorScheme that is backwards compatible as possible
...@@ -601,6 +604,7 @@ class ThemeData with Diagnosticable { ...@@ -601,6 +604,7 @@ class ThemeData with Diagnosticable {
primaryColorBrightness = estimatedPrimaryColorBrightness; primaryColorBrightness = estimatedPrimaryColorBrightness;
errorColor ??= Colors.red[700]!; errorColor ??= Colors.red[700]!;
backgroundColor ??= isDark ? Colors.grey[700]! : primarySwatch[200]!; backgroundColor ??= isDark ? Colors.grey[700]! : primarySwatch[200]!;
bottomAppBarColor ??= colorSchemeSeed != null ? colorScheme.surface : isDark ? Colors.grey[800]! : Colors.white;
return ThemeData.raw( return ThemeData.raw(
// For the sanity of the reader, make sure these properties are in the same // For the sanity of the reader, make sure these properties are in the same
...@@ -621,7 +625,6 @@ class ThemeData with Diagnosticable { ...@@ -621,7 +625,6 @@ class ThemeData with Diagnosticable {
useMaterial3: useMaterial3, useMaterial3: useMaterial3,
visualDensity: visualDensity, visualDensity: visualDensity,
// COLOR // COLOR
bottomAppBarColor: bottomAppBarColor,
canvasColor: canvasColor, canvasColor: canvasColor,
cardColor: cardColor, cardColor: cardColor,
colorScheme: colorScheme, colorScheme: colorScheme,
...@@ -696,6 +699,7 @@ class ThemeData with Diagnosticable { ...@@ -696,6 +699,7 @@ class ThemeData with Diagnosticable {
selectedRowColor: selectedRowColor, selectedRowColor: selectedRowColor,
errorColor: errorColor, errorColor: errorColor,
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
bottomAppBarColor: bottomAppBarColor,
); );
} }
...@@ -728,7 +732,6 @@ class ThemeData with Diagnosticable { ...@@ -728,7 +732,6 @@ class ThemeData with Diagnosticable {
// [colorScheme] is the preferred way to configure colors. The other color // [colorScheme] is the preferred way to configure colors. The other color
// properties will gradually be phased out, see // properties will gradually be phased out, see
// https://github.com/flutter/flutter/issues/91772. // https://github.com/flutter/flutter/issues/91772.
required this.bottomAppBarColor,
required this.canvasColor, required this.canvasColor,
required this.cardColor, required this.cardColor,
required this.colorScheme, required this.colorScheme,
...@@ -861,6 +864,12 @@ class ThemeData with Diagnosticable { ...@@ -861,6 +864,12 @@ class ThemeData with Diagnosticable {
'This feature was deprecated after v3.3.0-0.5.pre.', 'This feature was deprecated after v3.3.0-0.5.pre.',
) )
Color? backgroundColor, Color? backgroundColor,
@Deprecated(
'Use BottomAppBarTheme.color instead. '
'This feature was deprecated after v3.3.0-0.6.pre.',
)
Color? bottomAppBarColor,
}) : // DEPRECATED (newest deprecations at the bottom) }) : // DEPRECATED (newest deprecations at the bottom)
// should not be `required`, use getter pattern to avoid breakages. // should not be `required`, use getter pattern to avoid breakages.
_accentColor = accentColor, _accentColor = accentColor,
...@@ -874,6 +883,7 @@ class ThemeData with Diagnosticable { ...@@ -874,6 +883,7 @@ class ThemeData with Diagnosticable {
_selectedRowColor = selectedRowColor, _selectedRowColor = selectedRowColor,
_errorColor = errorColor, _errorColor = errorColor,
_backgroundColor = backgroundColor, _backgroundColor = backgroundColor,
_bottomAppBarColor = bottomAppBarColor,
// GENERAL CONFIGURATION // GENERAL CONFIGURATION
assert(applyElevationOverlayColor != null), assert(applyElevationOverlayColor != null),
assert(extensions != null), assert(extensions != null),
...@@ -886,7 +896,6 @@ class ThemeData with Diagnosticable { ...@@ -886,7 +896,6 @@ class ThemeData with Diagnosticable {
assert(useMaterial3 != null), assert(useMaterial3 != null),
assert(visualDensity != null), assert(visualDensity != null),
// COLOR // COLOR
assert(bottomAppBarColor != null),
assert(canvasColor != null), assert(canvasColor != null),
assert(cardColor != null), assert(cardColor != null),
assert(colorScheme != null), assert(colorScheme != null),
...@@ -1304,9 +1313,12 @@ class ThemeData with Diagnosticable { ...@@ -1304,9 +1313,12 @@ class ThemeData with Diagnosticable {
// COLOR // COLOR
/// The default color of the [BottomAppBar]. /// The default color of the [BottomAppBar].
/// @Deprecated(
/// This can be overridden by specifying [BottomAppBar.color]. 'Use BottomAppBarTheme.color instead. '
final Color bottomAppBarColor; 'This feature was deprecated after v3.3.0-0.6.pre.',
)
Color get bottomAppBarColor => _bottomAppBarColor!;
final Color? _bottomAppBarColor;
/// The default color of [MaterialType.canvas] [Material]. /// The default color of [MaterialType.canvas] [Material].
final Color canvasColor; final Color canvasColor;
...@@ -1745,7 +1757,6 @@ class ThemeData with Diagnosticable { ...@@ -1745,7 +1757,6 @@ class ThemeData with Diagnosticable {
// [colorScheme] is the preferred way to configure colors. The other color // [colorScheme] is the preferred way to configure colors. The other color
// properties will gradually be phased out, see // properties will gradually be phased out, see
// https://github.com/flutter/flutter/issues/91772. // https://github.com/flutter/flutter/issues/91772.
Color? bottomAppBarColor,
Brightness? brightness, Brightness? brightness,
Color? canvasColor, Color? canvasColor,
Color? cardColor, Color? cardColor,
...@@ -1879,6 +1890,11 @@ class ThemeData with Diagnosticable { ...@@ -1879,6 +1890,11 @@ class ThemeData with Diagnosticable {
'This feature was deprecated after v2.6.0-11.0.pre.', 'This feature was deprecated after v2.6.0-11.0.pre.',
) )
Color? backgroundColor, Color? backgroundColor,
@Deprecated(
'Use BottomAppBarTheme.color instead. '
'This feature was deprecated after v3.3.0-0.6.pre.',
)
Color? bottomAppBarColor,
}) { }) {
cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault(); cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault();
return ThemeData.raw( return ThemeData.raw(
...@@ -1900,7 +1916,6 @@ class ThemeData with Diagnosticable { ...@@ -1900,7 +1916,6 @@ class ThemeData with Diagnosticable {
useMaterial3: useMaterial3 ?? this.useMaterial3, useMaterial3: useMaterial3 ?? this.useMaterial3,
visualDensity: visualDensity ?? this.visualDensity, visualDensity: visualDensity ?? this.visualDensity,
// COLOR // COLOR
bottomAppBarColor: bottomAppBarColor ?? this.bottomAppBarColor,
canvasColor: canvasColor ?? this.canvasColor, canvasColor: canvasColor ?? this.canvasColor,
cardColor: cardColor ?? this.cardColor, cardColor: cardColor ?? this.cardColor,
colorScheme: (colorScheme ?? this.colorScheme).copyWith(brightness: brightness), colorScheme: (colorScheme ?? this.colorScheme).copyWith(brightness: brightness),
...@@ -1975,6 +1990,7 @@ class ThemeData with Diagnosticable { ...@@ -1975,6 +1990,7 @@ class ThemeData with Diagnosticable {
selectedRowColor: selectedRowColor ?? _selectedRowColor, selectedRowColor: selectedRowColor ?? _selectedRowColor,
errorColor: errorColor ?? _errorColor, errorColor: errorColor ?? _errorColor,
backgroundColor: backgroundColor ?? _backgroundColor, backgroundColor: backgroundColor ?? _backgroundColor,
bottomAppBarColor: bottomAppBarColor ?? _bottomAppBarColor,
); );
} }
...@@ -2100,7 +2116,6 @@ class ThemeData with Diagnosticable { ...@@ -2100,7 +2116,6 @@ class ThemeData with Diagnosticable {
useMaterial3: t < 0.5 ? a.useMaterial3 : b.useMaterial3, useMaterial3: t < 0.5 ? a.useMaterial3 : b.useMaterial3,
visualDensity: VisualDensity.lerp(a.visualDensity, b.visualDensity, t), visualDensity: VisualDensity.lerp(a.visualDensity, b.visualDensity, t),
// COLOR // COLOR
bottomAppBarColor: Color.lerp(a.bottomAppBarColor, b.bottomAppBarColor, t)!,
canvasColor: Color.lerp(a.canvasColor, b.canvasColor, t)!, canvasColor: Color.lerp(a.canvasColor, b.canvasColor, t)!,
cardColor: Color.lerp(a.cardColor, b.cardColor, t)!, cardColor: Color.lerp(a.cardColor, b.cardColor, t)!,
colorScheme: ColorScheme.lerp(a.colorScheme, b.colorScheme, t), colorScheme: ColorScheme.lerp(a.colorScheme, b.colorScheme, t),
...@@ -2175,6 +2190,7 @@ class ThemeData with Diagnosticable { ...@@ -2175,6 +2190,7 @@ class ThemeData with Diagnosticable {
selectedRowColor: Color.lerp(a.selectedRowColor, b.selectedRowColor, t), selectedRowColor: Color.lerp(a.selectedRowColor, b.selectedRowColor, t),
errorColor: Color.lerp(a.errorColor, b.errorColor, t), errorColor: Color.lerp(a.errorColor, b.errorColor, t),
backgroundColor: Color.lerp(a.backgroundColor, b.backgroundColor, t), backgroundColor: Color.lerp(a.backgroundColor, b.backgroundColor, t),
bottomAppBarColor: Color.lerp(a.bottomAppBarColor, b.bottomAppBarColor, t),
); );
} }
...@@ -2202,7 +2218,6 @@ class ThemeData with Diagnosticable { ...@@ -2202,7 +2218,6 @@ class ThemeData with Diagnosticable {
other.useMaterial3 == useMaterial3 && other.useMaterial3 == useMaterial3 &&
other.visualDensity == visualDensity && other.visualDensity == visualDensity &&
// COLOR // COLOR
other.bottomAppBarColor == bottomAppBarColor &&
other.canvasColor == canvasColor && other.canvasColor == canvasColor &&
other.cardColor == cardColor && other.cardColor == cardColor &&
other.colorScheme == colorScheme && other.colorScheme == colorScheme &&
...@@ -2276,7 +2291,8 @@ class ThemeData with Diagnosticable { ...@@ -2276,7 +2291,8 @@ class ThemeData with Diagnosticable {
other.toggleableActiveColor == toggleableActiveColor && other.toggleableActiveColor == toggleableActiveColor &&
other.selectedRowColor == selectedRowColor && other.selectedRowColor == selectedRowColor &&
other.errorColor == errorColor && other.errorColor == errorColor &&
other.backgroundColor == backgroundColor; other.backgroundColor == backgroundColor &&
other.bottomAppBarColor == bottomAppBarColor;
} }
@override @override
...@@ -2301,7 +2317,6 @@ class ThemeData with Diagnosticable { ...@@ -2301,7 +2317,6 @@ class ThemeData with Diagnosticable {
useMaterial3, useMaterial3,
visualDensity, visualDensity,
// COLOR // COLOR
bottomAppBarColor,
canvasColor, canvasColor,
cardColor, cardColor,
colorScheme, colorScheme,
...@@ -2376,6 +2391,7 @@ class ThemeData with Diagnosticable { ...@@ -2376,6 +2391,7 @@ class ThemeData with Diagnosticable {
selectedRowColor, selectedRowColor,
errorColor, errorColor,
backgroundColor, backgroundColor,
bottomAppBarColor,
]; ];
return Object.hashAll(values); return Object.hashAll(values);
} }
...@@ -2402,7 +2418,6 @@ class ThemeData with Diagnosticable { ...@@ -2402,7 +2418,6 @@ class ThemeData with Diagnosticable {
properties.add(DiagnosticsProperty<bool>('useMaterial3', useMaterial3, defaultValue: defaultData.useMaterial3, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty<bool>('useMaterial3', useMaterial3, defaultValue: defaultData.useMaterial3, level: DiagnosticLevel.debug));
properties.add(DiagnosticsProperty<VisualDensity>('visualDensity', visualDensity, defaultValue: defaultData.visualDensity, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty<VisualDensity>('visualDensity', visualDensity, defaultValue: defaultData.visualDensity, level: DiagnosticLevel.debug));
// COLORS // COLORS
properties.add(ColorProperty('bottomAppBarColor', bottomAppBarColor, defaultValue: defaultData.bottomAppBarColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('canvasColor', canvasColor, defaultValue: defaultData.canvasColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('canvasColor', canvasColor, defaultValue: defaultData.canvasColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('cardColor', cardColor, defaultValue: defaultData.cardColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('cardColor', cardColor, defaultValue: defaultData.cardColor, level: DiagnosticLevel.debug));
properties.add(DiagnosticsProperty<ColorScheme>('colorScheme', colorScheme, defaultValue: defaultData.colorScheme, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty<ColorScheme>('colorScheme', colorScheme, defaultValue: defaultData.colorScheme, level: DiagnosticLevel.debug));
...@@ -2477,6 +2492,7 @@ class ThemeData with Diagnosticable { ...@@ -2477,6 +2492,7 @@ class ThemeData with Diagnosticable {
properties.add(ColorProperty('selectedRowColor', selectedRowColor, defaultValue: defaultData.selectedRowColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('selectedRowColor', selectedRowColor, defaultValue: defaultData.selectedRowColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('errorColor', errorColor, defaultValue: defaultData.errorColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('errorColor', errorColor, defaultValue: defaultData.errorColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('backgroundColor', backgroundColor, defaultValue: defaultData.backgroundColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('backgroundColor', backgroundColor, defaultValue: defaultData.backgroundColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('bottomAppBarColor', bottomAppBarColor, defaultValue: defaultData.bottomAppBarColor, level: DiagnosticLevel.debug));
} }
} }
......
...@@ -650,7 +650,6 @@ void main() { ...@@ -650,7 +650,6 @@ void main() {
useMaterial3: false, useMaterial3: false,
visualDensity: VisualDensity.standard, visualDensity: VisualDensity.standard,
// COLOR // COLOR
bottomAppBarColor: Colors.black,
canvasColor: Colors.black, canvasColor: Colors.black,
cardColor: Colors.black, cardColor: Colors.black,
colorScheme: const ColorScheme.light(), colorScheme: const ColorScheme.light(),
...@@ -725,6 +724,7 @@ void main() { ...@@ -725,6 +724,7 @@ void main() {
selectedRowColor: Colors.black, selectedRowColor: Colors.black,
errorColor: Colors.black, errorColor: Colors.black,
backgroundColor: Colors.black, backgroundColor: Colors.black,
bottomAppBarColor: Colors.black,
); );
final SliderThemeData otherSliderTheme = SliderThemeData.fromPrimaryColors( final SliderThemeData otherSliderTheme = SliderThemeData.fromPrimaryColors(
...@@ -762,7 +762,6 @@ void main() { ...@@ -762,7 +762,6 @@ void main() {
visualDensity: VisualDensity.standard, visualDensity: VisualDensity.standard,
// COLOR // COLOR
bottomAppBarColor: Colors.white,
canvasColor: Colors.white, canvasColor: Colors.white,
cardColor: Colors.white, cardColor: Colors.white,
colorScheme: const ColorScheme.light(), colorScheme: const ColorScheme.light(),
...@@ -840,6 +839,7 @@ void main() { ...@@ -840,6 +839,7 @@ void main() {
selectedRowColor: Colors.white, selectedRowColor: Colors.white,
errorColor: Colors.white, errorColor: Colors.white,
backgroundColor: Colors.white, backgroundColor: Colors.white,
bottomAppBarColor: Colors.white,
); );
final ThemeData themeDataCopy = theme.copyWith( final ThemeData themeDataCopy = theme.copyWith(
...@@ -862,7 +862,6 @@ void main() { ...@@ -862,7 +862,6 @@ void main() {
visualDensity: otherTheme.visualDensity, visualDensity: otherTheme.visualDensity,
// COLOR // COLOR
bottomAppBarColor: otherTheme.bottomAppBarColor,
canvasColor: otherTheme.canvasColor, canvasColor: otherTheme.canvasColor,
cardColor: otherTheme.cardColor, cardColor: otherTheme.cardColor,
colorScheme: otherTheme.colorScheme, colorScheme: otherTheme.colorScheme,
...@@ -940,6 +939,7 @@ void main() { ...@@ -940,6 +939,7 @@ void main() {
selectedRowColor: otherTheme.selectedRowColor, selectedRowColor: otherTheme.selectedRowColor,
errorColor: otherTheme.errorColor, errorColor: otherTheme.errorColor,
backgroundColor: otherTheme.backgroundColor, backgroundColor: otherTheme.backgroundColor,
bottomAppBarColor: otherTheme.bottomAppBarColor,
); );
// For the sanity of the reader, make sure these properties are in the same // For the sanity of the reader, make sure these properties are in the same
...@@ -961,7 +961,6 @@ void main() { ...@@ -961,7 +961,6 @@ void main() {
expect(themeDataCopy.visualDensity, equals(otherTheme.visualDensity)); expect(themeDataCopy.visualDensity, equals(otherTheme.visualDensity));
// COLOR // COLOR
expect(themeDataCopy.bottomAppBarColor, equals(otherTheme.bottomAppBarColor));
expect(themeDataCopy.canvasColor, equals(otherTheme.canvasColor)); expect(themeDataCopy.canvasColor, equals(otherTheme.canvasColor));
expect(themeDataCopy.cardColor, equals(otherTheme.cardColor)); expect(themeDataCopy.cardColor, equals(otherTheme.cardColor));
expect(themeDataCopy.colorScheme, equals(otherTheme.colorScheme)); expect(themeDataCopy.colorScheme, equals(otherTheme.colorScheme));
...@@ -1044,6 +1043,7 @@ void main() { ...@@ -1044,6 +1043,7 @@ void main() {
expect(themeDataCopy.selectedRowColor, equals(otherTheme.selectedRowColor)); expect(themeDataCopy.selectedRowColor, equals(otherTheme.selectedRowColor));
expect(themeDataCopy.errorColor, equals(otherTheme.errorColor)); expect(themeDataCopy.errorColor, equals(otherTheme.errorColor));
expect(themeDataCopy.backgroundColor, equals(otherTheme.backgroundColor)); expect(themeDataCopy.backgroundColor, equals(otherTheme.backgroundColor));
expect(themeDataCopy.bottomAppBarColor, equals(otherTheme.bottomAppBarColor));
}); });
testWidgets('ThemeData.toString has less than 200 characters output', (WidgetTester tester) async { testWidgets('ThemeData.toString has less than 200 characters output', (WidgetTester tester) async {
...@@ -1109,7 +1109,6 @@ void main() { ...@@ -1109,7 +1109,6 @@ void main() {
'shadowColor', 'shadowColor',
'canvasColor', 'canvasColor',
'scaffoldBackgroundColor', 'scaffoldBackgroundColor',
'bottomAppBarColor',
'cardColor', 'cardColor',
'dividerColor', 'dividerColor',
'highlightColor', 'highlightColor',
...@@ -1175,6 +1174,7 @@ void main() { ...@@ -1175,6 +1174,7 @@ void main() {
'selectedRowColor', 'selectedRowColor',
'errorColor', 'errorColor',
'backgroundColor', 'backgroundColor',
'bottomAppBarColor',
}; };
final DiagnosticPropertiesBuilder properties = DiagnosticPropertiesBuilder(); final DiagnosticPropertiesBuilder properties = DiagnosticPropertiesBuilder();
......
...@@ -688,4 +688,10 @@ void main() { ...@@ -688,4 +688,10 @@ void main() {
themeData = ThemeData(backgroundColor: Colors.grey, errorColor: Colors.red); themeData = ThemeData(backgroundColor: Colors.grey, errorColor: Colors.red);
themeData = ThemeData.raw(backgroundColor: Colors.grey, errorColor: Colors.red); themeData = ThemeData.raw(backgroundColor: Colors.grey, errorColor: Colors.red);
themeData = themeData.copyWith(backgroundColor: Colors.grey, errorColor: Colors.red); themeData = themeData.copyWith(backgroundColor: Colors.grey, errorColor: Colors.red);
// Changes made in https://github.com/flutter/flutter/pull/111080
ThemeData themeData = ThemeData();
themeData = ThemeData(bottomAppBarColor: Colors.green);
themeData = ThemeData.raw(bottomAppBarColor: Colors.green);
themeData = ThemeData.copyWith(bottomAppBarColor: Colors.green);
} }
...@@ -892,4 +892,10 @@ void main() { ...@@ -892,4 +892,10 @@ void main() {
themeData = ThemeData(colorScheme: ColorScheme(error: Colors.red).copyWith(background: Colors.grey)); themeData = ThemeData(colorScheme: ColorScheme(error: Colors.red).copyWith(background: Colors.grey));
themeData = ThemeData.raw(colorScheme: ColorScheme(error: Colors.red).copyWith(background: Colors.grey)); themeData = ThemeData.raw(colorScheme: ColorScheme(error: Colors.red).copyWith(background: Colors.grey));
themeData = themeData.copyWith(colorScheme: ColorScheme(error: Colors.red).copyWith(background: Colors.grey)); themeData = themeData.copyWith(colorScheme: ColorScheme(error: Colors.red).copyWith(background: Colors.grey));
// Changes made in https://github.com/flutter/flutter/pull/111080
ThemeData themeData = ThemeData();
themeData = ThemeData(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green));
themeData = ThemeData.raw(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green));
themeData = ThemeData.copyWith(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green));
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment