Unverified Commit d44d657a authored by Renzo Olivares's avatar Renzo Olivares Committed by GitHub

Remove deprecated fixTextFieldOutlineLabel (#125893)

The deprecation period has elapsed. The method was made obsolete in https://github.com/flutter/flutter/pull/87281.
parent 45179a62
...@@ -388,11 +388,6 @@ class ThemeData with Diagnosticable { ...@@ -388,11 +388,6 @@ class ThemeData with Diagnosticable {
ToggleButtonsThemeData? toggleButtonsTheme, ToggleButtonsThemeData? toggleButtonsTheme,
TooltipThemeData? tooltipTheme, TooltipThemeData? tooltipTheme,
// DEPRECATED (newest deprecations at the bottom) // 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( @Deprecated(
'No longer used by the framework, please remove any reference to it. ' 'No longer used by the framework, please remove any reference to it. '
'This feature was deprecated after v2.6.0-11.0.pre.', 'This feature was deprecated after v2.6.0-11.0.pre.',
...@@ -605,7 +600,6 @@ class ThemeData with Diagnosticable { ...@@ -605,7 +600,6 @@ class ThemeData with Diagnosticable {
tooltipTheme ??= const TooltipThemeData(); tooltipTheme ??= const TooltipThemeData();
// DEPRECATED (newest deprecations at the bottom) // DEPRECATED (newest deprecations at the bottom)
fixTextFieldOutlineLabel ??= true;
primaryColorBrightness = estimatedPrimaryColorBrightness; primaryColorBrightness = estimatedPrimaryColorBrightness;
errorColor ??= Colors.red[700]!; errorColor ??= Colors.red[700]!;
backgroundColor ??= isDark ? Colors.grey[700]! : primarySwatch[200]!; backgroundColor ??= isDark ? Colors.grey[700]! : primarySwatch[200]!;
...@@ -703,7 +697,6 @@ class ThemeData with Diagnosticable { ...@@ -703,7 +697,6 @@ class ThemeData with Diagnosticable {
toggleButtonsTheme: toggleButtonsTheme, toggleButtonsTheme: toggleButtonsTheme,
tooltipTheme: tooltipTheme, tooltipTheme: tooltipTheme,
// DEPRECATED (newest deprecations at the bottom) // DEPRECATED (newest deprecations at the bottom)
fixTextFieldOutlineLabel: fixTextFieldOutlineLabel,
primaryColorBrightness: primaryColorBrightness, primaryColorBrightness: primaryColorBrightness,
androidOverscrollIndicator: androidOverscrollIndicator, androidOverscrollIndicator: androidOverscrollIndicator,
toggleableActiveColor: toggleableActiveColor, toggleableActiveColor: toggleableActiveColor,
...@@ -816,11 +809,6 @@ class ThemeData with Diagnosticable { ...@@ -816,11 +809,6 @@ class ThemeData with Diagnosticable {
required this.toggleButtonsTheme, required this.toggleButtonsTheme,
required this.tooltipTheme, required this.tooltipTheme,
// DEPRECATED (newest deprecations at the bottom) // 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( @Deprecated(
'No longer used by the framework, please remove any reference to it. ' 'No longer used by the framework, please remove any reference to it. '
'This feature was deprecated after v2.6.0-11.0.pre.', 'This feature was deprecated after v2.6.0-11.0.pre.',
...@@ -861,7 +849,6 @@ class ThemeData with Diagnosticable { ...@@ -861,7 +849,6 @@ class ThemeData with Diagnosticable {
}) : // DEPRECATED (newest deprecations at the bottom) }) : // DEPRECATED (newest deprecations at the bottom)
// should not be `required`, use getter pattern to avoid breakages. // should not be `required`, use getter pattern to avoid breakages.
_fixTextFieldOutlineLabel = fixTextFieldOutlineLabel,
_primaryColorBrightness = primaryColorBrightness, _primaryColorBrightness = primaryColorBrightness,
_toggleableActiveColor = toggleableActiveColor, _toggleableActiveColor = toggleableActiveColor,
_selectedRowColor = selectedRowColor, _selectedRowColor = selectedRowColor,
...@@ -870,7 +857,6 @@ class ThemeData with Diagnosticable { ...@@ -870,7 +857,6 @@ class ThemeData with Diagnosticable {
_bottomAppBarColor = bottomAppBarColor, _bottomAppBarColor = bottomAppBarColor,
assert(toggleableActiveColor != null), assert(toggleableActiveColor != null),
// DEPRECATED (newest deprecations at the bottom) // DEPRECATED (newest deprecations at the bottom)
assert(fixTextFieldOutlineLabel != null),
assert(primaryColorBrightness != null), assert(primaryColorBrightness != null),
assert(errorColor != null), assert(errorColor != null),
assert(backgroundColor != null); assert(backgroundColor != null);
...@@ -1537,21 +1523,6 @@ class ThemeData with Diagnosticable { ...@@ -1537,21 +1523,6 @@ class ThemeData with Diagnosticable {
// DEPRECATED (newest deprecations at the bottom) // 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 /// 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). /// of text and icons placed on top of the primary color (e.g. toolbar text).
/// ///
...@@ -1724,11 +1695,6 @@ class ThemeData with Diagnosticable { ...@@ -1724,11 +1695,6 @@ class ThemeData with Diagnosticable {
ToggleButtonsThemeData? toggleButtonsTheme, ToggleButtonsThemeData? toggleButtonsTheme,
TooltipThemeData? tooltipTheme, TooltipThemeData? tooltipTheme,
// DEPRECATED (newest deprecations at the bottom) // 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( @Deprecated(
'No longer used by the framework, please remove any reference to it. ' 'No longer used by the framework, please remove any reference to it. '
'This feature was deprecated after v2.6.0-11.0.pre.', 'This feature was deprecated after v2.6.0-11.0.pre.',
...@@ -1860,7 +1826,6 @@ class ThemeData with Diagnosticable { ...@@ -1860,7 +1826,6 @@ class ThemeData with Diagnosticable {
toggleButtonsTheme: toggleButtonsTheme ?? this.toggleButtonsTheme, toggleButtonsTheme: toggleButtonsTheme ?? this.toggleButtonsTheme,
tooltipTheme: tooltipTheme ?? this.tooltipTheme, tooltipTheme: tooltipTheme ?? this.tooltipTheme,
// DEPRECATED (newest deprecations at the bottom) // DEPRECATED (newest deprecations at the bottom)
fixTextFieldOutlineLabel: fixTextFieldOutlineLabel ?? _fixTextFieldOutlineLabel,
primaryColorBrightness: primaryColorBrightness ?? _primaryColorBrightness, primaryColorBrightness: primaryColorBrightness ?? _primaryColorBrightness,
androidOverscrollIndicator: androidOverscrollIndicator ?? this.androidOverscrollIndicator, androidOverscrollIndicator: androidOverscrollIndicator ?? this.androidOverscrollIndicator,
toggleableActiveColor: toggleableActiveColor ?? _toggleableActiveColor, toggleableActiveColor: toggleableActiveColor ?? _toggleableActiveColor,
...@@ -2056,7 +2021,6 @@ class ThemeData with Diagnosticable { ...@@ -2056,7 +2021,6 @@ class ThemeData with Diagnosticable {
toggleButtonsTheme: ToggleButtonsThemeData.lerp(a.toggleButtonsTheme, b.toggleButtonsTheme, t)!, toggleButtonsTheme: ToggleButtonsThemeData.lerp(a.toggleButtonsTheme, b.toggleButtonsTheme, t)!,
tooltipTheme: TooltipThemeData.lerp(a.tooltipTheme, b.tooltipTheme, t)!, tooltipTheme: TooltipThemeData.lerp(a.tooltipTheme, b.tooltipTheme, t)!,
// DEPRECATED (newest deprecations at the bottom) // DEPRECATED (newest deprecations at the bottom)
fixTextFieldOutlineLabel: t < 0.5 ? a.fixTextFieldOutlineLabel : b.fixTextFieldOutlineLabel,
primaryColorBrightness: t < 0.5 ? a.primaryColorBrightness : b.primaryColorBrightness, primaryColorBrightness: t < 0.5 ? a.primaryColorBrightness : b.primaryColorBrightness,
androidOverscrollIndicator:t < 0.5 ? a.androidOverscrollIndicator : b.androidOverscrollIndicator, androidOverscrollIndicator:t < 0.5 ? a.androidOverscrollIndicator : b.androidOverscrollIndicator,
toggleableActiveColor: Color.lerp(a.toggleableActiveColor, b.toggleableActiveColor, t), toggleableActiveColor: Color.lerp(a.toggleableActiveColor, b.toggleableActiveColor, t),
...@@ -2164,7 +2128,6 @@ class ThemeData with Diagnosticable { ...@@ -2164,7 +2128,6 @@ class ThemeData with Diagnosticable {
other.toggleButtonsTheme == toggleButtonsTheme && other.toggleButtonsTheme == toggleButtonsTheme &&
other.tooltipTheme == tooltipTheme && other.tooltipTheme == tooltipTheme &&
// DEPRECATED (newest deprecations at the bottom) // DEPRECATED (newest deprecations at the bottom)
other.fixTextFieldOutlineLabel == fixTextFieldOutlineLabel &&
other.primaryColorBrightness == primaryColorBrightness && other.primaryColorBrightness == primaryColorBrightness &&
other.androidOverscrollIndicator == androidOverscrollIndicator && other.androidOverscrollIndicator == androidOverscrollIndicator &&
other.toggleableActiveColor == toggleableActiveColor && other.toggleableActiveColor == toggleableActiveColor &&
...@@ -2269,7 +2232,6 @@ class ThemeData with Diagnosticable { ...@@ -2269,7 +2232,6 @@ class ThemeData with Diagnosticable {
toggleButtonsTheme, toggleButtonsTheme,
tooltipTheme, tooltipTheme,
// DEPRECATED (newest deprecations at the bottom) // DEPRECATED (newest deprecations at the bottom)
fixTextFieldOutlineLabel,
primaryColorBrightness, primaryColorBrightness,
androidOverscrollIndicator, androidOverscrollIndicator,
toggleableActiveColor, toggleableActiveColor,
...@@ -2376,7 +2338,6 @@ class ThemeData with Diagnosticable { ...@@ -2376,7 +2338,6 @@ class ThemeData with Diagnosticable {
properties.add(DiagnosticsProperty<ToggleButtonsThemeData>('toggleButtonsTheme', toggleButtonsTheme, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty<ToggleButtonsThemeData>('toggleButtonsTheme', toggleButtonsTheme, level: DiagnosticLevel.debug));
properties.add(DiagnosticsProperty<TooltipThemeData>('tooltipTheme', tooltipTheme, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty<TooltipThemeData>('tooltipTheme', tooltipTheme, level: DiagnosticLevel.debug));
// DEPRECATED (newest deprecations at the bottom) // 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<Brightness>('primaryColorBrightness', primaryColorBrightness, defaultValue: defaultData.primaryColorBrightness, level: DiagnosticLevel.debug));
properties.add(EnumProperty<AndroidOverscrollIndicator>('androidOverscrollIndicator', androidOverscrollIndicator, defaultValue: null, 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)); properties.add(ColorProperty('toggleableActiveColor', toggleableActiveColor, defaultValue: defaultData.toggleableActiveColor, level: DiagnosticLevel.debug));
......
...@@ -6250,34 +6250,6 @@ void main() { ...@@ -6250,34 +6250,6 @@ void main() {
expect(getLabelStyle(tester).color, labelStyle.color); 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 { testWidgets('hint style overflow works', (WidgetTester tester) async {
final String hintText = 'hint text' * 20; final String hintText = 'hint text' * 20;
const TextStyle hintStyle = TextStyle( const TextStyle hintStyle = TextStyle(
......
...@@ -826,7 +826,6 @@ void main() { ...@@ -826,7 +826,6 @@ void main() {
toggleButtonsTheme: const ToggleButtonsThemeData(textStyle: TextStyle(color: Colors.black)), toggleButtonsTheme: const ToggleButtonsThemeData(textStyle: TextStyle(color: Colors.black)),
tooltipTheme: const TooltipThemeData(height: 100), tooltipTheme: const TooltipThemeData(height: 100),
// DEPRECATED (newest deprecations at the bottom) // DEPRECATED (newest deprecations at the bottom)
fixTextFieldOutlineLabel: false,
primaryColorBrightness: Brightness.dark, primaryColorBrightness: Brightness.dark,
androidOverscrollIndicator: AndroidOverscrollIndicator.glow, androidOverscrollIndicator: AndroidOverscrollIndicator.glow,
toggleableActiveColor: Colors.black, toggleableActiveColor: Colors.black,
...@@ -947,7 +946,6 @@ void main() { ...@@ -947,7 +946,6 @@ void main() {
tooltipTheme: const TooltipThemeData(height: 100), tooltipTheme: const TooltipThemeData(height: 100),
// DEPRECATED (newest deprecations at the bottom) // DEPRECATED (newest deprecations at the bottom)
fixTextFieldOutlineLabel: true,
primaryColorBrightness: Brightness.light, primaryColorBrightness: Brightness.light,
androidOverscrollIndicator: AndroidOverscrollIndicator.stretch, androidOverscrollIndicator: AndroidOverscrollIndicator.stretch,
toggleableActiveColor: Colors.white, toggleableActiveColor: Colors.white,
...@@ -1051,7 +1049,6 @@ void main() { ...@@ -1051,7 +1049,6 @@ void main() {
tooltipTheme: otherTheme.tooltipTheme, tooltipTheme: otherTheme.tooltipTheme,
// DEPRECATED (newest deprecations at the bottom) // DEPRECATED (newest deprecations at the bottom)
fixTextFieldOutlineLabel: otherTheme.fixTextFieldOutlineLabel,
primaryColorBrightness: otherTheme.primaryColorBrightness, primaryColorBrightness: otherTheme.primaryColorBrightness,
androidOverscrollIndicator: otherTheme.androidOverscrollIndicator, androidOverscrollIndicator: otherTheme.androidOverscrollIndicator,
toggleableActiveColor: otherTheme.toggleableActiveColor, toggleableActiveColor: otherTheme.toggleableActiveColor,
...@@ -1156,7 +1153,6 @@ void main() { ...@@ -1156,7 +1153,6 @@ void main() {
expect(themeDataCopy.tooltipTheme, equals(otherTheme.tooltipTheme)); expect(themeDataCopy.tooltipTheme, equals(otherTheme.tooltipTheme));
// DEPRECATED (newest deprecations at the bottom) // DEPRECATED (newest deprecations at the bottom)
expect(themeDataCopy.fixTextFieldOutlineLabel, equals(otherTheme.fixTextFieldOutlineLabel));
expect(themeDataCopy.primaryColorBrightness, equals(otherTheme.primaryColorBrightness)); expect(themeDataCopy.primaryColorBrightness, equals(otherTheme.primaryColorBrightness));
expect(themeDataCopy.androidOverscrollIndicator, equals(otherTheme.androidOverscrollIndicator)); expect(themeDataCopy.androidOverscrollIndicator, equals(otherTheme.androidOverscrollIndicator));
expect(themeDataCopy.toggleableActiveColor, equals(otherTheme.toggleableActiveColor)); expect(themeDataCopy.toggleableActiveColor, equals(otherTheme.toggleableActiveColor));
...@@ -1292,7 +1288,6 @@ void main() { ...@@ -1292,7 +1288,6 @@ void main() {
'toggleButtonsTheme', 'toggleButtonsTheme',
'tooltipTheme', 'tooltipTheme',
// DEPRECATED (newest deprecations at the bottom) // DEPRECATED (newest deprecations at the bottom)
'fixTextFieldOutlineLabel',
'primaryColorBrightness', 'primaryColorBrightness',
'androidOverscrollIndicator', 'androidOverscrollIndicator',
'toggleableActiveColor', 'toggleableActiveColor',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment