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
08dbc7d6
Commit
08dbc7d6
authored
Dec 01, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #646 from abarth/input_padding
Fix Input padding to match the material spec
parents
6fbe39e2
6067b306
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
input.dart
packages/flutter/lib/src/material/input.dart
+14
-10
No files found.
packages/flutter/lib/src/material/input.dart
View file @
08dbc7d6
...
...
@@ -12,16 +12,13 @@ import 'theme.dart';
export
'package:flutter/rendering.dart'
show
ValueChanged
;
export
'package:flutter/services.dart'
show
KeyboardType
;
// TODO(eseidel): This isn't right, it's 16px on the bottom:
// http://www.google.com/design/spec/components/text-fields.html#text-fields-single-line-text-field
const
EdgeDims
_kTextfieldPadding
=
const
EdgeDims
.
symmetric
(
vertical:
8.0
);
class
Input
extends
Scrollable
{
Input
({
GlobalKey
key
,
this
.
initialValue
:
''
,
this
.
placeholder
,
this
.
hideText
:
false
,
this
.
isDense
:
false
,
this
.
onChanged
,
this
.
keyboardType
:
KeyboardType
.
TEXT
,
this
.
onSubmitted
...
...
@@ -35,6 +32,7 @@ class Input extends Scrollable {
final
KeyboardType
keyboardType
;
final
String
placeholder
;
final
bool
hideText
;
final
bool
isDense
;
final
ValueChanged
<
String
>
onChanged
;
final
ValueChanged
<
String
>
onSubmitted
;
...
...
@@ -123,15 +121,21 @@ class InputState extends ScrollableState<Input> {
onSizeChanged:
_handleContainerSizeChanged
,
child:
new
Container
(
child:
new
Stack
(
textChildren
),
padding:
_kTextfieldPadding
,
decoration:
new
BoxDecoration
(
border:
new
Border
(
bottom:
new
BorderSide
(
color:
focusHighlightColor
,
width:
focused
?
2.0
:
1.0
margin:
config
.
isDense
?
const
EdgeDims
.
symmetric
(
vertical:
4.0
)
:
const
EdgeDims
.
symmetric
(
vertical:
8.0
),
padding:
const
EdgeDims
.
symmetric
(
vertical:
8.0
),
decoration:
new
BoxDecoration
(
border:
new
Border
(
bottom:
new
BorderSide
(
color:
focusHighlightColor
,
width:
focused
?
2.0
:
1.0
)
)
)
)
)
)
),
behavior:
HitTestBehavior
.
opaque
,
onPointerDown:
(
_
)
{
// TODO(ianh): https://github.com/flutter/engine/issues/1530
if
(
Focus
.
at
(
context
,
config
))
{
...
...
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