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
5a864ded
Commit
5a864ded
authored
Dec 12, 2016
by
Matt Perry
Committed by
GitHub
Dec 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always reserve space for error text in text fields. (#7206)
Fixes
https://github.com/flutter/flutter/issues/6943
parent
25e6cc67
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
input.dart
packages/flutter/lib/src/material/input.dart
+6
-12
No files found.
packages/flutter/lib/src/material/input.dart
View file @
5a864ded
...
...
@@ -292,18 +292,11 @@ class _InputContainerState extends State<InputContainer> {
);
}
Color
borderColor
=
active
Color
;
double
bottomPadding
=
8
.0
;
double
bottomBorder
=
config
.
focused
?
2.0
:
1
.0
;
Color
borderColor
=
errorText
==
null
?
activeColor
:
themeData
.
error
Color
;
double
bottomPadding
=
config
.
isDense
?
8.0
:
1
.0
;
double
bottomBorder
=
2
.0
;
double
bottomHeight
=
config
.
isDense
?
14.0
:
18.0
;
if
(
errorText
!=
null
)
{
borderColor
=
themeData
.
errorColor
;
bottomBorder
=
2.0
;
if
(!
config
.
isDense
)
bottomPadding
=
1.0
;
}
EdgeInsets
padding
=
new
EdgeInsets
.
only
(
top:
topPadding
,
bottom:
bottomPadding
);
Border
border
=
new
Border
(
bottom:
new
BorderSide
(
...
...
@@ -334,12 +327,12 @@ class _InputContainerState extends State<InputContainer> {
}
stackChildren
.
add
(
divider
);
if
(
errorText
!=
null
&&
!
config
.
isDense
)
{
if
(!
config
.
isDense
)
{
TextStyle
errorStyle
=
themeData
.
textTheme
.
caption
.
copyWith
(
color:
themeData
.
errorColor
);
stackChildren
.
add
(
new
Positioned
(
left:
0.0
,
bottom:
0.0
,
child:
new
Text
(
errorText
,
style:
errorStyle
)
child:
new
Text
(
errorText
??
''
,
style:
errorStyle
)
));
}
...
...
@@ -450,6 +443,7 @@ class Input extends StatefulWidget {
final
bool
hideDivider
;
/// Whether the input field is part of a dense form (i.e., uses less vertical space).
/// If true, [errorText] is not shown.
final
bool
isDense
;
/// Whether this input field should focus itself if nothing else is already focused.
...
...
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