Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
a76212f8
Unverified
Commit
a76212f8
authored
Jul 29, 2021
by
Hans Muller
Committed by
GitHub
Jul 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate ThemeData.fixTextFieldOutlineLabel (#87281)
parent
caf876cf
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
17 deletions
+71
-17
fix_data.yaml
packages/flutter/lib/fix_data.yaml
+33
-0
theme_data.dart
packages/flutter/lib/src/material/theme_data.dart
+19
-5
input_decorator_test.dart
packages/flutter/test/material/input_decorator_test.dart
+5
-11
snack_bar_test.dart
packages/flutter/test/material/snack_bar_test.dart
+0
-1
material.dart
packages/flutter/test_fixes/material.dart
+7
-0
material.dart.expect
packages/flutter/test_fixes/material.dart.expect
+7
-0
No files found.
packages/flutter/lib/fix_data.yaml
View file @
a76212f8
...
...
@@ -15,6 +15,39 @@
version
:
1
transforms
:
# Changes made in https://github.com/flutter/flutter/pull/87281
-
title
:
"
Remove
'fixTextFieldOutlineLabel'"
date
:
2021-04-30
element
:
uris
:
[
'
material.dart'
]
method
:
'
copyWith'
inClass
:
'
ThemeData'
changes
:
-
kind
:
'
removeParameter'
name
:
'
fixTextFieldOutlineLabel'
# Changes made in https://github.com/flutter/flutter/pull/87281
-
title
:
"
Remove
'fixTextFieldOutlineLabel'"
date
:
2021-04-30
element
:
uris
:
[
'
material.dart'
]
constructor
:
'
raw'
inClass
:
'
ThemeData'
changes
:
-
kind
:
'
removeParameter'
name
:
'
fixTextFieldOutlineLabel'
# Changes made in https://github.com/flutter/flutter/pull/87281
-
title
:
"
Remove
'fixTextFieldOutlineLabel'"
date
:
2021-04-30
element
:
uris
:
[
'
material.dart'
]
constructor
:
'
'
inClass
:
'
ThemeData'
changes
:
-
kind
:
'
removeParameter'
name
:
'
fixTextFieldOutlineLabel'
# Changes made in https://github.com/flutter/flutter/pull/81336
-
title
:
"
Remove
'buttonColor'"
date
:
2021-04-30
...
...
packages/flutter/lib/src/material/theme_data.dart
View file @
a76212f8
...
...
@@ -336,6 +336,10 @@ class ThemeData with Diagnosticable {
RadioThemeData
?
radioTheme
,
SwitchThemeData
?
switchTheme
,
ProgressIndicatorThemeData
?
progressIndicatorTheme
,
@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. '
...
...
@@ -475,7 +479,7 @@ class ThemeData with Diagnosticable {
switchTheme
??=
const
SwitchThemeData
();
progressIndicatorTheme
??=
const
ProgressIndicatorThemeData
();
fixTextFieldOutlineLabel
??=
fals
e
;
fixTextFieldOutlineLabel
??=
tru
e
;
useTextSelectionTheme
??=
true
;
return
ThemeData
.
raw
(
...
...
@@ -687,6 +691,10 @@ class ThemeData with Diagnosticable {
required
this
.
radioTheme
,
required
this
.
switchTheme
,
required
this
.
progressIndicatorTheme
,
@Deprecated
(
'This "fix" is now enabled by default. '
'This feature was deprecated after v2.5.0-1.0.pre.'
,
)
required
this
.
fixTextFieldOutlineLabel
,
@Deprecated
(
'No longer used by the framework, please remove any reference to it. '
...
...
@@ -1326,16 +1334,18 @@ class ThemeData with Diagnosticable {
/// A theme for customizing the appearance and layout of [ProgressIndicator] widgets.
final
ProgressIndicatorThemeData
progressIndicatorTheme
;
/// A
temporary flag to allow apps to opt-in to
a
/// A
n 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 currently false by default. It will be default true and
/// deprecated before the next beta release (1.18), and removed before the next
/// stable release (1.19).
/// 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.'
,
)
final
bool
fixTextFieldOutlineLabel
;
/// A temporary flag that was used to opt-in to the new [TextSelectionTheme]
...
...
@@ -1469,6 +1479,10 @@ class ThemeData with Diagnosticable {
RadioThemeData
?
radioTheme
,
SwitchThemeData
?
switchTheme
,
ProgressIndicatorThemeData
?
progressIndicatorTheme
,
@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. '
...
...
packages/flutter/test/material/input_decorator_test.dart
View file @
a76212f8
...
...
@@ -23,7 +23,6 @@ Widget buildInputDecorator({
TextStyle
?
baseStyle
,
TextAlignVertical
?
textAlignVertical
,
VisualDensity
?
visualDensity
,
bool
fixTextFieldOutlineLabel
=
false
,
Widget
child
=
const
Text
(
'text'
,
style:
TextStyle
(
fontFamily:
'Ahem'
,
fontSize:
16.0
),
...
...
@@ -37,7 +36,6 @@ Widget buildInputDecorator({
data:
(
theme
??
Theme
.
of
(
context
)).
copyWith
(
inputDecorationTheme:
inputDecorationTheme
,
visualDensity:
visualDensity
,
fixTextFieldOutlineLabel:
fixTextFieldOutlineLabel
,
),
child:
Align
(
alignment:
Alignment
.
topLeft
,
...
...
@@ -3963,17 +3961,17 @@ void main() {
await
pumpDecorator
(
focused:
false
,
empty:
false
);
await
tester
.
pumpAndSettle
();
expect
(
getLabelRect
(
tester
).
topLeft
,
equals
(
const
Offset
(
12
,
-
4
)));
expect
(
getLabelRect
(
tester
).
topLeft
,
equals
(
const
Offset
(
12
,
-
5.5
)));
expect
(
getLabelRect
(
tester
).
size
,
equals
(
const
Size
(
80
,
16
)));
await
pumpDecorator
(
focused:
true
,
empty:
true
);
await
tester
.
pumpAndSettle
();
expect
(
getLabelRect
(
tester
).
topLeft
,
equals
(
const
Offset
(
12
,
-
4
)));
expect
(
getLabelRect
(
tester
).
topLeft
,
equals
(
const
Offset
(
12
,
-
5.5
)));
expect
(
getLabelRect
(
tester
).
size
,
equals
(
const
Size
(
80
,
16
)));
await
pumpDecorator
(
focused:
true
,
empty:
false
);
await
tester
.
pumpAndSettle
();
expect
(
getLabelRect
(
tester
).
topLeft
,
equals
(
const
Offset
(
12
,
-
4
)));
expect
(
getLabelRect
(
tester
).
topLeft
,
equals
(
const
Offset
(
12
,
-
5.5
)));
expect
(
getLabelRect
(
tester
).
size
,
equals
(
const
Size
(
80
,
16
)));
await
pumpDecorator
(
focused:
false
,
empty:
true
,
enabled:
false
);
...
...
@@ -3983,7 +3981,7 @@ void main() {
await
pumpDecorator
(
focused:
false
,
empty:
false
,
enabled:
false
);
await
tester
.
pumpAndSettle
();
expect
(
getLabelRect
(
tester
).
topLeft
,
equals
(
const
Offset
(
12
,
-
4
)));
expect
(
getLabelRect
(
tester
).
topLeft
,
equals
(
const
Offset
(
12
,
-
5.5
)));
expect
(
getLabelRect
(
tester
).
size
,
equals
(
const
Size
(
80
,
16
)));
// Focused and disabled happens with NavigationMode.directional.
...
...
@@ -3994,7 +3992,7 @@ void main() {
await
pumpDecorator
(
focused:
true
,
empty:
false
,
enabled:
false
);
await
tester
.
pumpAndSettle
();
expect
(
getLabelRect
(
tester
).
topLeft
,
equals
(
const
Offset
(
12
,
-
4
)));
expect
(
getLabelRect
(
tester
).
topLeft
,
equals
(
const
Offset
(
12
,
-
5.5
)));
expect
(
getLabelRect
(
tester
).
size
,
equals
(
const
Size
(
80
,
16
)));
});
...
...
@@ -4589,10 +4587,6 @@ void main() {
// Regression test for https://github.com/flutter/flutter/issues/54028
await
tester
.
pumpWidget
(
buildInputDecorator
(
// Temporary opt-in fix for https://github.com/flutter/flutter/issues/54028
// Ensures that the floating label is vertically centered relative to
// center of the top edge of the InputDecorator's outline border.
fixTextFieldOutlineLabel:
true
,
isEmpty:
true
,
decoration:
const
InputDecoration
(
labelText:
'label'
,
...
...
packages/flutter/test/material/snack_bar_test.dart
View file @
a76212f8
...
...
@@ -755,7 +755,6 @@ void main() {
radioTheme:
const
RadioThemeData
(),
switchTheme:
const
SwitchThemeData
(),
progressIndicatorTheme:
const
ProgressIndicatorThemeData
(),
fixTextFieldOutlineLabel:
false
,
useTextSelectionTheme:
false
,
);
...
...
packages/flutter/test_fixes/material.dart
View file @
a76212f8
...
...
@@ -387,4 +387,11 @@ void main() {
listWheelViewport
=
ListWheelViewport
(
clipToSize:
true
);
listWheelViewport
=
ListWheelViewport
(
clipToSize:
false
);
listWheelViewport
.
clipToSize
;
// Changes made in https://github.com/flutter/flutter/pull/87281
ThemeData
themeData
=
ThemeData
();
themeData
=
ThemeData
(
fixTextFieldOutlineLabel:
true
);
themeData
=
ThemeData
.
raw
(
fixTextFieldOutlineLabel:
true
);
themeData
=
themeData
.
copyWith
(
fixTextFieldOutlineLabel:
true
);
themeData
.
fixTextFieldOutlineLabel
;
// Removing field reference not supported.
}
packages/flutter/test_fixes/material.dart.expect
View file @
a76212f8
...
...
@@ -359,4 +359,11 @@ void main() {
listWheelViewport = ListWheelViewport(clipBehavior: Clip.hardEdge);
listWheelViewport = ListWheelViewport(clipBehavior: Clip.none);
listWheelViewport.clipBehavior;
// Changes made in https://github.com/flutter/flutter/pull/87281
ThemeData themeData = ThemeData();
themeData = ThemeData();
themeData = ThemeData.raw();
themeData = themeData.copyWith();
themeData.fixTextFieldOutlineLabel; // Removing field reference not supported.
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment