@@ -12,16 +12,13 @@ import 'theme.dart';
1212export 'package:flutter/rendering.dart' show ValueChanged;
1313export 'package:flutter/services.dart' show KeyboardType;
1414
15- // TODO(eseidel): This isn't right, it's 16px on the bottom:
16- // http://www.google.com/design/spec/components/text-fields.html#text-fields-single-line-text-field
17- const EdgeDims _kTextfieldPadding = const EdgeDims .symmetric (vertical: 8.0 );
18-
1915class Input extends Scrollable {
2016 Input ({
2117 GlobalKey key,
2218 this .initialValue: '' ,
2319 this .placeholder,
2420 this .hideText: false ,
21+ this .isDense: false ,
2522 this .onChanged,
2623 this .keyboardType: KeyboardType .TEXT ,
2724 this .onSubmitted
@@ -35,6 +32,7 @@ class Input extends Scrollable {
3532 final KeyboardType keyboardType;
3633 final String placeholder;
3734 final bool hideText;
35+ final bool isDense;
3836 final ValueChanged <String > onChanged;
3937 final ValueChanged <String > onSubmitted;
4038
@@ -123,15 +121,21 @@ class InputState extends ScrollableState<Input> {
123121 onSizeChanged: _handleContainerSizeChanged,
124122 child: new Container (
125123 child: new Stack (textChildren),
126- padding: _kTextfieldPadding,
127- decoration: new BoxDecoration (border: new Border (
128- bottom: new BorderSide (
129- color: focusHighlightColor,
130- width: focused ? 2.0 : 1.0
124+ margin: config.isDense ?
125+ const EdgeDims .symmetric (vertical: 4.0 ) :
126+ const EdgeDims .symmetric (vertical: 8.0 ),
127+ padding: const EdgeDims .symmetric (vertical: 8.0 ),
128+ decoration: new BoxDecoration (
129+ border: new Border (
130+ bottom: new BorderSide (
131+ color: focusHighlightColor,
132+ width: focused ? 2.0 : 1.0
133+ )
131134 )
132- ))
135+ )
133136 )
134137 ),
138+ behavior: HitTestBehavior .opaque,
135139 onPointerDown: (_) {
136140 // TODO(ianh): https://github.com/flutter/engine/issues/1530
137141 if (Focus .at (context, config)) {
0 commit comments