Skip to content

Commit 156e348

Browse files
authored
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. (flutter/flutter#125016)
1 parent 9a8a2c7 commit 156e348

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/flutter/lib/src/foundation/diagnostics.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2948,7 +2948,7 @@ String describeIdentity(Object? object) => '${objectRuntimeType(object, '<optimi
29482948
/// {@end-tool}
29492949
@Deprecated(
29502950
'Use the `name` getter on enums instead. '
2951-
'This feature was deprecated after v3.10.0-1.1.pre.'
2951+
'This feature was deprecated after v3.14.0-2.0.pre.'
29522952
)
29532953
String describeEnum(Object enumEntry) {
29542954
if (enumEntry is Enum) {

packages/flutter/lib/src/material/theme_data.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,12 +1584,12 @@ class ThemeData with Diagnosticable {
15841584
Color? selectedRowColor,
15851585
@Deprecated(
15861586
'Use colorScheme.error instead. '
1587-
'This feature was deprecated after v2.6.0-11.0.pre.',
1587+
'This feature was deprecated after v3.3.0-0.5.pre.',
15881588
)
15891589
Color? errorColor,
15901590
@Deprecated(
15911591
'Use colorScheme.background instead. '
1592-
'This feature was deprecated after v2.6.0-11.0.pre.',
1592+
'This feature was deprecated after v3.3.0-0.5.pre.',
15931593
)
15941594
Color? backgroundColor,
15951595
@Deprecated(
@@ -1623,6 +1623,8 @@ class ThemeData with Diagnosticable {
16231623
platform: platform ?? this.platform,
16241624
scrollbarTheme: scrollbarTheme ?? this.scrollbarTheme,
16251625
splashFactory: splashFactory ?? this.splashFactory,
1626+
// When deprecated useMaterial3 removed, maintain `this.useMaterial3` here
1627+
// for == evaluation.
16261628
useMaterial3: useMaterial3 ?? this.useMaterial3,
16271629
visualDensity: visualDensity ?? this.visualDensity,
16281630
// COLOR

0 commit comments

Comments
 (0)