Skip to content

Commit d44d657

Browse files
Remove deprecated fixTextFieldOutlineLabel (#125893)
The deprecation period has elapsed. The method was made obsolete in flutter/flutter#87281.
1 parent 45179a6 commit d44d657

3 files changed

Lines changed: 0 additions & 72 deletions

File tree

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

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,6 @@ class ThemeData with Diagnosticable {
388388
ToggleButtonsThemeData? toggleButtonsTheme,
389389
TooltipThemeData? tooltipTheme,
390390
// DEPRECATED (newest deprecations at the bottom)
391-
@Deprecated(
392-
'This "fix" is now enabled by default. '
393-
'This feature was deprecated after v2.5.0-1.0.pre.',
394-
)
395-
bool? fixTextFieldOutlineLabel,
396391
@Deprecated(
397392
'No longer used by the framework, please remove any reference to it. '
398393
'This feature was deprecated after v2.6.0-11.0.pre.',
@@ -605,7 +600,6 @@ class ThemeData with Diagnosticable {
605600
tooltipTheme ??= const TooltipThemeData();
606601

607602
// DEPRECATED (newest deprecations at the bottom)
608-
fixTextFieldOutlineLabel ??= true;
609603
primaryColorBrightness = estimatedPrimaryColorBrightness;
610604
errorColor ??= Colors.red[700]!;
611605
backgroundColor ??= isDark ? Colors.grey[700]! : primarySwatch[200]!;
@@ -703,7 +697,6 @@ class ThemeData with Diagnosticable {
703697
toggleButtonsTheme: toggleButtonsTheme,
704698
tooltipTheme: tooltipTheme,
705699
// DEPRECATED (newest deprecations at the bottom)
706-
fixTextFieldOutlineLabel: fixTextFieldOutlineLabel,
707700
primaryColorBrightness: primaryColorBrightness,
708701
androidOverscrollIndicator: androidOverscrollIndicator,
709702
toggleableActiveColor: toggleableActiveColor,
@@ -816,11 +809,6 @@ class ThemeData with Diagnosticable {
816809
required this.toggleButtonsTheme,
817810
required this.tooltipTheme,
818811
// DEPRECATED (newest deprecations at the bottom)
819-
@Deprecated(
820-
'This "fix" is now enabled by default. '
821-
'This feature was deprecated after v2.5.0-1.0.pre.',
822-
)
823-
bool? fixTextFieldOutlineLabel,
824812
@Deprecated(
825813
'No longer used by the framework, please remove any reference to it. '
826814
'This feature was deprecated after v2.6.0-11.0.pre.',
@@ -861,7 +849,6 @@ class ThemeData with Diagnosticable {
861849

862850
}) : // DEPRECATED (newest deprecations at the bottom)
863851
// should not be `required`, use getter pattern to avoid breakages.
864-
_fixTextFieldOutlineLabel = fixTextFieldOutlineLabel,
865852
_primaryColorBrightness = primaryColorBrightness,
866853
_toggleableActiveColor = toggleableActiveColor,
867854
_selectedRowColor = selectedRowColor,
@@ -870,7 +857,6 @@ class ThemeData with Diagnosticable {
870857
_bottomAppBarColor = bottomAppBarColor,
871858
assert(toggleableActiveColor != null),
872859
// DEPRECATED (newest deprecations at the bottom)
873-
assert(fixTextFieldOutlineLabel != null),
874860
assert(primaryColorBrightness != null),
875861
assert(errorColor != null),
876862
assert(backgroundColor != null);
@@ -1537,21 +1523,6 @@ class ThemeData with Diagnosticable {
15371523

15381524
// DEPRECATED (newest deprecations at the bottom)
15391525

1540-
/// An obsolete flag to allow apps to opt-out of a
1541-
/// [small fix](https://github.com/flutter/flutter/issues/54028) for the Y
1542-
/// coordinate of the floating label in a [TextField] [OutlineInputBorder].
1543-
///
1544-
/// Setting this flag to true causes the floating label to be more precisely
1545-
/// vertically centered relative to the border's outline.
1546-
///
1547-
/// The flag is true by default and its use is deprecated.
1548-
@Deprecated(
1549-
'This "fix" is now enabled by default. '
1550-
'This feature was deprecated after v2.5.0-1.0.pre.',
1551-
)
1552-
bool get fixTextFieldOutlineLabel => _fixTextFieldOutlineLabel!;
1553-
final bool? _fixTextFieldOutlineLabel;
1554-
15551526
/// Obsolete property that was originally used to determine the color
15561527
/// of text and icons placed on top of the primary color (e.g. toolbar text).
15571528
///
@@ -1724,11 +1695,6 @@ class ThemeData with Diagnosticable {
17241695
ToggleButtonsThemeData? toggleButtonsTheme,
17251696
TooltipThemeData? tooltipTheme,
17261697
// DEPRECATED (newest deprecations at the bottom)
1727-
@Deprecated(
1728-
'This "fix" is now enabled by default. '
1729-
'This feature was deprecated after v2.5.0-1.0.pre.',
1730-
)
1731-
bool? fixTextFieldOutlineLabel,
17321698
@Deprecated(
17331699
'No longer used by the framework, please remove any reference to it. '
17341700
'This feature was deprecated after v2.6.0-11.0.pre.',
@@ -1860,7 +1826,6 @@ class ThemeData with Diagnosticable {
18601826
toggleButtonsTheme: toggleButtonsTheme ?? this.toggleButtonsTheme,
18611827
tooltipTheme: tooltipTheme ?? this.tooltipTheme,
18621828
// DEPRECATED (newest deprecations at the bottom)
1863-
fixTextFieldOutlineLabel: fixTextFieldOutlineLabel ?? _fixTextFieldOutlineLabel,
18641829
primaryColorBrightness: primaryColorBrightness ?? _primaryColorBrightness,
18651830
androidOverscrollIndicator: androidOverscrollIndicator ?? this.androidOverscrollIndicator,
18661831
toggleableActiveColor: toggleableActiveColor ?? _toggleableActiveColor,
@@ -2056,7 +2021,6 @@ class ThemeData with Diagnosticable {
20562021
toggleButtonsTheme: ToggleButtonsThemeData.lerp(a.toggleButtonsTheme, b.toggleButtonsTheme, t)!,
20572022
tooltipTheme: TooltipThemeData.lerp(a.tooltipTheme, b.tooltipTheme, t)!,
20582023
// DEPRECATED (newest deprecations at the bottom)
2059-
fixTextFieldOutlineLabel: t < 0.5 ? a.fixTextFieldOutlineLabel : b.fixTextFieldOutlineLabel,
20602024
primaryColorBrightness: t < 0.5 ? a.primaryColorBrightness : b.primaryColorBrightness,
20612025
androidOverscrollIndicator:t < 0.5 ? a.androidOverscrollIndicator : b.androidOverscrollIndicator,
20622026
toggleableActiveColor: Color.lerp(a.toggleableActiveColor, b.toggleableActiveColor, t),
@@ -2164,7 +2128,6 @@ class ThemeData with Diagnosticable {
21642128
other.toggleButtonsTheme == toggleButtonsTheme &&
21652129
other.tooltipTheme == tooltipTheme &&
21662130
// DEPRECATED (newest deprecations at the bottom)
2167-
other.fixTextFieldOutlineLabel == fixTextFieldOutlineLabel &&
21682131
other.primaryColorBrightness == primaryColorBrightness &&
21692132
other.androidOverscrollIndicator == androidOverscrollIndicator &&
21702133
other.toggleableActiveColor == toggleableActiveColor &&
@@ -2269,7 +2232,6 @@ class ThemeData with Diagnosticable {
22692232
toggleButtonsTheme,
22702233
tooltipTheme,
22712234
// DEPRECATED (newest deprecations at the bottom)
2272-
fixTextFieldOutlineLabel,
22732235
primaryColorBrightness,
22742236
androidOverscrollIndicator,
22752237
toggleableActiveColor,
@@ -2376,7 +2338,6 @@ class ThemeData with Diagnosticable {
23762338
properties.add(DiagnosticsProperty<ToggleButtonsThemeData>('toggleButtonsTheme', toggleButtonsTheme, level: DiagnosticLevel.debug));
23772339
properties.add(DiagnosticsProperty<TooltipThemeData>('tooltipTheme', tooltipTheme, level: DiagnosticLevel.debug));
23782340
// DEPRECATED (newest deprecations at the bottom)
2379-
properties.add(DiagnosticsProperty<bool>('fixTextFieldOutlineLabel', fixTextFieldOutlineLabel, level: DiagnosticLevel.debug));
23802341
properties.add(EnumProperty<Brightness>('primaryColorBrightness', primaryColorBrightness, defaultValue: defaultData.primaryColorBrightness, level: DiagnosticLevel.debug));
23812342
properties.add(EnumProperty<AndroidOverscrollIndicator>('androidOverscrollIndicator', androidOverscrollIndicator, defaultValue: null, level: DiagnosticLevel.debug));
23822343
properties.add(ColorProperty('toggleableActiveColor', toggleableActiveColor, defaultValue: defaultData.toggleableActiveColor, level: DiagnosticLevel.debug));

packages/flutter/test/material/input_decorator_test.dart

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6250,34 +6250,6 @@ void main() {
62506250
expect(getLabelStyle(tester).color, labelStyle.color);
62516251
});
62526252

6253-
testWidgets("InputDecorator's floating label origin no longer depends on ThemeData.fixTextFieldOutlineLabel", (WidgetTester tester) async {
6254-
Widget buildFrame(bool fixTextFieldOutlineLabel) {
6255-
return buildInputDecorator(
6256-
useMaterial3: useMaterial3,
6257-
isEmpty: true,
6258-
theme: ThemeData.light().copyWith(
6259-
fixTextFieldOutlineLabel: fixTextFieldOutlineLabel,
6260-
),
6261-
decoration: const InputDecoration(
6262-
labelText: 'label',
6263-
enabledBorder: OutlineInputBorder(),
6264-
floatingLabelBehavior: FloatingLabelBehavior.always,
6265-
),
6266-
);
6267-
}
6268-
6269-
await tester.pumpWidget(buildFrame(false));
6270-
await tester.pumpAndSettle();
6271-
6272-
// floatingLabelHeight = 12 (font size 16dps * 0.75 = 12)
6273-
// labelY = -floatingLabelHeight/2 + borderWidth/2
6274-
expect(tester.getTopLeft(find.text('label')).dy, -5.5);
6275-
6276-
await tester.pumpWidget(buildFrame(true));
6277-
await tester.pumpAndSettle();
6278-
expect(tester.getTopLeft(find.text('label')).dy, -5.5);
6279-
});
6280-
62816253
testWidgets('hint style overflow works', (WidgetTester tester) async {
62826254
final String hintText = 'hint text' * 20;
62836255
const TextStyle hintStyle = TextStyle(

packages/flutter/test/material/theme_data_test.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,6 @@ void main() {
826826
toggleButtonsTheme: const ToggleButtonsThemeData(textStyle: TextStyle(color: Colors.black)),
827827
tooltipTheme: const TooltipThemeData(height: 100),
828828
// DEPRECATED (newest deprecations at the bottom)
829-
fixTextFieldOutlineLabel: false,
830829
primaryColorBrightness: Brightness.dark,
831830
androidOverscrollIndicator: AndroidOverscrollIndicator.glow,
832831
toggleableActiveColor: Colors.black,
@@ -947,7 +946,6 @@ void main() {
947946
tooltipTheme: const TooltipThemeData(height: 100),
948947

949948
// DEPRECATED (newest deprecations at the bottom)
950-
fixTextFieldOutlineLabel: true,
951949
primaryColorBrightness: Brightness.light,
952950
androidOverscrollIndicator: AndroidOverscrollIndicator.stretch,
953951
toggleableActiveColor: Colors.white,
@@ -1051,7 +1049,6 @@ void main() {
10511049
tooltipTheme: otherTheme.tooltipTheme,
10521050

10531051
// DEPRECATED (newest deprecations at the bottom)
1054-
fixTextFieldOutlineLabel: otherTheme.fixTextFieldOutlineLabel,
10551052
primaryColorBrightness: otherTheme.primaryColorBrightness,
10561053
androidOverscrollIndicator: otherTheme.androidOverscrollIndicator,
10571054
toggleableActiveColor: otherTheme.toggleableActiveColor,
@@ -1156,7 +1153,6 @@ void main() {
11561153
expect(themeDataCopy.tooltipTheme, equals(otherTheme.tooltipTheme));
11571154

11581155
// DEPRECATED (newest deprecations at the bottom)
1159-
expect(themeDataCopy.fixTextFieldOutlineLabel, equals(otherTheme.fixTextFieldOutlineLabel));
11601156
expect(themeDataCopy.primaryColorBrightness, equals(otherTheme.primaryColorBrightness));
11611157
expect(themeDataCopy.androidOverscrollIndicator, equals(otherTheme.androidOverscrollIndicator));
11621158
expect(themeDataCopy.toggleableActiveColor, equals(otherTheme.toggleableActiveColor));
@@ -1292,7 +1288,6 @@ void main() {
12921288
'toggleButtonsTheme',
12931289
'tooltipTheme',
12941290
// DEPRECATED (newest deprecations at the bottom)
1295-
'fixTextFieldOutlineLabel',
12961291
'primaryColorBrightness',
12971292
'androidOverscrollIndicator',
12981293
'toggleableActiveColor',

0 commit comments

Comments
 (0)