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
91213e2e
Commit
91213e2e
authored
Jun 19, 2019
by
Haijun
Committed by
LongCatIsLooong
Jun 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed cupertinoTextField placeholder textAlign (#33739)
parent
c50fa3d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
7 deletions
+36
-7
text_field.dart
packages/flutter/lib/src/cupertino/text_field.dart
+11
-7
text_field_test.dart
packages/flutter/test/cupertino/text_field_test.dart
+25
-0
No files found.
packages/flutter/lib/src/cupertino/text_field.dart
View file @
91213e2e
...
...
@@ -744,13 +744,17 @@ class _CupertinoTextFieldState extends State<CupertinoTextField> with AutomaticK
// if needed.
if
(
widget
.
placeholder
!=
null
&&
text
.
text
.
isEmpty
)
{
stackChildren
.
add
(
Padding
(
padding:
widget
.
padding
,
child:
Text
(
widget
.
placeholder
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
style:
placeholderStyle
SizedBox
(
width:
double
.
infinity
,
child:
Padding
(
padding:
widget
.
padding
,
child:
Text
(
widget
.
placeholder
,
maxLines:
widget
.
maxLines
,
overflow:
TextOverflow
.
ellipsis
,
style:
placeholderStyle
,
textAlign:
widget
.
textAlign
,
),
),
),
);
...
...
packages/flutter/test/cupertino/text_field_test.dart
View file @
91213e2e
...
...
@@ -544,6 +544,31 @@ void main() {
},
);
testWidgets
(
'placeholder respects textAlign'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
CupertinoApp
(
home:
Center
(
child:
CupertinoTextField
(
placeholder:
'placeholder'
,
textAlign:
TextAlign
.
right
,
),
),
),
);
final
Text
placeholder
=
tester
.
widget
(
find
.
text
(
'placeholder'
));
expect
(
placeholder
.
textAlign
,
TextAlign
.
right
);
await
tester
.
enterText
(
find
.
byType
(
CupertinoTextField
),
'input'
);
await
tester
.
pump
();
final
EditableText
inputText
=
tester
.
widget
(
find
.
text
(
'input'
));
expect
(
placeholder
.
textAlign
,
inputText
.
textAlign
);
},
);
testWidgets
(
'placeholders are lightly colored and disappears once typing starts'
,
(
WidgetTester
tester
)
async
{
...
...
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