diff --git a/packages/flutter/lib/src/material/input.dart b/packages/flutter/lib/src/material/input.dart index 6e52e60923..f915c534fc 100644 --- a/packages/flutter/lib/src/material/input.dart +++ b/packages/flutter/lib/src/material/input.dart @@ -177,6 +177,7 @@ class InputContainer extends StatefulWidget { this.errorText, this.style, this.isDense: false, + this.hideDivider: false, this.child, }) : super(key: key); @@ -213,6 +214,9 @@ class InputContainer extends StatefulWidget { /// to the child. final bool isEmpty; + /// Hide the divider that appears below the child and above the error text. + final bool hideDivider; + final Widget child; @override @@ -304,16 +308,26 @@ class _InputContainerState extends State { ); EdgeInsets margin = new EdgeInsets.only(bottom: bottomHeight - (bottomPadding + bottomBorder)); - stackChildren.add(new AnimatedContainer( - margin: margin, - padding: padding, - duration: _kTransitionDuration, - curve: _kTransitionCurve, - decoration: new BoxDecoration( - border: border, - ), - child: config.child, - )); + Widget divider; + if (config.hideDivider) { + divider = new Container( + margin: margin + new EdgeInsets.only(bottom: bottomBorder), + padding: padding, + child: config.child, + ); + } else { + divider = new AnimatedContainer( + margin: margin, + padding: padding, + duration: _kTransitionDuration, + curve: _kTransitionCurve, + decoration: new BoxDecoration( + border: border, + ), + child: config.child, + ); + } + stackChildren.add(divider); if (errorText != null && !config.isDense) { TextStyle errorStyle = themeData.textTheme.caption.copyWith(color: themeData.errorColor); @@ -385,6 +399,7 @@ class Input extends StatefulWidget { this.errorText, this.style, this.hideText: false, + this.hideDivider: false, this.isDense: false, this.autofocus: false, this.maxLines: 1, @@ -426,6 +441,9 @@ class Input extends StatefulWidget { /// U+2022 BULLET characters (•). final bool hideText; + /// Hide the divider that appears below the child and above the error text. + final bool hideDivider; + /// Whether the input field is part of a dense form (i.e., uses less vertical space). final bool isDense; @@ -478,6 +496,7 @@ class _InputState extends State { errorText: config.errorText, style: config.style, isDense: config.isDense, + hideDivider: config.hideDivider, child: new InputField( key: _inputFieldKey, focusKey: focusKey,