diff --git a/packages/flutter/lib/fix_data.yaml b/packages/flutter/lib/fix_data.yaml index 9ab97a1a37..9856e776b0 100644 --- a/packages/flutter/lib/fix_data.yaml +++ b/packages/flutter/lib/fix_data.yaml @@ -17,6 +17,39 @@ version: 1 transforms: + # Changes made in https://github.com/flutter/flutter/pull/109070 + - title: "Remove 'selectedRowColor'" + date: 2022-08-05 + element: + uris: [ 'material.dart' ] + method: 'copyWith' + inClass: 'ThemeData' + changes: + - kind: 'removeParameter' + name: 'selectedRowColor' + + # Changes made in https://github.com/flutter/flutter/pull/109070 + - title: "Remove 'selectedRowColor'" + date: 2022-08-05 + element: + uris: [ 'material.dart' ] + constructor: 'raw' + inClass: 'ThemeData' + changes: + - kind: 'removeParameter' + name: 'selectedRowColor' + + # Changes made in https://github.com/flutter/flutter/pull/109070 + - title: "Remove 'selectedRowColor'" + date: 2022-08-05 + element: + uris: [ 'material.dart' ] + constructor: '' + inClass: 'ThemeData' + changes: + - kind: 'removeParameter' + name: 'selectedRowColor' + # Changes made in https://github.com/flutter/flutter/pull/97972/ - title: "Migrate 'ThemeData.toggleableActiveColor' to individual themes" date: 2022-05-18 diff --git a/packages/flutter/lib/src/material/theme_data.dart b/packages/flutter/lib/src/material/theme_data.dart index 9ba7539577..cdb9934476 100644 --- a/packages/flutter/lib/src/material/theme_data.dart +++ b/packages/flutter/lib/src/material/theme_data.dart @@ -313,7 +313,6 @@ class ThemeData with Diagnosticable { MaterialColor? primarySwatch, Color? scaffoldBackgroundColor, Color? secondaryHeaderColor, - Color? selectedRowColor, Color? shadowColor, Color? splashColor, Color? unselectedWidgetColor, @@ -415,6 +414,11 @@ class ThemeData with Diagnosticable { 'This feature was deprecated after v2.13.0-0.4.pre.', ) Color? toggleableActiveColor, + @Deprecated( + 'No longer used by the framework, please remove any reference to it. ' + 'This feature was deprecated after v3.1.0-0.0.pre.', + ) + Color? selectedRowColor, }) { // GENERAL CONFIGURATION cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault(); @@ -622,7 +626,6 @@ class ThemeData with Diagnosticable { primaryColorLight: primaryColorLight, scaffoldBackgroundColor: scaffoldBackgroundColor, secondaryHeaderColor: secondaryHeaderColor, - selectedRowColor: selectedRowColor, shadowColor: shadowColor, splashColor: splashColor, unselectedWidgetColor: unselectedWidgetColor, @@ -677,6 +680,7 @@ class ThemeData with Diagnosticable { primaryColorBrightness: primaryColorBrightness, androidOverscrollIndicator: androidOverscrollIndicator, toggleableActiveColor: toggleableActiveColor, + selectedRowColor: selectedRowColor, ); } @@ -728,7 +732,6 @@ class ThemeData with Diagnosticable { required this.primaryColorLight, required this.scaffoldBackgroundColor, required this.secondaryHeaderColor, - required this.selectedRowColor, required this.shadowColor, required this.splashColor, required this.unselectedWidgetColor, @@ -829,6 +832,11 @@ class ThemeData with Diagnosticable { 'This feature was deprecated after v2.13.0-0.4.pre.', ) Color? toggleableActiveColor, + @Deprecated( + 'No longer used by the framework, please remove any reference to it. ' + 'This feature was deprecated after v3.1.0-0.0.pre.', + ) + Color? selectedRowColor, }) : // DEPRECATED (newest deprecations at the bottom) // should not be `required`, use getter pattern to avoid breakages. _accentColor = accentColor, @@ -839,6 +847,7 @@ class ThemeData with Diagnosticable { _fixTextFieldOutlineLabel = fixTextFieldOutlineLabel, _primaryColorBrightness = primaryColorBrightness, _toggleableActiveColor = toggleableActiveColor, + _selectedRowColor = selectedRowColor, // GENERAL CONFIGURATION assert(applyElevationOverlayColor != null), assert(extensions != null), @@ -870,7 +879,6 @@ class ThemeData with Diagnosticable { assert(primaryColorLight != null), assert(scaffoldBackgroundColor != null), assert(secondaryHeaderColor != null), - assert(selectedRowColor != null), assert(shadowColor != null), assert(splashColor != null), assert(toggleableActiveColor != null), @@ -1341,7 +1349,12 @@ class ThemeData with Diagnosticable { final Color secondaryHeaderColor; /// The color used to highlight selected rows. - final Color selectedRowColor; + @Deprecated( + 'No longer used by the framework, please remove any reference to it. ' + 'This feature was deprecated after v3.1.0-0.0.pre.', + ) + Color get selectedRowColor => _selectedRowColor!; + final Color? _selectedRowColor; /// The color that the [Material] widget uses to draw elevation shadows. /// @@ -1696,7 +1709,6 @@ class ThemeData with Diagnosticable { Color? primaryColorLight, Color? scaffoldBackgroundColor, Color? secondaryHeaderColor, - Color? selectedRowColor, Color? shadowColor, Color? splashColor, Color? unselectedWidgetColor, @@ -1797,6 +1809,11 @@ class ThemeData with Diagnosticable { 'This feature was deprecated after v2.13.0-0.4.pre.', ) Color? toggleableActiveColor, + @Deprecated( + 'No longer used by the framework, please remove any reference to it. ' + 'This feature was deprecated after v3.1.0-0.0.pre.', + ) + Color? selectedRowColor, }) { cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault(); return ThemeData.raw( @@ -1837,7 +1854,6 @@ class ThemeData with Diagnosticable { primaryColorLight: primaryColorLight ?? this.primaryColorLight, scaffoldBackgroundColor: scaffoldBackgroundColor ?? this.scaffoldBackgroundColor, secondaryHeaderColor: secondaryHeaderColor ?? this.secondaryHeaderColor, - selectedRowColor: selectedRowColor ?? this.selectedRowColor, shadowColor: shadowColor ?? this.shadowColor, splashColor: splashColor ?? this.splashColor, unselectedWidgetColor: unselectedWidgetColor ?? this.unselectedWidgetColor, @@ -1883,15 +1899,16 @@ class ThemeData with Diagnosticable { toggleButtonsTheme: toggleButtonsTheme ?? this.toggleButtonsTheme, tooltipTheme: tooltipTheme ?? this.tooltipTheme, // DEPRECATED (newest deprecations at the bottom) - accentColor: accentColor ?? this.accentColor, - accentColorBrightness: accentColorBrightness ?? this.accentColorBrightness, - accentTextTheme: accentTextTheme ?? this.accentTextTheme, - accentIconTheme: accentIconTheme ?? this.accentIconTheme, - buttonColor: buttonColor ?? this.buttonColor, - fixTextFieldOutlineLabel: fixTextFieldOutlineLabel ?? this.fixTextFieldOutlineLabel, - primaryColorBrightness: primaryColorBrightness ?? this.primaryColorBrightness, + accentColor: accentColor ?? _accentColor, + accentColorBrightness: accentColorBrightness ?? _accentColorBrightness, + accentTextTheme: accentTextTheme ?? _accentTextTheme, + accentIconTheme: accentIconTheme ?? _accentIconTheme, + buttonColor: buttonColor ?? _buttonColor, + fixTextFieldOutlineLabel: fixTextFieldOutlineLabel ?? _fixTextFieldOutlineLabel, + primaryColorBrightness: primaryColorBrightness ?? _primaryColorBrightness, androidOverscrollIndicator: androidOverscrollIndicator ?? this.androidOverscrollIndicator, - toggleableActiveColor: toggleableActiveColor ?? this.toggleableActiveColor, + toggleableActiveColor: toggleableActiveColor ?? _toggleableActiveColor, + selectedRowColor: selectedRowColor ?? _selectedRowColor, ); } @@ -2036,7 +2053,6 @@ class ThemeData with Diagnosticable { primaryColorLight: Color.lerp(a.primaryColorLight, b.primaryColorLight, t)!, scaffoldBackgroundColor: Color.lerp(a.scaffoldBackgroundColor, b.scaffoldBackgroundColor, t)!, secondaryHeaderColor: Color.lerp(a.secondaryHeaderColor, b.secondaryHeaderColor, t)!, - selectedRowColor: Color.lerp(a.selectedRowColor, b.selectedRowColor, t)!, shadowColor: Color.lerp(a.shadowColor, b.shadowColor, t)!, splashColor: Color.lerp(a.splashColor, b.splashColor, t)!, unselectedWidgetColor: Color.lerp(a.unselectedWidgetColor, b.unselectedWidgetColor, t)!, @@ -2091,6 +2107,7 @@ class ThemeData with Diagnosticable { primaryColorBrightness: t < 0.5 ? a.primaryColorBrightness : b.primaryColorBrightness, androidOverscrollIndicator:t < 0.5 ? a.androidOverscrollIndicator : b.androidOverscrollIndicator, toggleableActiveColor: Color.lerp(a.toggleableActiveColor, b.toggleableActiveColor, t), + selectedRowColor: Color.lerp(a.selectedRowColor, b.selectedRowColor, t), ); } @@ -2137,7 +2154,6 @@ class ThemeData with Diagnosticable { other.primaryColorLight == primaryColorLight && other.scaffoldBackgroundColor == scaffoldBackgroundColor && other.secondaryHeaderColor == secondaryHeaderColor && - other.selectedRowColor == selectedRowColor && other.shadowColor == shadowColor && other.splashColor == splashColor && other.unselectedWidgetColor == unselectedWidgetColor && @@ -2191,7 +2207,8 @@ class ThemeData with Diagnosticable { other.fixTextFieldOutlineLabel == fixTextFieldOutlineLabel && other.primaryColorBrightness == primaryColorBrightness && other.androidOverscrollIndicator == androidOverscrollIndicator && - other.toggleableActiveColor == toggleableActiveColor; + other.toggleableActiveColor == toggleableActiveColor && + other.selectedRowColor == selectedRowColor; } @override @@ -2235,7 +2252,6 @@ class ThemeData with Diagnosticable { primaryColorLight, scaffoldBackgroundColor, secondaryHeaderColor, - selectedRowColor, shadowColor, splashColor, unselectedWidgetColor, @@ -2290,6 +2306,7 @@ class ThemeData with Diagnosticable { primaryColorBrightness, androidOverscrollIndicator, toggleableActiveColor, + selectedRowColor, ]; return Object.hashAll(values); } @@ -2335,7 +2352,6 @@ class ThemeData with Diagnosticable { properties.add(ColorProperty('primaryColor', primaryColor, defaultValue: defaultData.primaryColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('scaffoldBackgroundColor', scaffoldBackgroundColor, defaultValue: defaultData.scaffoldBackgroundColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('secondaryHeaderColor', secondaryHeaderColor, defaultValue: defaultData.secondaryHeaderColor, level: DiagnosticLevel.debug)); - properties.add(ColorProperty('selectedRowColor', selectedRowColor, defaultValue: defaultData.selectedRowColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('shadowColor', shadowColor, defaultValue: defaultData.shadowColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('splashColor', splashColor, defaultValue: defaultData.splashColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('unselectedWidgetColor', unselectedWidgetColor, defaultValue: defaultData.unselectedWidgetColor, level: DiagnosticLevel.debug)); @@ -2390,6 +2406,7 @@ class ThemeData with Diagnosticable { properties.add(EnumProperty('primaryColorBrightness', primaryColorBrightness, defaultValue: defaultData.primaryColorBrightness, level: DiagnosticLevel.debug)); properties.add(EnumProperty('androidOverscrollIndicator', androidOverscrollIndicator, defaultValue: null, level: DiagnosticLevel.debug)); properties.add(ColorProperty('toggleableActiveColor', toggleableActiveColor, defaultValue: defaultData.toggleableActiveColor, level: DiagnosticLevel.debug)); + properties.add(ColorProperty('selectedRowColor', selectedRowColor, defaultValue: defaultData.selectedRowColor, level: DiagnosticLevel.debug)); } } diff --git a/packages/flutter/test/material/snack_bar_test.dart b/packages/flutter/test/material/snack_bar_test.dart index 0bb98abb31..46e9db182e 100644 --- a/packages/flutter/test/material/snack_bar_test.dart +++ b/packages/flutter/test/material/snack_bar_test.dart @@ -458,7 +458,6 @@ void main() { highlightColor: Colors.black, splashColor: Colors.black, splashFactory: InkRipple.splashFactory, - selectedRowColor: Colors.black, unselectedWidgetColor: Colors.black, disabledColor: Colors.black, buttonTheme: const ButtonThemeData(colorScheme: ColorScheme.dark()), diff --git a/packages/flutter/test/material/theme_data_test.dart b/packages/flutter/test/material/theme_data_test.dart index 0cb5ab4a96..1abe3cbaa9 100644 --- a/packages/flutter/test/material/theme_data_test.dart +++ b/packages/flutter/test/material/theme_data_test.dart @@ -669,7 +669,6 @@ void main() { primaryColorLight: Colors.black, scaffoldBackgroundColor: Colors.black, secondaryHeaderColor: Colors.black, - selectedRowColor: Colors.black, shadowColor: Colors.black, splashColor: Colors.black, unselectedWidgetColor: Colors.black, @@ -724,6 +723,7 @@ void main() { primaryColorBrightness: Brightness.dark, androidOverscrollIndicator: AndroidOverscrollIndicator.glow, toggleableActiveColor: Colors.black, + selectedRowColor: Colors.black, ); final SliderThemeData otherSliderTheme = SliderThemeData.fromPrimaryColors( @@ -780,7 +780,6 @@ void main() { primaryColorLight: Colors.white, scaffoldBackgroundColor: Colors.white, secondaryHeaderColor: Colors.white, - selectedRowColor: Colors.white, shadowColor: Colors.white, splashColor: Colors.white, unselectedWidgetColor: Colors.white, @@ -838,6 +837,7 @@ void main() { primaryColorBrightness: Brightness.light, androidOverscrollIndicator: AndroidOverscrollIndicator.stretch, toggleableActiveColor: Colors.white, + selectedRowColor: Colors.white, ); final ThemeData themeDataCopy = theme.copyWith( @@ -879,7 +879,6 @@ void main() { primaryColorLight: otherTheme.primaryColorLight, scaffoldBackgroundColor: otherTheme.scaffoldBackgroundColor, secondaryHeaderColor: otherTheme.secondaryHeaderColor, - selectedRowColor: otherTheme.selectedRowColor, shadowColor: otherTheme.shadowColor, splashColor: otherTheme.splashColor, unselectedWidgetColor: otherTheme.unselectedWidgetColor, @@ -937,6 +936,7 @@ void main() { primaryColorBrightness: otherTheme.primaryColorBrightness, androidOverscrollIndicator: otherTheme.androidOverscrollIndicator, toggleableActiveColor: otherTheme.toggleableActiveColor, + selectedRowColor: otherTheme.selectedRowColor, ); // For the sanity of the reader, make sure these properties are in the same @@ -977,7 +977,6 @@ void main() { expect(themeDataCopy.primaryColorLight, equals(otherTheme.primaryColorLight)); expect(themeDataCopy.scaffoldBackgroundColor, equals(otherTheme.scaffoldBackgroundColor)); expect(themeDataCopy.secondaryHeaderColor, equals(otherTheme.secondaryHeaderColor)); - expect(themeDataCopy.selectedRowColor, equals(otherTheme.selectedRowColor)); expect(themeDataCopy.shadowColor, equals(otherTheme.shadowColor)); expect(themeDataCopy.splashColor, equals(otherTheme.splashColor)); expect(themeDataCopy.unselectedWidgetColor, equals(otherTheme.unselectedWidgetColor)); @@ -1040,6 +1039,7 @@ void main() { expect(themeDataCopy.primaryColorBrightness, equals(otherTheme.primaryColorBrightness)); expect(themeDataCopy.androidOverscrollIndicator, equals(otherTheme.androidOverscrollIndicator)); expect(themeDataCopy.toggleableActiveColor, equals(otherTheme.toggleableActiveColor)); + expect(themeDataCopy.selectedRowColor, equals(otherTheme.selectedRowColor)); }); testWidgets('ThemeData.toString has less than 200 characters output', (WidgetTester tester) async { @@ -1110,7 +1110,6 @@ void main() { 'dividerColor', 'highlightColor', 'splashColor', - 'selectedRowColor', 'unselectedWidgetColor', 'disabledColor', 'secondaryHeaderColor', @@ -1170,6 +1169,7 @@ void main() { 'primaryColorBrightness', 'androidOverscrollIndicator', 'toggleableActiveColor', + 'selectedRowColor', }; final DiagnosticPropertiesBuilder properties = DiagnosticPropertiesBuilder(); diff --git a/packages/flutter/test_fixes/material.dart b/packages/flutter/test_fixes/material.dart index 7811e86b20..312a7729ad 100644 --- a/packages/flutter/test_fixes/material.dart +++ b/packages/flutter/test_fixes/material.dart @@ -585,4 +585,11 @@ void main() { toggleableActiveColor: Colors.black, ); themeData.toggleableActiveColor; // Removing field reference not supported. + + // Changes made in https://github.com/flutter/flutter/pull/109070 + ThemeData themeData = ThemeData(); + themeData = ThemeData(selectedRowColor: Brightness.dark); + themeData = ThemeData.raw(selectedRowColor: Brightness.dark); + themeData = themeData.copyWith(selectedRowColor: Brightness.dark); + themeData.selectedRowColor; // Removing field reference not supported. } diff --git a/packages/flutter/test_fixes/material.dart.expect b/packages/flutter/test_fixes/material.dart.expect index b9fcf147db..4f2f9ba7d4 100644 --- a/packages/flutter/test_fixes/material.dart.expect +++ b/packages/flutter/test_fixes/material.dart.expect @@ -788,4 +788,11 @@ void main() { ), ); themeData.toggleableActiveColor; // Removing field reference not supported. + + // Changes made in https://github.com/flutter/flutter/pull/109070 + ThemeData themeData = ThemeData(); + themeData = ThemeData(); + themeData = ThemeData.raw(); + themeData = themeData.copyWith(); + themeData.selectedRowColor; // Removing field reference not supported. }