Skip to content

Commit

Permalink
Remove deprecated fixTextFieldOutlineLabel (#125893)
Browse files Browse the repository at this point in the history
The deprecation period has elapsed. The method was made obsolete in flutter/flutter#87281.
  • Loading branch information
Renzo-Olivares authored May 17, 2023
1 parent 45179a6 commit d44d657
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 72 deletions.
39 changes: 0 additions & 39 deletions packages/flutter/lib/src/material/theme_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,6 @@ class ThemeData with Diagnosticable {
ToggleButtonsThemeData? toggleButtonsTheme,
TooltipThemeData? tooltipTheme,
// DEPRECATED (newest deprecations at the bottom)
@Deprecated(
'This "fix" is now enabled by default. '
'This feature was deprecated after v2.5.0-1.0.pre.',
)
bool? fixTextFieldOutlineLabel,
@Deprecated(
'No longer used by the framework, please remove any reference to it. '
'This feature was deprecated after v2.6.0-11.0.pre.',
Expand Down Expand Up @@ -605,7 +600,6 @@ class ThemeData with Diagnosticable {
tooltipTheme ??= const TooltipThemeData();

// DEPRECATED (newest deprecations at the bottom)
fixTextFieldOutlineLabel ??= true;
primaryColorBrightness = estimatedPrimaryColorBrightness;
errorColor ??= Colors.red[700]!;
backgroundColor ??= isDark ? Colors.grey[700]! : primarySwatch[200]!;
Expand Down Expand Up @@ -703,7 +697,6 @@ class ThemeData with Diagnosticable {
toggleButtonsTheme: toggleButtonsTheme,
tooltipTheme: tooltipTheme,
// DEPRECATED (newest deprecations at the bottom)
fixTextFieldOutlineLabel: fixTextFieldOutlineLabel,
primaryColorBrightness: primaryColorBrightness,
androidOverscrollIndicator: androidOverscrollIndicator,
toggleableActiveColor: toggleableActiveColor,
Expand Down Expand Up @@ -816,11 +809,6 @@ class ThemeData with Diagnosticable {
required this.toggleButtonsTheme,
required this.tooltipTheme,
// DEPRECATED (newest deprecations at the bottom)
@Deprecated(
'This "fix" is now enabled by default. '
'This feature was deprecated after v2.5.0-1.0.pre.',
)
bool? fixTextFieldOutlineLabel,
@Deprecated(
'No longer used by the framework, please remove any reference to it. '
'This feature was deprecated after v2.6.0-11.0.pre.',
Expand Down Expand Up @@ -861,7 +849,6 @@ class ThemeData with Diagnosticable {

}) : // DEPRECATED (newest deprecations at the bottom)
// should not be `required`, use getter pattern to avoid breakages.
_fixTextFieldOutlineLabel = fixTextFieldOutlineLabel,
_primaryColorBrightness = primaryColorBrightness,
_toggleableActiveColor = toggleableActiveColor,
_selectedRowColor = selectedRowColor,
Expand All @@ -870,7 +857,6 @@ class ThemeData with Diagnosticable {
_bottomAppBarColor = bottomAppBarColor,
assert(toggleableActiveColor != null),
// DEPRECATED (newest deprecations at the bottom)
assert(fixTextFieldOutlineLabel != null),
assert(primaryColorBrightness != null),
assert(errorColor != null),
assert(backgroundColor != null);
Expand Down Expand Up @@ -1537,21 +1523,6 @@ class ThemeData with Diagnosticable {

// DEPRECATED (newest deprecations at the bottom)

/// An obsolete flag to allow apps to opt-out of a
/// [small fix](https://github.com/flutter/flutter/issues/54028) for the Y
/// coordinate of the floating label in a [TextField] [OutlineInputBorder].
///
/// Setting this flag to true causes the floating label to be more precisely
/// vertically centered relative to the border's outline.
///
/// The flag is true by default and its use is deprecated.
@Deprecated(
'This "fix" is now enabled by default. '
'This feature was deprecated after v2.5.0-1.0.pre.',
)
bool get fixTextFieldOutlineLabel => _fixTextFieldOutlineLabel!;
final bool? _fixTextFieldOutlineLabel;

/// Obsolete property that was originally used to determine the color
/// of text and icons placed on top of the primary color (e.g. toolbar text).
///
Expand Down Expand Up @@ -1724,11 +1695,6 @@ class ThemeData with Diagnosticable {
ToggleButtonsThemeData? toggleButtonsTheme,
TooltipThemeData? tooltipTheme,
// DEPRECATED (newest deprecations at the bottom)
@Deprecated(
'This "fix" is now enabled by default. '
'This feature was deprecated after v2.5.0-1.0.pre.',
)
bool? fixTextFieldOutlineLabel,
@Deprecated(
'No longer used by the framework, please remove any reference to it. '
'This feature was deprecated after v2.6.0-11.0.pre.',
Expand Down Expand Up @@ -1860,7 +1826,6 @@ class ThemeData with Diagnosticable {
toggleButtonsTheme: toggleButtonsTheme ?? this.toggleButtonsTheme,
tooltipTheme: tooltipTheme ?? this.tooltipTheme,
// DEPRECATED (newest deprecations at the bottom)
fixTextFieldOutlineLabel: fixTextFieldOutlineLabel ?? _fixTextFieldOutlineLabel,
primaryColorBrightness: primaryColorBrightness ?? _primaryColorBrightness,
androidOverscrollIndicator: androidOverscrollIndicator ?? this.androidOverscrollIndicator,
toggleableActiveColor: toggleableActiveColor ?? _toggleableActiveColor,
Expand Down Expand Up @@ -2056,7 +2021,6 @@ class ThemeData with Diagnosticable {
toggleButtonsTheme: ToggleButtonsThemeData.lerp(a.toggleButtonsTheme, b.toggleButtonsTheme, t)!,
tooltipTheme: TooltipThemeData.lerp(a.tooltipTheme, b.tooltipTheme, t)!,
// DEPRECATED (newest deprecations at the bottom)
fixTextFieldOutlineLabel: t < 0.5 ? a.fixTextFieldOutlineLabel : b.fixTextFieldOutlineLabel,
primaryColorBrightness: t < 0.5 ? a.primaryColorBrightness : b.primaryColorBrightness,
androidOverscrollIndicator:t < 0.5 ? a.androidOverscrollIndicator : b.androidOverscrollIndicator,
toggleableActiveColor: Color.lerp(a.toggleableActiveColor, b.toggleableActiveColor, t),
Expand Down Expand Up @@ -2164,7 +2128,6 @@ class ThemeData with Diagnosticable {
other.toggleButtonsTheme == toggleButtonsTheme &&
other.tooltipTheme == tooltipTheme &&
// DEPRECATED (newest deprecations at the bottom)
other.fixTextFieldOutlineLabel == fixTextFieldOutlineLabel &&
other.primaryColorBrightness == primaryColorBrightness &&
other.androidOverscrollIndicator == androidOverscrollIndicator &&
other.toggleableActiveColor == toggleableActiveColor &&
Expand Down Expand Up @@ -2269,7 +2232,6 @@ class ThemeData with Diagnosticable {
toggleButtonsTheme,
tooltipTheme,
// DEPRECATED (newest deprecations at the bottom)
fixTextFieldOutlineLabel,
primaryColorBrightness,
androidOverscrollIndicator,
toggleableActiveColor,
Expand Down Expand Up @@ -2376,7 +2338,6 @@ class ThemeData with Diagnosticable {
properties.add(DiagnosticsProperty<ToggleButtonsThemeData>('toggleButtonsTheme', toggleButtonsTheme, level: DiagnosticLevel.debug));
properties.add(DiagnosticsProperty<TooltipThemeData>('tooltipTheme', tooltipTheme, level: DiagnosticLevel.debug));
// DEPRECATED (newest deprecations at the bottom)
properties.add(DiagnosticsProperty<bool>('fixTextFieldOutlineLabel', fixTextFieldOutlineLabel, level: DiagnosticLevel.debug));
properties.add(EnumProperty<Brightness>('primaryColorBrightness', primaryColorBrightness, defaultValue: defaultData.primaryColorBrightness, level: DiagnosticLevel.debug));
properties.add(EnumProperty<AndroidOverscrollIndicator>('androidOverscrollIndicator', androidOverscrollIndicator, defaultValue: null, level: DiagnosticLevel.debug));
properties.add(ColorProperty('toggleableActiveColor', toggleableActiveColor, defaultValue: defaultData.toggleableActiveColor, level: DiagnosticLevel.debug));
Expand Down
28 changes: 0 additions & 28 deletions packages/flutter/test/material/input_decorator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6250,34 +6250,6 @@ void main() {
expect(getLabelStyle(tester).color, labelStyle.color);
});

testWidgets("InputDecorator's floating label origin no longer depends on ThemeData.fixTextFieldOutlineLabel", (WidgetTester tester) async {
Widget buildFrame(bool fixTextFieldOutlineLabel) {
return buildInputDecorator(
useMaterial3: useMaterial3,
isEmpty: true,
theme: ThemeData.light().copyWith(
fixTextFieldOutlineLabel: fixTextFieldOutlineLabel,
),
decoration: const InputDecoration(
labelText: 'label',
enabledBorder: OutlineInputBorder(),
floatingLabelBehavior: FloatingLabelBehavior.always,
),
);
}

await tester.pumpWidget(buildFrame(false));
await tester.pumpAndSettle();

// floatingLabelHeight = 12 (font size 16dps * 0.75 = 12)
// labelY = -floatingLabelHeight/2 + borderWidth/2
expect(tester.getTopLeft(find.text('label')).dy, -5.5);

await tester.pumpWidget(buildFrame(true));
await tester.pumpAndSettle();
expect(tester.getTopLeft(find.text('label')).dy, -5.5);
});

testWidgets('hint style overflow works', (WidgetTester tester) async {
final String hintText = 'hint text' * 20;
const TextStyle hintStyle = TextStyle(
Expand Down
5 changes: 0 additions & 5 deletions packages/flutter/test/material/theme_data_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,6 @@ void main() {
toggleButtonsTheme: const ToggleButtonsThemeData(textStyle: TextStyle(color: Colors.black)),
tooltipTheme: const TooltipThemeData(height: 100),
// DEPRECATED (newest deprecations at the bottom)
fixTextFieldOutlineLabel: false,
primaryColorBrightness: Brightness.dark,
androidOverscrollIndicator: AndroidOverscrollIndicator.glow,
toggleableActiveColor: Colors.black,
Expand Down Expand Up @@ -947,7 +946,6 @@ void main() {
tooltipTheme: const TooltipThemeData(height: 100),

// DEPRECATED (newest deprecations at the bottom)
fixTextFieldOutlineLabel: true,
primaryColorBrightness: Brightness.light,
androidOverscrollIndicator: AndroidOverscrollIndicator.stretch,
toggleableActiveColor: Colors.white,
Expand Down Expand Up @@ -1051,7 +1049,6 @@ void main() {
tooltipTheme: otherTheme.tooltipTheme,

// DEPRECATED (newest deprecations at the bottom)
fixTextFieldOutlineLabel: otherTheme.fixTextFieldOutlineLabel,
primaryColorBrightness: otherTheme.primaryColorBrightness,
androidOverscrollIndicator: otherTheme.androidOverscrollIndicator,
toggleableActiveColor: otherTheme.toggleableActiveColor,
Expand Down Expand Up @@ -1156,7 +1153,6 @@ void main() {
expect(themeDataCopy.tooltipTheme, equals(otherTheme.tooltipTheme));

// DEPRECATED (newest deprecations at the bottom)
expect(themeDataCopy.fixTextFieldOutlineLabel, equals(otherTheme.fixTextFieldOutlineLabel));
expect(themeDataCopy.primaryColorBrightness, equals(otherTheme.primaryColorBrightness));
expect(themeDataCopy.androidOverscrollIndicator, equals(otherTheme.androidOverscrollIndicator));
expect(themeDataCopy.toggleableActiveColor, equals(otherTheme.toggleableActiveColor));
Expand Down Expand Up @@ -1292,7 +1288,6 @@ void main() {
'toggleButtonsTheme',
'tooltipTheme',
// DEPRECATED (newest deprecations at the bottom)
'fixTextFieldOutlineLabel',
'primaryColorBrightness',
'androidOverscrollIndicator',
'toggleableActiveColor',
Expand Down

0 comments on commit d44d657

Please sign in to comment.