Skip to content

Commit fdb76da

Browse files
authored
Remove default horizontal padding for Input. (#6437)
This partially reverts #626 , but horizontal padding is not in the spec, so we still match the spec.
1 parent 23c52fc commit fdb76da

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

‎examples/flutter_gallery/lib/demo/expansion_panels_demo.dart‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,15 @@ class _ExpansionPanelsDemoState extends State<ExpasionPanelsDemo> {
192192
return new CollapsibleBody(
193193
margin: const EdgeInsets.symmetric(horizontal: 16.0),
194194
child: new Form(
195-
child: new Input(
196-
hintText: item.hint,
197-
labelText: item.name,
198-
value: new InputValue(text: item.value),
199-
formField: new FormField<String>(
200-
setter: (String val) { item.value = val; }
195+
child: new Padding(
196+
padding: const EdgeInsets.symmetric(horizontal: 16.0),
197+
child: new Input(
198+
hintText: item.hint,
199+
labelText: item.name,
200+
value: new InputValue(text: item.value),
201+
formField: new FormField<String>(
202+
setter: (String val) { item.value = val; }
203+
),
201204
),
202205
),
203206
),

‎examples/flutter_gallery/lib/demo/text_field_demo.dart‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class TextFieldDemoState extends State<TextFieldDemo> {
7474
),
7575
body: new Form(
7676
child: new Block(
77-
padding: const EdgeInsets.all(8.0),
77+
padding: const EdgeInsets.symmetric(horizontal: 16.0),
7878
children: <Widget>[
7979
new Input(
8080
hintText: 'What do people call you?',
@@ -113,6 +113,7 @@ class TextFieldDemoState extends State<TextFieldDemo> {
113113
)
114114
)
115115
),
116+
new SizedBox(width: 16.0),
116117
new Flexible(
117118
child: new Input(
118119
hintText: 'How do you log in?',

‎packages/flutter/lib/src/material/input.dart‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,7 @@ class _InputState extends State<Input> {
306306
child: new GestureDetector(
307307
behavior: HitTestBehavior.opaque,
308308
onTap: () => _rawInputKey.currentState?.requestKeyboard(),
309-
child: new Padding(
310-
padding: const EdgeInsets.symmetric(horizontal: 16.0),
311-
child: child
312-
)
309+
child: child
313310
)
314311
);
315312
}

0 commit comments

Comments
 (0)