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
37daf034
Commit
37daf034
authored
Nov 22, 2016
by
Hans Muller
Committed by
GitHub
Nov 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the InputContainer underline's visibility configurable (#6976)
parent
4828b2c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
10 deletions
+29
-10
input.dart
packages/flutter/lib/src/material/input.dart
+29
-10
No files found.
packages/flutter/lib/src/material/input.dart
View file @
37daf034
...
...
@@ -177,6 +177,7 @@ class InputContainer extends StatefulWidget {
this
.
errorText
,
this
.
style
,
this
.
isDense
:
false
,
this
.
hideDivider
:
false
,
this
.
child
,
})
:
super
(
key:
key
);
...
...
@@ -213,6 +214,9 @@ class InputContainer extends StatefulWidget {
/// to the child.
final
bool
isEmpty
;
/// Hide the divider that appears below the child and above the error text.
final
bool
hideDivider
;
final
Widget
child
;
@override
...
...
@@ -304,16 +308,26 @@ class _InputContainerState extends State<InputContainer> {
);
EdgeInsets
margin
=
new
EdgeInsets
.
only
(
bottom:
bottomHeight
-
(
bottomPadding
+
bottomBorder
));
stackChildren
.
add
(
new
AnimatedContainer
(
margin:
margin
,
padding:
padding
,
duration:
_kTransitionDuration
,
curve:
_kTransitionCurve
,
decoration:
new
BoxDecoration
(
border:
border
,
),
child:
config
.
child
,
));
Widget
divider
;
if
(
config
.
hideDivider
)
{
divider
=
new
Container
(
margin:
margin
+
new
EdgeInsets
.
only
(
bottom:
bottomBorder
),
padding:
padding
,
child:
config
.
child
,
);
}
else
{
divider
=
new
AnimatedContainer
(
margin:
margin
,
padding:
padding
,
duration:
_kTransitionDuration
,
curve:
_kTransitionCurve
,
decoration:
new
BoxDecoration
(
border:
border
,
),
child:
config
.
child
,
);
}
stackChildren
.
add
(
divider
);
if
(
errorText
!=
null
&&
!
config
.
isDense
)
{
TextStyle
errorStyle
=
themeData
.
textTheme
.
caption
.
copyWith
(
color:
themeData
.
errorColor
);
...
...
@@ -385,6 +399,7 @@ class Input extends StatefulWidget {
this
.
errorText
,
this
.
style
,
this
.
hideText
:
false
,
this
.
hideDivider
:
false
,
this
.
isDense
:
false
,
this
.
autofocus
:
false
,
this
.
maxLines
:
1
,
...
...
@@ -426,6 +441,9 @@ class Input extends StatefulWidget {
/// U+2022 BULLET characters (•).
final
bool
hideText
;
/// Hide the divider that appears below the child and above the error text.
final
bool
hideDivider
;
/// Whether the input field is part of a dense form (i.e., uses less vertical space).
final
bool
isDense
;
...
...
@@ -478,6 +496,7 @@ class _InputState extends State<Input> {
errorText:
config
.
errorText
,
style:
config
.
style
,
isDense:
config
.
isDense
,
hideDivider:
config
.
hideDivider
,
child:
new
InputField
(
key:
_inputFieldKey
,
focusKey:
focusKey
,
...
...
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