Fix some deprecation details (#136385)
This fixes/notates a few deprecations from an audit for the next tech debt cycle. - ThemeData errorColor and backgroundColor are notated as deprecated in multiple places, but one usage had a different version tag. Updated to match the rest. - ThemeData.copyWith useMaterial3 was deprecated because it did not do what developers expected - it did not automatically reassign all of the color values and such. (confirmed with @HansMuller) I added a note so that when we later remove it we don't introduce a bug. - the describeEnum deprecation was tagged wrong, it was a very long PR so by the time it merged the version it was finally tagged with was much later. (https://github.com/flutter/flutter/pull/125016)
This commit is contained in:
@@ -2948,7 +2948,7 @@ String describeIdentity(Object? object) => '${objectRuntimeType(object, '<optimi
|
||||
/// {@end-tool}
|
||||
@Deprecated(
|
||||
'Use the `name` getter on enums instead. '
|
||||
'This feature was deprecated after v3.10.0-1.1.pre.'
|
||||
'This feature was deprecated after v3.14.0-2.0.pre.'
|
||||
)
|
||||
String describeEnum(Object enumEntry) {
|
||||
if (enumEntry is Enum) {
|
||||
|
||||
@@ -1584,12 +1584,12 @@ class ThemeData with Diagnosticable {
|
||||
Color? selectedRowColor,
|
||||
@Deprecated(
|
||||
'Use colorScheme.error instead. '
|
||||
'This feature was deprecated after v2.6.0-11.0.pre.',
|
||||
'This feature was deprecated after v3.3.0-0.5.pre.',
|
||||
)
|
||||
Color? errorColor,
|
||||
@Deprecated(
|
||||
'Use colorScheme.background instead. '
|
||||
'This feature was deprecated after v2.6.0-11.0.pre.',
|
||||
'This feature was deprecated after v3.3.0-0.5.pre.',
|
||||
)
|
||||
Color? backgroundColor,
|
||||
@Deprecated(
|
||||
@@ -1623,6 +1623,8 @@ class ThemeData with Diagnosticable {
|
||||
platform: platform ?? this.platform,
|
||||
scrollbarTheme: scrollbarTheme ?? this.scrollbarTheme,
|
||||
splashFactory: splashFactory ?? this.splashFactory,
|
||||
// When deprecated useMaterial3 removed, maintain `this.useMaterial3` here
|
||||
// for == evaluation.
|
||||
useMaterial3: useMaterial3 ?? this.useMaterial3,
|
||||
visualDensity: visualDensity ?? this.visualDensity,
|
||||
// COLOR
|
||||
|
||||
Reference in New Issue
Block a user