Remove default horizontal padding for Input. (#6437)

This partially reverts https://github.com/flutter/flutter/issues/626 ,
but horizontal padding is not in the spec, so we still match the spec.
This commit is contained in:
Matt Perry 2016-10-20 16:38:09 -04:00 committed by GitHub
parent 23c52fc7a1
commit fdb76da5c9
3 changed files with 12 additions and 11 deletions

View file

@ -192,12 +192,15 @@ class _ExpansionPanelsDemoState extends State<ExpasionPanelsDemo> {
return new CollapsibleBody(
margin: const EdgeInsets.symmetric(horizontal: 16.0),
child: new Form(
child: new Input(
hintText: item.hint,
labelText: item.name,
value: new InputValue(text: item.value),
formField: new FormField<String>(
setter: (String val) { item.value = val; }
child: new Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new Input(
hintText: item.hint,
labelText: item.name,
value: new InputValue(text: item.value),
formField: new FormField<String>(
setter: (String val) { item.value = val; }
),
),
),
),

View file

@ -74,7 +74,7 @@ class TextFieldDemoState extends State<TextFieldDemo> {
),
body: new Form(
child: new Block(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.symmetric(horizontal: 16.0),
children: <Widget>[
new Input(
hintText: 'What do people call you?',
@ -113,6 +113,7 @@ class TextFieldDemoState extends State<TextFieldDemo> {
)
)
),
new SizedBox(width: 16.0),
new Flexible(
child: new Input(
hintText: 'How do you log in?',

View file

@ -306,10 +306,7 @@ class _InputState extends State<Input> {
child: new GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => _rawInputKey.currentState?.requestKeyboard(),
child: new Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: child
)
child: child
)
);
}