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 {
...
@@ -177,6 +177,7 @@ class InputContainer extends StatefulWidget {
this
.
errorText
,
this
.
errorText
,
this
.
style
,
this
.
style
,
this
.
isDense
:
false
,
this
.
isDense
:
false
,
this
.
hideDivider
:
false
,
this
.
child
,
this
.
child
,
})
:
super
(
key:
key
);
})
:
super
(
key:
key
);
...
@@ -213,6 +214,9 @@ class InputContainer extends StatefulWidget {
...
@@ -213,6 +214,9 @@ class InputContainer extends StatefulWidget {
/// to the child.
/// to the child.
final
bool
isEmpty
;
final
bool
isEmpty
;
/// Hide the divider that appears below the child and above the error text.
final
bool
hideDivider
;
final
Widget
child
;
final
Widget
child
;
@override
@override
...
@@ -304,16 +308,26 @@ class _InputContainerState extends State<InputContainer> {
...
@@ -304,16 +308,26 @@ class _InputContainerState extends State<InputContainer> {
);
);
EdgeInsets
margin
=
new
EdgeInsets
.
only
(
bottom:
bottomHeight
-
(
bottomPadding
+
bottomBorder
));
EdgeInsets
margin
=
new
EdgeInsets
.
only
(
bottom:
bottomHeight
-
(
bottomPadding
+
bottomBorder
));
stackChildren
.
add
(
new
AnimatedContainer
(
Widget
divider
;
margin:
margin
,
if
(
config
.
hideDivider
)
{
padding:
padding
,
divider
=
new
Container
(
duration:
_kTransitionDuration
,
margin:
margin
+
new
EdgeInsets
.
only
(
bottom:
bottomBorder
),
curve:
_kTransitionCurve
,
padding:
padding
,
decoration:
new
BoxDecoration
(
child:
config
.
child
,
border:
border
,
);
),
}
else
{
child:
config
.
child
,
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
)
{
if
(
errorText
!=
null
&&
!
config
.
isDense
)
{
TextStyle
errorStyle
=
themeData
.
textTheme
.
caption
.
copyWith
(
color:
themeData
.
errorColor
);
TextStyle
errorStyle
=
themeData
.
textTheme
.
caption
.
copyWith
(
color:
themeData
.
errorColor
);
...
@@ -385,6 +399,7 @@ class Input extends StatefulWidget {
...
@@ -385,6 +399,7 @@ class Input extends StatefulWidget {
this
.
errorText
,
this
.
errorText
,
this
.
style
,
this
.
style
,
this
.
hideText
:
false
,
this
.
hideText
:
false
,
this
.
hideDivider
:
false
,
this
.
isDense
:
false
,
this
.
isDense
:
false
,
this
.
autofocus
:
false
,
this
.
autofocus
:
false
,
this
.
maxLines
:
1
,
this
.
maxLines
:
1
,
...
@@ -426,6 +441,9 @@ class Input extends StatefulWidget {
...
@@ -426,6 +441,9 @@ class Input extends StatefulWidget {
/// U+2022 BULLET characters (•).
/// U+2022 BULLET characters (•).
final
bool
hideText
;
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).
/// Whether the input field is part of a dense form (i.e., uses less vertical space).
final
bool
isDense
;
final
bool
isDense
;
...
@@ -478,6 +496,7 @@ class _InputState extends State<Input> {
...
@@ -478,6 +496,7 @@ class _InputState extends State<Input> {
errorText:
config
.
errorText
,
errorText:
config
.
errorText
,
style:
config
.
style
,
style:
config
.
style
,
isDense:
config
.
isDense
,
isDense:
config
.
isDense
,
hideDivider:
config
.
hideDivider
,
child:
new
InputField
(
child:
new
InputField
(
key:
_inputFieldKey
,
key:
_inputFieldKey
,
focusKey:
focusKey
,
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