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
2a58bb75
Unverified
Commit
2a58bb75
authored
Jul 11, 2022
by
Casey Hillers
Committed by
GitHub
Jul 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "`InputDecorator`: Switch hint to Opacity instead of AnimatedOpacity" (#107406)
parent
975ec104
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
92 additions
and
41 deletions
+92
-41
input_decorator.dart
packages/flutter/lib/src/material/input_decorator.dart
+3
-1
input_date_picker_form_field_test.dart
...tter/test/material/input_date_picker_form_field_test.dart
+4
-3
input_decorator_test.dart
packages/flutter/test/material/input_decorator_test.dart
+82
-25
text_field_test.dart
packages/flutter/test/material/text_field_test.dart
+3
-12
No files found.
packages/flutter/lib/src/material/input_decorator.dart
View file @
2a58bb75
...
@@ -2157,8 +2157,10 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
...
@@ -2157,8 +2157,10 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
final
TextBaseline
textBaseline
=
labelStyle
.
textBaseline
!;
final
TextBaseline
textBaseline
=
labelStyle
.
textBaseline
!;
final
TextStyle
hintStyle
=
_getInlineHintStyle
(
themeData
);
final
TextStyle
hintStyle
=
_getInlineHintStyle
(
themeData
);
final
Widget
?
hint
=
decoration
!.
hintText
==
null
?
null
:
Opacity
(
final
Widget
?
hint
=
decoration
!.
hintText
==
null
?
null
:
Animated
Opacity
(
opacity:
(
isEmpty
&&
!
_hasInlineLabel
)
?
1.0
:
0.0
,
opacity:
(
isEmpty
&&
!
_hasInlineLabel
)
?
1.0
:
0.0
,
duration:
_kTransitionDuration
,
curve:
_kTransitionCurve
,
alwaysIncludeSemantics:
true
,
alwaysIncludeSemantics:
true
,
child:
Text
(
child:
Text
(
decoration
!.
hintText
!,
decoration
!.
hintText
!,
...
...
packages/flutter/test/material/input_date_picker_form_field_test.dart
View file @
2a58bb75
...
@@ -61,12 +61,13 @@ void main() {
...
@@ -61,12 +61,13 @@ void main() {
}
}
double
textOpacity
(
WidgetTester
tester
,
String
textValue
)
{
double
textOpacity
(
WidgetTester
tester
,
String
textValue
)
{
return
tester
.
widget
<
Opacity
>(
final
FadeTransition
opacityWidget
=
tester
.
widget
<
FadeTransition
>(
find
.
ancestor
(
find
.
ancestor
(
of:
find
.
text
(
textValue
),
of:
find
.
text
(
textValue
),
matching:
find
.
byType
(
Opacity
),
matching:
find
.
byType
(
FadeTransition
),
).
first
,
).
first
,
).
opacity
;
);
return
opacityWidget
.
opacity
.
value
;
}
}
group
(
'InputDatePickerFormField'
,
()
{
group
(
'InputDatePickerFormField'
,
()
{
...
...
packages/flutter/test/material/input_decorator_test.dart
View file @
2a58bb75
This diff is collapsed.
Click to expand it.
packages/flutter/test/material/text_field_test.dart
View file @
2a58bb75
...
@@ -131,15 +131,6 @@ double getOpacity(WidgetTester tester, Finder finder) {
...
@@ -131,15 +131,6 @@ double getOpacity(WidgetTester tester, Finder finder) {
).
opacity
.
value
;
).
opacity
.
value
;
}
}
double
getStaticOpacity
(
WidgetTester
tester
,
Finder
finder
)
{
return
tester
.
widget
<
Opacity
>(
find
.
ancestor
(
of:
finder
,
matching:
find
.
byType
(
Opacity
),
).
first
,
).
opacity
;
}
class
TestFormatter
extends
TextInputFormatter
{
class
TestFormatter
extends
TextInputFormatter
{
TestFormatter
(
this
.
onFormatEditUpdate
);
TestFormatter
(
this
.
onFormatEditUpdate
);
FormatEditUpdateCallback
onFormatEditUpdate
;
FormatEditUpdateCallback
onFormatEditUpdate
;
...
@@ -3681,7 +3672,7 @@ void main() {
...
@@ -3681,7 +3672,7 @@ void main() {
// Neither the prefix or the suffix should initially be visible, only the hint.
// Neither the prefix or the suffix should initially be visible, only the hint.
expect
(
getOpacity
(
tester
,
find
.
text
(
'Prefix'
)),
0.0
);
expect
(
getOpacity
(
tester
,
find
.
text
(
'Prefix'
)),
0.0
);
expect
(
getOpacity
(
tester
,
find
.
text
(
'Suffix'
)),
0.0
);
expect
(
getOpacity
(
tester
,
find
.
text
(
'Suffix'
)),
0.0
);
expect
(
get
Static
Opacity
(
tester
,
find
.
text
(
'Hint'
)),
1.0
);
expect
(
getOpacity
(
tester
,
find
.
text
(
'Hint'
)),
1.0
);
await
tester
.
tap
(
find
.
byKey
(
secondKey
));
await
tester
.
tap
(
find
.
byKey
(
secondKey
));
await
tester
.
pumpAndSettle
();
await
tester
.
pumpAndSettle
();
...
@@ -3689,7 +3680,7 @@ void main() {
...
@@ -3689,7 +3680,7 @@ void main() {
// Focus the Input. The hint, prefix, and suffix should appear
// Focus the Input. The hint, prefix, and suffix should appear
expect
(
getOpacity
(
tester
,
find
.
text
(
'Prefix'
)),
1.0
);
expect
(
getOpacity
(
tester
,
find
.
text
(
'Prefix'
)),
1.0
);
expect
(
getOpacity
(
tester
,
find
.
text
(
'Suffix'
)),
1.0
);
expect
(
getOpacity
(
tester
,
find
.
text
(
'Suffix'
)),
1.0
);
expect
(
get
Static
Opacity
(
tester
,
find
.
text
(
'Hint'
)),
1.0
);
expect
(
getOpacity
(
tester
,
find
.
text
(
'Hint'
)),
1.0
);
// Enter some text, and the hint should disappear and the prefix and suffix
// Enter some text, and the hint should disappear and the prefix and suffix
// should continue to be visible
// should continue to be visible
...
@@ -3698,7 +3689,7 @@ void main() {
...
@@ -3698,7 +3689,7 @@ void main() {
expect
(
getOpacity
(
tester
,
find
.
text
(
'Prefix'
)),
1.0
);
expect
(
getOpacity
(
tester
,
find
.
text
(
'Prefix'
)),
1.0
);
expect
(
getOpacity
(
tester
,
find
.
text
(
'Suffix'
)),
1.0
);
expect
(
getOpacity
(
tester
,
find
.
text
(
'Suffix'
)),
1.0
);
expect
(
get
Static
Opacity
(
tester
,
find
.
text
(
'Hint'
)),
0.0
);
expect
(
getOpacity
(
tester
,
find
.
text
(
'Hint'
)),
0.0
);
// Check and make sure that the right styles were applied.
// Check and make sure that the right styles were applied.
final
Text
prefixText
=
tester
.
widget
(
find
.
text
(
'Prefix'
));
final
Text
prefixText
=
tester
.
widget
(
find
.
text
(
'Prefix'
));
...
...
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