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
eddba97d
Unverified
Commit
eddba97d
authored
Apr 28, 2020
by
Mehmet Fidanboylu
Committed by
GitHub
Apr 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix behavior change due to incorrect initial floating setting (#55651)
parent
6cf9c7cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
input_decorator.dart
packages/flutter/lib/src/material/input_decorator.dart
+4
-2
input_decorator_test.dart
packages/flutter/test/material/input_decorator_test.dart
+14
-0
No files found.
packages/flutter/lib/src/material/input_decorator.dart
View file @
eddba97d
...
...
@@ -1915,8 +1915,10 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
super
.
initState
();
final
bool
labelIsInitiallyFloating
=
widget
.
decoration
.
floatingLabelBehavior
==
FloatingLabelBehavior
.
always
// ignore: deprecated_member_use_from_same_package
||
(
widget
.
decoration
.
hasFloatingPlaceholder
&&
widget
.
_labelShouldWithdraw
);
||
(
widget
.
decoration
.
floatingLabelBehavior
!=
FloatingLabelBehavior
.
never
&&
// ignore: deprecated_member_use_from_same_package
widget
.
decoration
.
hasFloatingPlaceholder
&&
widget
.
_labelShouldWithdraw
);
_floatingLabelController
=
AnimationController
(
duration:
_kTransitionDuration
,
...
...
packages/flutter/test/material/input_decorator_test.dart
View file @
eddba97d
...
...
@@ -3910,4 +3910,18 @@ void main() {
expect
(
tester
.
getTopLeft
(
find
.
text
(
'label'
)).
dy
,
-
4.0
);
});
testWidgets
(
'InputDecorator floating label obeys floatingLabelBehavior'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
buildInputDecorator
(
decoration:
const
InputDecoration
(
labelText:
'label'
,
floatingLabelBehavior:
FloatingLabelBehavior
.
never
,
),
),
);
// Passing floating behavior never results in a dy offset of 20
// because the label is not initially floating.
expect
(
tester
.
getTopLeft
(
find
.
text
(
'label'
)).
dy
,
20.0
);
});
}
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