From fdb76da5c9ce90c1b7bb4131214c09c21d380e34 Mon Sep 17 00:00:00 2001 From: Matt Perry Date: Thu, 20 Oct 2016 16:38:09 -0400 Subject: [PATCH] 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. --- .../lib/demo/expansion_panels_demo.dart | 15 +++++++++------ .../flutter_gallery/lib/demo/text_field_demo.dart | 3 ++- packages/flutter/lib/src/material/input.dart | 5 +---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/examples/flutter_gallery/lib/demo/expansion_panels_demo.dart b/examples/flutter_gallery/lib/demo/expansion_panels_demo.dart index 59728a70ab..a3b88fdbac 100644 --- a/examples/flutter_gallery/lib/demo/expansion_panels_demo.dart +++ b/examples/flutter_gallery/lib/demo/expansion_panels_demo.dart @@ -192,12 +192,15 @@ class _ExpansionPanelsDemoState extends State { 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( - 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( + setter: (String val) { item.value = val; } + ), ), ), ), diff --git a/examples/flutter_gallery/lib/demo/text_field_demo.dart b/examples/flutter_gallery/lib/demo/text_field_demo.dart index 76ee0aee08..8b95d28a77 100644 --- a/examples/flutter_gallery/lib/demo/text_field_demo.dart +++ b/examples/flutter_gallery/lib/demo/text_field_demo.dart @@ -74,7 +74,7 @@ class TextFieldDemoState extends State { ), body: new Form( child: new Block( - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.symmetric(horizontal: 16.0), children: [ new Input( hintText: 'What do people call you?', @@ -113,6 +113,7 @@ class TextFieldDemoState extends State { ) ) ), + new SizedBox(width: 16.0), new Flexible( child: new Input( hintText: 'How do you log in?', diff --git a/packages/flutter/lib/src/material/input.dart b/packages/flutter/lib/src/material/input.dart index 8ee27f1d53..d04cf7601b 100644 --- a/packages/flutter/lib/src/material/input.dart +++ b/packages/flutter/lib/src/material/input.dart @@ -306,10 +306,7 @@ class _InputState extends State { child: new GestureDetector( behavior: HitTestBehavior.opaque, onTap: () => _rawInputKey.currentState?.requestKeyboard(), - child: new Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0), - child: child - ) + child: child ) ); }