diff --git a/packages/flutter/lib/src/material/button.dart b/packages/flutter/lib/src/material/button.dart index e5f8e3f70a..db7d836421 100644 --- a/packages/flutter/lib/src/material/button.dart +++ b/packages/flutter/lib/src/material/button.dart @@ -88,7 +88,7 @@ class ButtonTheme extends InheritedWidget { /// The amount of space to surround the child inside the bounds of the button. /// /// Defaults to 16.0 pixels of horizontal padding. - final EdgeInsets padding; + final EdgeInsetsGeometry padding; /// The closest instance of this class that encloses the given context. /// @@ -231,7 +231,7 @@ class MaterialButton extends StatefulWidget { /// The amount of space to surround the child inside the bounds of the button. /// /// Defaults to the value from the current [ButtonTheme]. - final EdgeInsets padding; + final EdgeInsetsGeometry padding; /// The callback that is called when the button is tapped or otherwise activated. /// diff --git a/packages/flutter/lib/src/material/dialog.dart b/packages/flutter/lib/src/material/dialog.dart index 9ff47ce37f..5221ff649a 100644 --- a/packages/flutter/lib/src/material/dialog.dart +++ b/packages/flutter/lib/src/material/dialog.dart @@ -145,7 +145,7 @@ class AlertDialog extends StatelessWidget { /// /// Uses material design default if none is supplied. If there is no title, no /// padding will be provided. - final EdgeInsets titlePadding; + final EdgeInsetsGeometry titlePadding; /// The (optional) content of the dialog is displayed in the center of the /// dialog in a lighter font. @@ -158,7 +158,7 @@ class AlertDialog extends StatelessWidget { /// Padding around the content. /// /// Uses material design default if none is supplied. - final EdgeInsets contentPadding; + final EdgeInsetsGeometry contentPadding; /// The (optional) set of actions that are displayed at the bottom of the /// dialog. @@ -174,7 +174,7 @@ class AlertDialog extends StatelessWidget { if (title != null) { children.add(new Padding( - padding: titlePadding ?? new EdgeInsets.fromLTRB(24.0, 24.0, 24.0, content == null ? 20.0 : 0.0), + padding: titlePadding ?? new EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 24.0, content == null ? 20.0 : 0.0), child: new DefaultTextStyle( style: Theme.of(context).textTheme.title, child: title, @@ -185,7 +185,7 @@ class AlertDialog extends StatelessWidget { if (content != null) { children.add(new Flexible( child: new Padding( - padding: contentPadding ?? const EdgeInsets.fromLTRB(24.0, 20.0, 24.0, 24.0), + padding: contentPadding ?? const EdgeInsetsDirectional.fromSTEB(24.0, 20.0, 24.0, 24.0), child: new DefaultTextStyle( style: Theme.of(context).textTheme.subhead, child: content, @@ -352,7 +352,7 @@ class SimpleDialog extends StatelessWidget { /// /// Uses material design default if none is supplied. If there is no title, no /// padding will be provided. - final EdgeInsets titlePadding; + final EdgeInsetsGeometry titlePadding; /// The (optional) content of the dialog is displayed in a /// [SingleChildScrollView] underneath the title. @@ -363,7 +363,7 @@ class SimpleDialog extends StatelessWidget { /// Padding around the content. /// /// Uses material design default if none is supplied. - final EdgeInsets contentPadding; + final EdgeInsetsGeometry contentPadding; @override Widget build(BuildContext context) { @@ -371,7 +371,7 @@ class SimpleDialog extends StatelessWidget { if (title != null) { body.add(new Padding( - padding: titlePadding ?? const EdgeInsets.fromLTRB(24.0, 24.0, 24.0, 0.0), + padding: titlePadding ?? const EdgeInsetsDirectional.fromSTEB(24.0, 24.0, 24.0, 0.0), child: new DefaultTextStyle( style: Theme.of(context).textTheme.title, child: title @@ -382,7 +382,7 @@ class SimpleDialog extends StatelessWidget { if (children != null) { body.add(new Flexible( child: new SingleChildScrollView( - padding: contentPadding ?? const EdgeInsets.fromLTRB(0.0, 12.0, 0.0, 16.0), + padding: contentPadding ?? const EdgeInsetsDirectional.fromSTEB(0.0, 12.0, 0.0, 16.0), child: new ListBody(children: children), ) )); diff --git a/packages/flutter/lib/src/material/drawer_header.dart b/packages/flutter/lib/src/material/drawer_header.dart index 2167ce57c2..b56b8c0852 100644 --- a/packages/flutter/lib/src/material/drawer_header.dart +++ b/packages/flutter/lib/src/material/drawer_header.dart @@ -52,10 +52,10 @@ class DrawerHeader extends StatelessWidget { /// system status bar. /// /// If the child is null, the padding has no effect. - final EdgeInsets padding; + final EdgeInsetsGeometry padding; /// The margin around the drawer header. - final EdgeInsets margin; + final EdgeInsetsGeometry margin; /// The duration for animations of the [decoration]. final Duration duration; @@ -82,20 +82,20 @@ class DrawerHeader extends StatelessWidget { border: new Border( bottom: new BorderSide( color: theme.dividerColor, - width: 0.0 - ) - ) + width: 0.0, + ), + ), ), child: new AnimatedContainer( - padding: padding + new EdgeInsets.only(top: statusBarHeight), + padding: padding.add(new EdgeInsets.only(top: statusBarHeight)), decoration: decoration, duration: duration, curve: curve, child: child == null ? null : new DefaultTextStyle( style: theme.textTheme.body2, - child: child - ) - ) + child: child, + ), + ), ); } } diff --git a/packages/flutter/lib/src/material/expand_icon.dart b/packages/flutter/lib/src/material/expand_icon.dart index b1e1d3aaae..5d42c7b67e 100644 --- a/packages/flutter/lib/src/material/expand_icon.dart +++ b/packages/flutter/lib/src/material/expand_icon.dart @@ -52,7 +52,7 @@ class ExpandIcon extends StatefulWidget { /// gestures. /// /// This property must not be null. It defaults to 8.0 padding on all sides. - final EdgeInsets padding; + final EdgeInsetsGeometry padding; @override _ExpandIconState createState() => new _ExpandIconState(); diff --git a/packages/flutter/lib/src/material/grid_tile_bar.dart b/packages/flutter/lib/src/material/grid_tile_bar.dart index 36c56f2970..5def09dc9b 100644 --- a/packages/flutter/lib/src/material/grid_tile_bar.dart +++ b/packages/flutter/lib/src/material/grid_tile_bar.dart @@ -63,13 +63,13 @@ class GridTileBar extends StatelessWidget { decoration = new BoxDecoration(color: backgroundColor); final List children = []; - final EdgeInsets padding = new EdgeInsets.only( - left: leading != null ? 8.0 : 16.0, - right: trailing != null ? 8.0 : 16.0, + final EdgeInsetsDirectional padding = new EdgeInsetsDirectional.only( + start: leading != null ? 8.0 : 16.0, + end: trailing != null ? 8.0 : 16.0, ); if (leading != null) - children.add(new Padding(padding: const EdgeInsets.only(right: 8.0), child: leading)); + children.add(new Padding(padding: const EdgeInsetsDirectional.only(end: 8.0), child: leading)); final ThemeData theme = Theme.of(context); final ThemeData darkTheme = new ThemeData( @@ -114,7 +114,7 @@ class GridTileBar extends StatelessWidget { } if (trailing != null) - children.add(new Padding(padding: const EdgeInsets.only(left: 8.0), child: trailing)); + children.add(new Padding(padding: const EdgeInsetsDirectional.only(start: 8.0), child: trailing)); return new Container( padding: padding, diff --git a/packages/flutter/lib/src/material/icon_button.dart b/packages/flutter/lib/src/material/icon_button.dart index 12161b9b4d..769617161c 100644 --- a/packages/flutter/lib/src/material/icon_button.dart +++ b/packages/flutter/lib/src/material/icon_button.dart @@ -103,12 +103,12 @@ class IconButton extends StatelessWidget { /// to input gestures. /// /// This property must not be null. It defaults to 8.0 padding on all sides. - final EdgeInsets padding; + final EdgeInsetsGeometry padding; /// Defines how the icon is positioned within the IconButton. /// /// This property must not be null. It defaults to [FractionalOffset.center]. - final FractionalOffset alignment; + final FractionalOffsetGeometry alignment; /// The icon to display inside the button. /// diff --git a/packages/flutter/lib/src/material/tooltip.dart b/packages/flutter/lib/src/material/tooltip.dart index b668d068fb..e34ad51be2 100644 --- a/packages/flutter/lib/src/material/tooltip.dart +++ b/packages/flutter/lib/src/material/tooltip.dart @@ -66,7 +66,7 @@ class Tooltip extends StatefulWidget { /// The amount of space by which to inset the child. /// /// Defaults to 16.0 logical pixels in each direction. - final EdgeInsets padding; + final EdgeInsetsGeometry padding; /// The amount of vertical distance between the widget and the displayed tooltip. final double verticalOffset; @@ -192,7 +192,7 @@ class _TooltipState extends State with SingleTickerProviderStateMixin { child: new Semantics( label: widget.message, child: widget.child, - ) + ), ); } } @@ -261,7 +261,7 @@ class _TooltipOverlay extends StatelessWidget { final String message; final double height; - final EdgeInsets padding; + final EdgeInsetsGeometry padding; final Animation animation; final Offset target; final double verticalOffset; @@ -281,7 +281,7 @@ class _TooltipOverlay extends StatelessWidget { delegate: new _TooltipPositionDelegate( target: target, verticalOffset: verticalOffset, - preferBelow: preferBelow + preferBelow: preferBelow, ), child: new FadeTransition( opacity: animation, @@ -290,19 +290,19 @@ class _TooltipOverlay extends StatelessWidget { child: new Container( decoration: new BoxDecoration( color: darkTheme.backgroundColor, - borderRadius: new BorderRadius.circular(2.0) + borderRadius: new BorderRadius.circular(2.0), ), height: height, padding: padding, child: new Center( widthFactor: 1.0, - child: new Text(message, style: darkTheme.textTheme.body1) - ) - ) - ) - ) - ) - ) + child: new Text(message, style: darkTheme.textTheme.body1), + ), + ), + ), + ), + ), + ), ); } } diff --git a/packages/flutter/lib/src/material/two_level_list.dart b/packages/flutter/lib/src/material/two_level_list.dart index 9f32ef6eec..3760552e0b 100644 --- a/packages/flutter/lib/src/material/two_level_list.dart +++ b/packages/flutter/lib/src/material/two_level_list.dart @@ -263,7 +263,7 @@ class TwoLevelList extends StatelessWidget { Key key, this.children: const [], this.type: MaterialListType.twoLine, - this.padding + this.padding, }) : assert(type != null), super(key: key); @@ -276,7 +276,7 @@ class TwoLevelList extends StatelessWidget { final MaterialListType type; /// The amount of space by which to inset the children inside the viewport. - final EdgeInsets padding; + final EdgeInsetsGeometry padding; @override Widget build(BuildContext context) { diff --git a/packages/flutter/lib/src/material/user_accounts_drawer_header.dart b/packages/flutter/lib/src/material/user_accounts_drawer_header.dart index 1d26a40d79..7c5ac1b199 100644 --- a/packages/flutter/lib/src/material/user_accounts_drawer_header.dart +++ b/packages/flutter/lib/src/material/user_accounts_drawer_header.dart @@ -153,7 +153,7 @@ class UserAccountsDrawerHeader extends StatefulWidget { final Decoration decoration; /// The margin around the drawer header. - final EdgeInsets margin; + final EdgeInsetsGeometry margin; /// A widget placed in the upper-left corner that represents the current /// user's account. Normally a [CircleAvatar]. diff --git a/packages/flutter/lib/src/widgets/animated_list.dart b/packages/flutter/lib/src/widgets/animated_list.dart index cba11a93d0..ddbaff4ac7 100644 --- a/packages/flutter/lib/src/widgets/animated_list.dart +++ b/packages/flutter/lib/src/widgets/animated_list.dart @@ -150,7 +150,7 @@ class AnimatedList extends StatefulWidget { final bool shrinkWrap; /// The amount of space by which to inset the children. - final EdgeInsets padding; + final EdgeInsetsGeometry padding; /// The state from the closest instance of this class that encloses the given context. ///