Commit e71bd77e authored by Adam Barth's avatar Adam Barth

[rename fixit] EdgeDims -> EdgeInsets

Fixes #1382
parent 7ba19605
......@@ -279,7 +279,7 @@ class CardCollectionState extends State<CardCollection> {
],
flexibleSpace: (_) {
return new Container(
padding: const EdgeDims.only(left: 72.0),
padding: const EdgeInsets.only(left: 72.0),
height: 128.0,
child: new Align(
alignment: const FractionalOffset(0.0, 0.75),
......@@ -304,7 +304,7 @@ class CardCollectionState extends State<CardCollection> {
color: _primaryColor[cardModel.color],
child: new Container(
height: cardModel.height,
padding: const EdgeDims.all(kCardMargins),
padding: const EdgeInsets.all(kCardMargins),
child: _editable ?
new Center(
child: new Input(
......@@ -367,7 +367,7 @@ class CardCollectionState extends State<CardCollection> {
bottom: 0.0,
left: 0.0,
child: new Container(
margin: const EdgeDims.all(4.0),
margin: const EdgeInsets.all(4.0),
child: new Viewport(
child: new Container(
height: cardModel.height,
......@@ -428,7 +428,7 @@ class CardCollectionState extends State<CardCollection> {
}
Widget body = new Container(
padding: const EdgeDims.symmetric(vertical: 12.0, horizontal: 8.0),
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 8.0),
decoration: new BoxDecoration(backgroundColor: _primaryColor[50]),
child: cardCollection
);
......
......@@ -25,7 +25,7 @@ class ExampleDragTargetState extends State<ExampleDragTarget> {
builder: (BuildContext context, List<Color> data, List<Color> rejectedData) {
return new Container(
height: 100.0,
margin: new EdgeDims.all(10.0),
margin: new EdgeInsets.all(10.0),
decoration: new BoxDecoration(
border: new Border.all(
width: 3.0,
......
......@@ -143,7 +143,7 @@ class _WindowState extends State<Window> {
color: Colors.blue[200]
),
new Container(
padding: const EdgeDims.all(_kWindowPadding),
padding: const EdgeInsets.all(_kWindowPadding),
child: new Material(
elevation: 8,
child: new ChildView(child: config.child)
......
......@@ -144,7 +144,7 @@ class OverlayGeometryAppState extends State<OverlayGeometryApp> {
color: cardModel.color,
child: new Container(
height: cardModel.height,
padding: const EdgeDims.all(8.0),
padding: const EdgeInsets.all(8.0),
child: new Center(child: new Text(cardModel.label, style: cardLabelStyle))
)
)
......@@ -156,7 +156,7 @@ class OverlayGeometryAppState extends State<OverlayGeometryApp> {
new Scaffold(
toolBar: new ToolBar(center: new Text('Tap a Card')),
body: new Container(
padding: const EdgeDims.symmetric(vertical: 12.0, horizontal: 8.0),
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 8.0),
child: new ScrollableMixedWidgetList(
builder: builder,
token: cardModels.length,
......
......@@ -46,7 +46,7 @@ class PageableListAppState extends State<PageableListApp> {
child: new Container(
width: cardModel.size.width,
height: cardModel.size.height,
padding: const EdgeDims.all(8.0),
padding: const EdgeInsets.all(8.0),
child: new Center(child: new Text(cardModel.label, style: cardLabelStyle))
)
);
......
......@@ -15,7 +15,7 @@ void main() {
void addAlignmentRow(FlexAlignItems alignItems) {
TextStyle style = const TextStyle(color: const Color(0xFF000000));
RenderParagraph paragraph = new RenderParagraph(new TextSpan(style: style, text: '$alignItems'));
table.add(new RenderPadding(child: paragraph, padding: new EdgeDims.only(top: 20.0)));
table.add(new RenderPadding(child: paragraph, padding: new EdgeInsets.only(top: 20.0)));
RenderFlex row = new RenderFlex(alignItems: alignItems, textBaseline: TextBaseline.alphabetic);
style = new TextStyle(fontSize: 15.0, color: const Color(0xFF000000));
row.add(new RenderDecoratedBox(
......@@ -49,7 +49,7 @@ void main() {
void addJustificationRow(FlexJustifyContent justify) {
const TextStyle style = const TextStyle(color: const Color(0xFF000000));
RenderParagraph paragraph = new RenderParagraph(new TextSpan(style: style, text: '$justify'));
table.add(new RenderPadding(child: paragraph, padding: new EdgeDims.only(top: 20.0)));
table.add(new RenderPadding(child: paragraph, padding: new EdgeInsets.only(top: 20.0)));
RenderFlex row = new RenderFlex(direction: FlexDirection.horizontal);
row.add(new RenderSolidColorBox(const Color(0xFFFFCCCC), desiredSize: new Size(80.0, 60.0)));
row.add(new RenderSolidColorBox(const Color(0xFFCCFFCC), desiredSize: new Size(64.0, 60.0)));
......@@ -68,7 +68,7 @@ void main() {
RenderDecoratedBox root = new RenderDecoratedBox(
decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF)),
child: new RenderPadding(child: table, padding: new EdgeDims.symmetric(vertical: 50.0))
child: new RenderPadding(child: table, padding: new EdgeInsets.symmetric(vertical: 50.0))
);
new RenderingFlutterBinding(root: root);
......
......@@ -105,8 +105,8 @@ Widget statusBox(Widget child) {
backgroundColor: darkGray
),
height: 90.0,
padding: const EdgeDims.all(8.0),
margin: const EdgeDims.symmetric(horizontal: 50.0),
padding: const EdgeInsets.all(8.0),
margin: const EdgeInsets.symmetric(horizontal: 50.0),
child: new Center(child: child)
)
);
......
......@@ -161,7 +161,7 @@ class _GestureDemoState extends State<GestureDemo> {
left: 0.0,
child: new Card(
child: new Container(
padding: new EdgeDims.all(4.0),
padding: new EdgeInsets.all(4.0),
child: new Column(
children: <Widget>[
new Row(
......
......@@ -15,7 +15,7 @@ class AdaptedListItem extends StatelessComponent {
new Container(
width: 32.0,
height: 32.0,
margin: const EdgeDims.all(8.0),
margin: const EdgeInsets.all(8.0),
decoration: new BoxDecoration(
backgroundColor: Colors.lightBlueAccent[100]
)
......@@ -43,7 +43,7 @@ class AdaptedGridItem extends StatelessComponent {
)
),
new Container(
margin: const EdgeDims.only(left: 8.0),
margin: const EdgeInsets.only(left: 8.0),
child: new Row(
children: <Widget>[
new Flexible(
......
......@@ -92,7 +92,7 @@ class SectorAppState extends State<SectorApp> {
return new Column(
children: <Widget>[
new Container(
padding: new EdgeDims.symmetric(horizontal: 8.0, vertical: 25.0),
padding: new EdgeInsets.symmetric(horizontal: 8.0, vertical: 25.0),
child: new Row(
children: <Widget>[
new RaisedButton(
......@@ -101,8 +101,8 @@ class SectorAppState extends State<SectorApp> {
child: new Row(
children: <Widget>[
new Container(
padding: new EdgeDims.all(4.0),
margin: new EdgeDims.only(right: 10.0),
padding: new EdgeInsets.all(4.0),
margin: new EdgeInsets.only(right: 10.0),
child: new WidgetToRenderBoxAdapter(renderBox: sectorAddIcon)
),
new Text('ADD SECTOR'),
......@@ -116,8 +116,8 @@ class SectorAppState extends State<SectorApp> {
child: new Row(
children: <Widget>[
new Container(
padding: new EdgeDims.all(4.0),
margin: new EdgeDims.only(right: 10.0),
padding: new EdgeInsets.all(4.0),
margin: new EdgeInsets.only(right: 10.0),
child: new WidgetToRenderBoxAdapter(renderBox: sectorRemoveIcon)
),
new Text('REMOVE SECTOR'),
......@@ -131,11 +131,11 @@ class SectorAppState extends State<SectorApp> {
),
new Flexible(
child: new Container(
margin: new EdgeDims.all(8.0),
margin: new EdgeInsets.all(8.0),
decoration: new BoxDecoration(
border: new Border.all(color: new Color(0xFF000000))
),
padding: new EdgeDims.all(8.0),
padding: new EdgeInsets.all(8.0),
child: new WidgetToRenderBoxAdapter(
renderBox: sectors,
onBuild: doUpdates
......
......@@ -40,8 +40,8 @@ void attachWidgetTreeToRenderTree(RenderProxyBox container) {
new Rectangle(const Color(0xFF00FFFF)),
new Material(
child: new Container(
padding: new EdgeDims.all(10.0),
margin: new EdgeDims.all(10.0),
padding: new EdgeInsets.all(10.0),
margin: new EdgeInsets.all(10.0),
child: new Row(
children: <Widget>[
new RaisedButton(
......@@ -95,7 +95,7 @@ void main() {
addFlexChildSolidColor(flexRoot, const Color(0xFF0000FF), flex: 1);
transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.identity());
RenderPadding root = new RenderPadding(padding: new EdgeDims.all(80.0), child: transformBox);
RenderPadding root = new RenderPadding(padding: new EdgeInsets.all(80.0), child: transformBox);
WidgetFlutterBinding.instance.renderView.child = root;
WidgetFlutterBinding.instance.addPersistentFrameCallback(rotate);
......
......@@ -61,7 +61,7 @@ class SpeakerSeparator extends StatelessComponent {
Widget build(BuildContext context) {
return new Container(
constraints: const BoxConstraints.expand(height: 0.0),
margin: const EdgeDims.symmetric(vertical: 10.0, horizontal: 64.0),
margin: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 64.0),
decoration: const BoxDecoration(
border: const Border(
bottom: const BorderSide(color: const Color.fromARGB(24, 0, 0, 0))
......@@ -104,7 +104,7 @@ class _StyledTextDemoState extends State<StyledTextDemo> {
return new GestureDetector(
onTap: _handleTap,
child: new Container(
padding: new EdgeDims.symmetric(horizontal: 8.0),
padding: new EdgeInsets.symmetric(horizontal: 8.0),
child: new Column(
children: children,
justifyContent: FlexJustifyContent.center,
......
......@@ -91,7 +91,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
Widget buildRaisedButton(BuildContext context) {
return new Container(
margin: const EdgeDims.symmetric(vertical: 16.0),
margin: const EdgeInsets.symmetric(vertical: 16.0),
child: new Column(
children: <Widget>[
new RaisedButton(
......@@ -108,7 +108,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
]
.map((Widget child) {
return new Container(
margin: const EdgeDims.symmetric(vertical: 8.0),
margin: const EdgeInsets.symmetric(vertical: 8.0),
child: child
);
})
......@@ -119,7 +119,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
Widget buildFlatButton(BuildContext context) {
return new Container(
margin: const EdgeDims.symmetric(vertical: 16.0),
margin: const EdgeInsets.symmetric(vertical: 16.0),
child: new ButtonTheme(
color: ButtonColor.accent,
child: new Column(
......@@ -138,7 +138,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
]
.map((Widget child) {
return new Container(
margin: const EdgeDims.symmetric(vertical: 8.0),
margin: const EdgeInsets.symmetric(vertical: 8.0),
child: child
);
})
......@@ -183,7 +183,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
children: <Widget>[
demo.builder(context),
new Padding(
padding: const EdgeDims.symmetric(horizontal: 32.0),
padding: const EdgeInsets.symmetric(horizontal: 32.0),
child: new Text(demo.text, style: textStyle)
)
]
......
......@@ -80,7 +80,7 @@ class TravelDestinationItem extends StatelessComponent {
// description and share/expore buttons
new Flexible(
child: new Padding(
padding: const EdgeDims.all(16.0),
padding: const EdgeInsets.all(16.0),
child: new Column(
justifyContent: FlexJustifyContent.start,
alignItems: FlexAlignItems.start,
......@@ -96,7 +96,7 @@ class TravelDestinationItem extends StatelessComponent {
alignItems: FlexAlignItems.end,
children: <Widget>[
new Padding(
padding: const EdgeDims.only(right: 16.0),
padding: const EdgeInsets.only(right: 16.0),
child: new Text('SHARE', style: buttonStyle)
),
new Text('EXPLORE', style: buttonStyle)
......@@ -121,10 +121,10 @@ class CardsDemo extends StatelessComponent {
center: new Text("Travel Stream")
),
body: new Block(
padding: const EdgeDims.only(top: 8.0, left: 8.0, right: 8.0),
padding: const EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0),
children: destinations.map((TravelDestination destination) {
return new Container(
margin: const EdgeDims.only(bottom: 8.0),
margin: const EdgeInsets.only(bottom: 8.0),
child: new TravelDestinationItem(destination: destination)
);
})
......
......@@ -57,7 +57,7 @@ class ColorItem extends StatelessComponent {
Widget build(BuildContext context) {
return new Container(
height: kColorItemHeight,
padding: const EdgeDims.symmetric(horizontal: 16.0),
padding: const EdgeInsets.symmetric(horizontal: 16.0),
decoration: new BoxDecoration(backgroundColor: color),
child: new Row(
justifyContent: FlexJustifyContent.spaceBetween,
......
......@@ -32,7 +32,7 @@ class DialogDemoItem extends StatelessComponent {
return new InkWell(
onTap: onPressed,
child: new Padding(
padding: const EdgeDims.symmetric(vertical: 8.0),
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: new Row(
justifyContent: FlexJustifyContent.start,
alignItems: FlexAlignItems.center,
......@@ -43,7 +43,7 @@ class DialogDemoItem extends StatelessComponent {
color: color
),
new Padding(
padding: const EdgeDims.only(left: 16.0),
padding: const EdgeInsets.only(left: 16.0),
child: new Text(text)
)
]
......@@ -84,7 +84,7 @@ class DialogDemoState extends State<DialogDemo> {
center: new Text('Dialogs')
),
body: new Block(
padding: const EdgeDims.symmetric(vertical: 24.0, horizontal: 72.0),
padding: const EdgeInsets.symmetric(vertical: 24.0, horizontal: 72.0),
children: <Widget>[
new RaisedButton(
child: new Text('ALERT'),
......
......@@ -102,11 +102,11 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> {
)
),
new Padding(
padding: new EdgeDims.only(top: 20.0),
padding: new EdgeInsets.only(top: 20.0),
child: new Text("JUMPING JACKS", style: Theme.of(context).textTheme.title)
),
new Padding(
padding: new EdgeDims.only(top: 20.0, bottom: 20.0),
padding: new EdgeInsets.only(top: 20.0, bottom: 20.0),
child: new Row(
justifyContent: FlexJustifyContent.center,
children: <Widget>[
......@@ -117,7 +117,7 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> {
)
),
new Padding(
padding: new EdgeDims.only(bottom: 16.0),
padding: new EdgeInsets.only(bottom: 16.0),
child: new SizedBox(
width: 300.0,
height: 72.0,
......
......@@ -13,7 +13,7 @@ class _ContactCategory extends StatelessComponent {
Widget build(BuildContext context) {
return new Container(
padding: const EdgeDims.symmetric(vertical: 16.0),
padding: const EdgeInsets.symmetric(vertical: 16.0),
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(color: Theme.of(context).dividerColor))
),
......@@ -58,7 +58,7 @@ class _ContactItem extends StatelessComponent {
));
}
return new Padding(
padding: const EdgeDims.symmetric(vertical: 16.0),
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: new Row(
justifyContent: FlexJustifyContent.spaceBetween,
children: rowChildren
......@@ -109,7 +109,7 @@ class FlexibleSpaceDemoState extends State<FlexibleSpaceDemo> {
),
body: new Block(
scrollableKey: scrollableKey,
padding: new EdgeDims.only(top: appBarHeight),
padding: new EdgeInsets.only(top: appBarHeight),
children: <Widget>[
new _ContactCategory(
icon: Icons.call,
......
......@@ -36,7 +36,7 @@ class DateTimeItem extends StatelessComponent {
children: <Widget>[
new Flexible(
child: new Container(
padding: const EdgeDims.symmetric(vertical: 8.0),
padding: const EdgeInsets.symmetric(vertical: 8.0),
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(color: theme.dividerColor))
),
......@@ -63,8 +63,8 @@ class DateTimeItem extends StatelessComponent {
)
),
new Container(
margin: const EdgeDims.only(left: 8.0),
padding: const EdgeDims.symmetric(vertical: 8.0),
margin: const EdgeInsets.only(left: 8.0),
padding: const EdgeInsets.symmetric(vertical: 8.0),
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(color: theme.dividerColor))
),
......@@ -157,14 +157,14 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
]
),
body: new Padding(
padding: const EdgeDims.all(16.0),
padding: const EdgeInsets.all(16.0),
child: new ScrollableViewport(
child: new Column(
alignItems: FlexAlignItems.stretch,
justifyContent: FlexJustifyContent.collapse,
children: <Widget>[
new Container(
padding: const EdgeDims.symmetric(vertical: 8.0),
padding: const EdgeInsets.symmetric(vertical: 8.0),
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(color: theme.dividerColor))
),
......@@ -174,7 +174,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
)
),
new Container(
padding: const EdgeDims.symmetric(vertical: 8.0),
padding: const EdgeInsets.symmetric(vertical: 8.0),
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(color: theme.dividerColor))
),
......@@ -237,7 +237,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
]
.map((Widget child) {
return new Container(
padding: const EdgeDims.symmetric(vertical: 8.0),
padding: const EdgeInsets.symmetric(vertical: 8.0),
height: 96.0,
child: child
);
......
......@@ -97,7 +97,7 @@ class GridListDemoGridDelegate extends FixedColumnCountGridDelegate {
this.columnCount,
double columnSpacing: 0.0,
double rowSpacing: 0.0,
EdgeDims padding: EdgeDims.zero,
EdgeInsets padding: EdgeInsets.zero,
this.tileHeightFactor: 2.75
}) : super(columnSpacing: columnSpacing, rowSpacing: rowSpacing, padding: padding) {
assert(columnCount != null && columnCount >= 0);
......@@ -153,7 +153,7 @@ class GridListDemoState extends State<GridListDemo> {
)
];
final EdgeDims padding = MediaQuery.of(context).padding;
final EdgeInsets padding = MediaQuery.of(context).padding;
final ModalPosition position = new ModalPosition(
right: padding.right + 16.0,
top: padding.top + 16.0
......@@ -187,7 +187,7 @@ class GridListDemoState extends State<GridListDemo> {
columnCount: (orientation == Orientation.portrait) ? 2 : 3,
rowSpacing: 4.0,
columnSpacing: 4.0,
padding: const EdgeDims.all(4.0),
padding: const EdgeInsets.all(4.0),
tileHeightFactor: (orientation == Orientation.portrait) ? 2.75 : 1.75
),
children: photos.map((Photo photo) {
......
......@@ -72,7 +72,7 @@ class IconsDemoState extends State<IconsDemo> {
body: new IconTheme(
data: new IconThemeData(opacity: iconOpacity),
child: new Padding(
padding: const EdgeDims.all(24.0),
padding: const EdgeInsets.all(24.0),
child: new Column(
children: <Widget>[
new Row(
......
......@@ -156,7 +156,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
]
),
body: new Block(
padding: new EdgeDims.all(4.0),
padding: new EdgeInsets.all(4.0),
children: leaveBehindItems.map(buildItem).toList()
)
);
......
......@@ -195,7 +195,7 @@ class ListDemoState extends State<ListDemo> {
]
),
body: new Block(
padding: new EdgeDims.all(_dense ? 4.0 : 8.0),
padding: new EdgeInsets.all(_dense ? 4.0 : 8.0),
children: listItems.toList()
)
);
......
......@@ -79,7 +79,7 @@ class MenuDemoState extends State<MenuDemo> {
]
),
body: new Block(
padding: const EdgeDims.all(8.0),
padding: const EdgeInsets.all(8.0),
children: <Widget>[
// Pressing the PopupMenuButton on the right of this item shows
// a simple menu with one disabled item. Typically the contents
......
......@@ -24,7 +24,7 @@ class ModalBottomSheetDemo extends StatelessComponent {
showModalBottomSheet/*<Null>*/(context: context, builder: (BuildContext context) {
return new Container(
child: new Padding(
padding: const EdgeDims.all(32.0),
padding: const EdgeInsets.all(32.0),
child: new Text("This is the modal bottom sheet. Click anywhere to dismiss.", style: textStyle)
)
);
......
......@@ -32,7 +32,7 @@ class PageSelectorDemo extends StatelessComponent {
return new Column(
children: <Widget>[
new Container(
margin: const EdgeDims.only(top: 16.0),
margin: const EdgeInsets.only(top: 16.0),
child: new Row(
children: <Widget>[
new IconButton(
......@@ -57,7 +57,7 @@ class PageSelectorDemo extends StatelessComponent {
children: icons.map((IconData icon) {
return new Container(
key: new ObjectKey(icon),
padding: const EdgeDims.all(12.0),
padding: const EdgeInsets.all(12.0),
child: new Card(
child: new Center(
child: new Icon(icon: icon, size: 128.0, color: color)
......
......@@ -19,7 +19,7 @@ class PersistentBottomSheetDemo extends StatelessComponent {
border: new Border(top: new BorderSide(color: Colors.black26, width: 1.0))
),
child: new Padding(
padding: const EdgeDims.all(32.0),
padding: const EdgeInsets.all(32.0),
child: new Text("This is a Material persistent bottom sheet. Drag downwards to dismiss it.", style: textStyle)
)
);
......
......@@ -75,7 +75,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> {
];
return new Column(
children: indicators
.map((Widget c) => new Container(child: c, margin: const EdgeDims.symmetric(vertical: 15.0, horizontal: 20.0)))
.map((Widget c) => new Container(child: c, margin: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0)))
.toList(),
justifyContent: FlexJustifyContent.center
);
......@@ -90,7 +90,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> {
onTap: _handleTap,
behavior: HitTestBehavior.opaque,
child: new Container(
padding: const EdgeDims.symmetric(vertical: 12.0, horizontal: 8.0),
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 8.0),
child: new AnimatedBuilder(
animation: animation,
builder: _buildIndicators
......
......@@ -23,7 +23,7 @@ class _BarGraphic extends StatelessComponent {
return new Container(
height: height,
width: 200.0,
padding: const EdgeDims.symmetric(horizontal: 16.0),
padding: const EdgeInsets.symmetric(horizontal: 16.0),
decoration: new BoxDecoration(backgroundColor: color),
child: new DefaultTextStyle(
style: Theme.of(context).textTheme.body1.copyWith(color: Colors.white),
......@@ -90,7 +90,7 @@ class _TechniqueItem extends StatelessComponent {
child: new InkWell(
onTap: () { showDemo(context); },
child: new Padding(
padding: const EdgeDims.all(16.0),
padding: const EdgeInsets.all(16.0),
child: new Row(
justifyContent: FlexJustifyContent.spaceBetween,
children :<Widget>[
......@@ -115,11 +115,11 @@ class ScrollingTechniquesDemo extends StatelessComponent {
return new Scaffold(
toolBar: new ToolBar(center: new Text('Scrolling Techniques')),
body: new Padding(
padding: const EdgeDims.symmetric(horizontal: 16.0),
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new Block(
children: <Widget>[
new Padding(
padding: const EdgeDims.symmetric(horizontal: 16.0, vertical: 32.0),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 32.0),
child: new Text(_introText, style: Theme.of(context).textTheme.caption)
),
new _TechniqueItem(
......
......@@ -31,7 +31,7 @@ class _SliderDemoState extends State<SliderDemo> {
}
),
new Container(
padding: const EdgeDims.symmetric(horizontal: 16.0),
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new Text(_value.round().toString().padLeft(3, '0'))
),
],
......@@ -47,7 +47,7 @@ class _SliderDemoState extends State<SliderDemo> {
// Disabled, but tracking the slider above.
new Slider(value: _value / 100.0),
new Container(
padding: const EdgeDims.symmetric(horizontal: 16.0),
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new Text((_value / 100.0).toStringAsFixed(2))
),
],
......
......@@ -22,7 +22,7 @@ class SnackBarDemo extends StatelessComponent {
Widget buildBody(BuildContext context) {
return new Padding(
padding: const EdgeDims.all(24.0),
padding: const EdgeInsets.all(24.0),
child: new Column(
children: <Widget>[
new Text(_text1),
......@@ -47,7 +47,7 @@ class SnackBarDemo extends StatelessComponent {
]
.map((Widget child) {
return new Container(
margin: const EdgeDims.symmetric(vertical: 12.0),
margin: const EdgeInsets.symmetric(vertical: 12.0),
child: child
);
})
......
......@@ -42,7 +42,7 @@ class TabsDemo extends StatelessComponent {
children: icons.map((IconData icon) {
return new Container(
key: new ObjectKey(icon),
padding: const EdgeDims.all(12.0),
padding: const EdgeInsets.all(12.0),
child: new Card(
child: new Center(
child: new Icon(
......
......@@ -59,7 +59,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> {
border: new Border(top: new BorderSide(color: Theme.of(context).dividerColor))
),
child: new Padding(
padding: const EdgeDims.all(32.0),
padding: const EdgeInsets.all(32.0),
child: new Text(_explanatoryText, style: Theme.of(context).textTheme.subhead)
)
);
......@@ -77,7 +77,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> {
return new Container(
key: new ValueKey<String>(page.label),
padding: const EdgeDims.TRBL(48.0, 48.0, 96.0, 48.0),
padding: const EdgeInsets.TRBL(48.0, 48.0, 96.0, 48.0),
child: new Card(
child: new Center(
child: new Text(page.label, style: textStyle)
......
......@@ -66,7 +66,7 @@ class TextFieldDemoState extends State<TextFieldDemo> {
center: new Text('Text Fields')
),
body: new Block(
padding: const EdgeDims.all(8.0),
padding: const EdgeInsets.all(8.0),
children: <Widget>[
new Input(
hintText: 'What do people call you?',
......
......@@ -52,7 +52,7 @@ class TooltipDemo extends StatelessComponent {
]
.map((Widget widget) {
return new Padding(
padding: const EdgeDims.only(top: 16.0, left: 16.0, right: 16.0),
padding: const EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0),
child: widget
);
})
......
......@@ -9,7 +9,7 @@ class TwoLevelListDemo extends StatelessComponent {
return new Scaffold(
toolBar: new ToolBar(center: new Text('Expand/Collapse List Control')),
body: new Padding(
padding: const EdgeDims.all(0.0),
padding: const EdgeInsets.all(0.0),
child: new TwoLevelList(
type: MaterialListType.oneLine,
items: <Widget>[
......
......@@ -20,7 +20,7 @@ class TextStyleItem extends StatelessComponent {
final ThemeData theme = Theme.of(context);
final TextStyle nameStyle = theme.textTheme.body1.copyWith(color: theme.textTheme.caption.color);
return new Padding(
padding: const EdgeDims.symmetric(horizontal: 8.0, vertical: 16.0),
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 16.0),
child: new Row(
alignItems: FlexAlignItems.start,
children: <Widget>[
......
......@@ -140,7 +140,7 @@ class WeatherButton extends StatelessComponent {
color = const Color(0x33000000);
return new Padding(
padding: const EdgeDims.all(15.0),
padding: const EdgeInsets.all(15.0),
child: new Material(
color: color,
type: MaterialType.circle,
......
......@@ -53,7 +53,7 @@ class GalleryHomeState extends State<GalleryHome> {
toolBar: new ToolBar(
flexibleSpace: (BuildContext context) {
return new Container(
padding: const EdgeDims.only(left: 16.0, bottom: 24.0),
padding: const EdgeInsets.only(left: 16.0, bottom: 24.0),
height: 128.0,
child: new Align(
alignment: const FractionalOffset(0.0, 1.0),
......@@ -63,7 +63,7 @@ class GalleryHomeState extends State<GalleryHome> {
}
),
body: new Block(
padding: const EdgeDims.all(4.0),
padding: const EdgeInsets.all(4.0),
children: <Widget>[
new Row(
children: <Widget>[
......
......@@ -45,7 +45,7 @@ class GallerySection extends StatelessComponent {
body: new Material(
child: new MaterialList(
scrollableKey: scrollableKey,
scrollablePadding: new EdgeDims.only(top: appBarHeight),
scrollablePadding: new EdgeInsets.only(top: appBarHeight),
type: MaterialListType.oneLine,
children: (demos ?? const <GalleryDemo>[]).map((GalleryDemo demo) {
return new ListItem(
......@@ -75,13 +75,13 @@ class GallerySection extends StatelessComponent {
onTap: () { showDemos(context); },
child: new Container(
height: 256.0,
margin: const EdgeDims.all(4.0),
margin: const EdgeInsets.all(4.0),
decoration: new BoxDecoration(backgroundColor: theme.primaryColor),
child: new Column(
children: <Widget>[
new Flexible(
child: new Padding(
padding: const EdgeDims.symmetric(horizontal: 12.0),
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: new AssetImage(
name: image,
alignment: const FractionalOffset(0.5, 0.5),
......@@ -90,7 +90,7 @@ class GallerySection extends StatelessComponent {
)
),
new Padding(
padding: const EdgeDims.all(16.0),
padding: const EdgeInsets.all(16.0),
child: new Align(
alignment: const FractionalOffset(0.0, 1.0),
child: new Text(title, style: titleTextStyle)
......
......@@ -71,7 +71,7 @@ class StockArrow extends StatelessComponent {
return new Container(
width: 40.0,
height: 40.0,
margin: const EdgeDims.symmetric(horizontal: 5.0),
margin: const EdgeInsets.symmetric(horizontal: 5.0),
child: new CustomPaint(
painter: new StockArrowPainter(
// TODO(jackson): This should change colors with the theme
......
......@@ -64,7 +64,7 @@ class StockRow extends StatelessComponent {
onDoubleTap: _getHandler(onDoubleTap),
onLongPress: _getHandler(onLongPressed),
child: new Container(
padding: const EdgeDims.TRBL(16.0, 16.0, 20.0, 16.0),
padding: const EdgeInsets.TRBL(16.0, 16.0, 20.0, 16.0),
decoration: new BoxDecoration(
border: new Border(
bottom: new BorderSide(color: Theme.of(context).dividerColor)
......@@ -73,7 +73,7 @@ class StockRow extends StatelessComponent {
child: new Row(
children: <Widget>[
new Container(
margin: const EdgeDims.only(right: 5.0),
margin: const EdgeInsets.only(right: 5.0),
child: new Hero(
tag: StockRowPartKind.arrow,
key: _arrowKey,
......
......@@ -241,7 +241,7 @@ class StockSettingsState extends State<StockSettings> {
});
return new Block(
children: rows,
padding: const EdgeDims.symmetric(vertical: 20.0)
padding: const EdgeInsets.symmetric(vertical: 20.0)
);
}
......
......@@ -21,7 +21,7 @@ class StockSymbolView extends StatelessComponent {
TextStyle headings = Theme.of(context).textTheme.body2;
return new Container(
padding: new EdgeDims.all(20.0),
padding: new EdgeInsets.all(20.0),
child: new Column(
children: <Widget>[
new Row(
......@@ -79,7 +79,7 @@ class StockSymbolPage extends StatelessComponent {
body: new Block(
children: <Widget>[
new Container(
margin: new EdgeDims.all(20.0),
margin: new EdgeInsets.all(20.0),
child: new Card(child: new StockSymbolView(stock: stock))
)
]
......@@ -95,7 +95,7 @@ class StockSymbolBottomSheet extends StatelessComponent {
Widget build(BuildContext context) {
return new Container(
padding: new EdgeDims.all(10.0),
padding: new EdgeInsets.all(10.0),
decoration: new BoxDecoration(
border: new Border(top: new BorderSide(color: Colors.black26, width: 1.0))
),
......
......@@ -16,7 +16,7 @@ export 'src/painting/basic_types.dart';
export 'src/painting/box_painter.dart';
export 'src/painting/colors.dart';
export 'src/painting/decoration.dart';
export 'src/painting/edge_dims.dart';
export 'src/painting/edge_insets.dart';
export 'src/painting/text_editing.dart';
export 'src/painting/text_painter.dart';
export 'src/painting/text_style.dart';
......
......@@ -116,7 +116,7 @@ abstract class MaterialButtonState<T extends MaterialButton> extends State<T> {
onTap: config.onPressed,
onHighlightChanged: _handleHighlightChanged,
child: new Container(
padding: new EdgeDims.symmetric(horizontal: 8.0),
padding: new EdgeInsets.symmetric(horizontal: 8.0),
child: new Center(
widthFactor: 1.0,
child: config.child
......@@ -143,8 +143,8 @@ abstract class MaterialButtonState<T extends MaterialButton> extends State<T> {
return new Container(
height: 36.0,
constraints: new BoxConstraints(minWidth: 88.0),
padding: const EdgeDims.symmetric(horizontal: 8.0),
margin: const EdgeDims.all(8.0),
padding: const EdgeInsets.symmetric(horizontal: 8.0),
margin: const EdgeInsets.all(8.0),
child: contents
);
}
......
......@@ -6,7 +6,7 @@ import 'package:flutter/widgets.dart';
import 'material.dart';
const EdgeDims _kCardMargins = const EdgeDims.all(4.0);
const EdgeInsets _kCardMargins = const EdgeInsets.all(4.0);
/// A material design card
///
......
......@@ -45,7 +45,7 @@ class Chip extends StatelessComponent {
leftPadding = 0.0;
children.add(new ExcludeSemantics(
child: new Container(
margin: const EdgeDims.only(right: 8.0),
margin: const EdgeInsets.only(right: 8.0),
width: _kAvatarDiamater,
height: _kAvatarDiamater,
child: avatar
......@@ -65,7 +65,7 @@ class Chip extends StatelessComponent {
child: new Tooltip(
message: 'Delete "$label"',
child: new Container(
padding: const EdgeDims.symmetric(horizontal: 4.0),
padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: new Icon(
icon: Icons.cancel,
size: 18.0,
......@@ -80,7 +80,7 @@ class Chip extends StatelessComponent {
container: true,
child: new Container(
height: _kChipHeight,
padding: new EdgeDims.only(left: leftPadding, right: rightPadding),
padding: new EdgeInsets.only(left: leftPadding, right: rightPadding),
decoration: new BoxDecoration(
backgroundColor: Colors.grey[300],
borderRadius: 16.0
......
......@@ -33,7 +33,7 @@ const double kFadingEdgeLength = 12.0;
const double kPressedStateDuration = 64.0; // units?
const Duration kThemeChangeDuration = const Duration(milliseconds: 200);
const EdgeDims kDialogHeadingPadding = const EdgeDims.TRBL(24.0, 24.0, 20.0, 24.0);
const EdgeInsets kDialogHeadingPadding = const EdgeInsets.TRBL(24.0, 24.0, 20.0, 24.0);
const double kRadialReactionRadius = 24.0; // Pixels
const Duration kRadialReactionDuration = const Duration(milliseconds: 200);
......
......@@ -140,7 +140,7 @@ class _DatePickerHeader extends StatelessComponent {
TextStyle yearStyle = headerTheme.headline.copyWith(color: yearColor, height: 1.0);
return new Container(
padding: new EdgeDims.all(10.0),
padding: new EdgeInsets.all(10.0),
decoration: new BoxDecoration(backgroundColor: theme.primaryColor),
child: new Column(
children: <Widget>[
......
......@@ -55,7 +55,7 @@ class _DatePickerDialogState extends State<_DatePickerDialog> {
lastDate: config.lastDate,
onChanged: _handleDateChanged
),
contentPadding: EdgeDims.zero,
contentPadding: EdgeInsets.zero,
actions: <Widget>[
new FlatButton(
child: new Text('CANCEL'),
......
......@@ -32,14 +32,14 @@ class Dialog extends StatelessComponent {
// Padding around the title; uses material design default if none is supplied
// If there is no title, no padding will be provided
final EdgeDims titlePadding;
final EdgeInsets titlePadding;
/// The (optional) content of the dialog is displayed in the center of the
/// dialog in a lighter font.
final Widget content;
// Padding around the content; uses material design default if none is supplied
final EdgeDims contentPadding;
final EdgeInsets contentPadding;
/// The (optional) set of actions that are displayed at the bottom of the
/// dialog.
......@@ -59,9 +59,9 @@ class Dialog extends StatelessComponent {
List<Widget> dialogBody = new List<Widget>();
if (title != null) {
EdgeDims padding = titlePadding;
EdgeInsets padding = titlePadding;
if (padding == null)
padding = new EdgeDims.TRBL(24.0, 24.0, content == null ? 20.0 : 0.0, 24.0);
padding = new EdgeInsets.TRBL(24.0, 24.0, content == null ? 20.0 : 0.0, 24.0);
dialogBody.add(new Padding(
padding: padding,
child: new DefaultTextStyle(
......@@ -72,9 +72,9 @@ class Dialog extends StatelessComponent {
}
if (content != null) {
EdgeDims padding = contentPadding;
EdgeInsets padding = contentPadding;
if (padding == null)
padding = const EdgeDims.TRBL(20.0, 24.0, 24.0, 24.0);
padding = const EdgeInsets.TRBL(20.0, 24.0, 24.0, 24.0);
dialogBody.add(new Padding(
padding: padding,
child: new DefaultTextStyle(
......@@ -98,7 +98,7 @@ class Dialog extends StatelessComponent {
return new Center(
child: new Container(
margin: new EdgeDims.symmetric(horizontal: 40.0, vertical: 24.0),
margin: new EdgeInsets.symmetric(horizontal: 40.0, vertical: 24.0),
child: new ConstrainedBox(
constraints: new BoxConstraints(minWidth: 280.0),
child: new Material(
......
......@@ -19,7 +19,7 @@ class Divider extends StatelessComponent {
final double bottom = (height ~/ 2.0).toDouble();
return new Container(
height: 0.0,
margin: new EdgeDims.only(
margin: new EdgeInsets.only(
top: height - bottom - 1.0,
left: indent,
bottom: bottom
......
......@@ -18,7 +18,7 @@ class DrawerHeader extends StatelessComponent {
Widget build(BuildContext context) {
assert(debugCheckHasMaterial(context));
final double statusBarHeight = (MediaQuery.of(context)?.padding ?? EdgeDims.zero).top;
final double statusBarHeight = (MediaQuery.of(context)?.padding ?? EdgeInsets.zero).top;
return new Container(
height: statusBarHeight + kMaterialDrawerHeight,
decoration: new BoxDecoration(
......@@ -30,13 +30,13 @@ class DrawerHeader extends StatelessComponent {
)
)
),
padding: const EdgeDims.only(bottom: 7.0),
margin: const EdgeDims.only(bottom: 8.0),
padding: const EdgeInsets.only(bottom: 7.0),
margin: const EdgeInsets.only(bottom: 8.0),
child: new Column(
children: <Widget>[
new Flexible(child: new Container()),
new Container(
padding: const EdgeDims.symmetric(horizontal: 16.0),
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new DefaultTextStyle(
style: Theme.of(context).textTheme.body2,
child: child
......
......@@ -63,7 +63,7 @@ class DrawerItem extends StatelessComponent {
if (icon != null) {
children.add(
new Padding(
padding: const EdgeDims.symmetric(horizontal: 16.0),
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new Icon(
icon: icon,
color: _getIconColor(themeData)
......@@ -74,7 +74,7 @@ class DrawerItem extends StatelessComponent {
children.add(
new Flexible(
child: new Padding(
padding: const EdgeDims.symmetric(horizontal: 16.0),
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new DefaultTextStyle(
style: _getTextStyle(themeData),
child: child
......
......@@ -16,7 +16,7 @@ import 'material.dart';
const Duration _kDropDownMenuDuration = const Duration(milliseconds: 300);
const double _kMenuItemHeight = 48.0;
const EdgeDims _kMenuHorizontalPadding = const EdgeDims.only(left: 36.0, right: 36.0);
const EdgeInsets _kMenuHorizontalPadding = const EdgeInsets.only(left: 36.0, right: 36.0);
const double _kBaselineOffsetFromBottom = 20.0;
const Border _kDropDownUnderline = const Border(bottom: const BorderSide(color: const Color(0xFFBDBDBD), width: 2.0));
......@@ -210,7 +210,7 @@ class DropDownMenuItem<T> extends StatelessComponent {
Widget build(BuildContext context) {
return new Container(
height: _kMenuItemHeight,
padding: const EdgeDims.only(left: 8.0, right: 8.0, top: 6.0),
padding: const EdgeInsets.only(left: 8.0, right: 8.0, top: 6.0),
child: new DefaultTextStyle(
style: Theme.of(context).textTheme.subhead,
child: new Baseline(
......@@ -301,7 +301,7 @@ class _DropDownButtonState<T> extends State<DropDownButton<T>> {
),
new Container(
child: new Icon(icon: Icons.arrow_drop_down, size: 36.0),
padding: const EdgeDims.only(top: 6.0)
padding: const EdgeInsets.only(top: 6.0)
)
],
justifyContent: FlexJustifyContent.collapse
......
......@@ -26,7 +26,7 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
assert(debugCheckHasScaffold(context));
final double appBarHeight = Scaffold.of(context).appBarHeight;
final Animation<double> animation = Scaffold.of(context).appBarAnimation;
final EdgeDims toolBarPadding = MediaQuery.of(context)?.padding ?? EdgeDims.zero;
final EdgeInsets toolBarPadding = MediaQuery.of(context)?.padding ?? EdgeInsets.zero;
final double toolBarHeight = kToolBarHeight + toolBarPadding.top;
final List<Widget> children = <Widget>[];
......@@ -70,7 +70,7 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
curve: new Interval(0.0, scaleAndAlignEnd)
);
children.add(new Padding(
padding: const EdgeDims.only(left: 72.0, bottom: 14.0),
padding: const EdgeInsets.only(left: 72.0, bottom: 14.0),
child: new Align(
alignment: new Tween<FractionalOffset>(
begin: new FractionalOffset(0.0, yAlignStart),
......
......@@ -29,18 +29,18 @@ class GridTileBar extends StatelessComponent {
if (backgroundColor != null)
decoration = new BoxDecoration(backgroundColor: backgroundColor);
EdgeDims padding;
EdgeInsets padding;
if (left != null && right != null)
padding = const EdgeDims.symmetric(vertical: 16.0, horizontal: 8.0);
padding = const EdgeInsets.symmetric(vertical: 16.0, horizontal: 8.0);
else if (left != null)
padding = const EdgeDims.only(left: 8.0, right: 16.0, top: 16.0, bottom: 16.0);
padding = const EdgeInsets.only(left: 8.0, right: 16.0, top: 16.0, bottom: 16.0);
else // right != null || (left == null && right == null)
padding = const EdgeDims.only(left: 16.0, right: 8.0, top: 16.0, bottom: 16.0);
padding = const EdgeInsets.only(left: 16.0, right: 8.0, top: 16.0, bottom: 16.0);
final List<Widget> children = <Widget>[];
if (left != null)
children.add(new Padding(padding: const EdgeDims.only(right: 8.0), child: left));
children.add(new Padding(padding: const EdgeInsets.only(right: 8.0), child: left));
if (title != null && caption != null) {
children.add(
......@@ -72,7 +72,7 @@ class GridTileBar extends StatelessComponent {
}
if (right != null)
children.add(new Padding(padding: const EdgeDims.only(left: 8.0), child: right));
children.add(new Padding(padding: const EdgeInsets.only(left: 8.0), child: right));
return new Container(
padding: padding,
......
......@@ -56,7 +56,7 @@ class IconButton extends StatelessComponent {
Widget build(BuildContext context) {
assert(debugCheckHasMaterial(context));
Widget result = new Padding(
padding: const EdgeDims.all(8.0),
padding: const EdgeInsets.all(8.0),
child: new Icon(
size: size,
icon: icon,
......
......@@ -132,8 +132,8 @@ class _InputState extends State<Input> {
));
}
EdgeDims margin = new EdgeDims.only(bottom: config.isDense ? 4.0 : 8.0);
EdgeDims padding = new EdgeDims.only(top: topPadding, bottom: 8.0);
EdgeInsets margin = new EdgeInsets.only(bottom: config.isDense ? 4.0 : 8.0);
EdgeInsets padding = new EdgeInsets.only(top: topPadding, bottom: 8.0);
Color borderColor = activeColor;
double borderWidth = focused ? 2.0 : 1.0;
......@@ -141,8 +141,8 @@ class _InputState extends State<Input> {
borderColor = themeData.errorColor;
borderWidth = 2.0;
if (!config.isDense) {
margin = const EdgeDims.only(bottom: 15.0);
padding = new EdgeDims.only(top: topPadding, bottom: 1.0);
margin = const EdgeInsets.only(bottom: 15.0);
padding = new EdgeInsets.only(top: topPadding, bottom: 1.0);
}
}
......@@ -191,7 +191,7 @@ class _InputState extends State<Input> {
alignItems: FlexAlignItems.start,
children: [
new Container(
margin: new EdgeDims.only(right: 16.0, top: iconTop),
margin: new EdgeInsets.only(right: 16.0, top: iconTop),
width: config.isDense ? 40.0 : 48.0,
child: new Icon(
icon: config.icon,
......@@ -208,7 +208,7 @@ class _InputState extends State<Input> {
behavior: HitTestBehavior.opaque,
onTap: () => _rawInputLineKey.currentState?.requestKeyboard(),
child: new Padding(
padding: const EdgeDims.symmetric(horizontal: 16.0),
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: child
)
);
......
......@@ -28,7 +28,7 @@ class MaterialList extends StatefulComponent {
this.onScroll,
this.type: MaterialListType.twoLine,
this.children,
this.scrollablePadding: EdgeDims.zero,
this.scrollablePadding: EdgeInsets.zero,
this.scrollableKey
}) : super(key: key);
......@@ -36,7 +36,7 @@ class MaterialList extends StatefulComponent {
final ScrollListener onScroll;
final MaterialListType type;
final Iterable<Widget> children;
final EdgeDims scrollablePadding;
final EdgeInsets scrollablePadding;
final Key scrollableKey;
_MaterialListState createState() => new _MaterialListState();
......@@ -52,7 +52,7 @@ class _MaterialListState extends State<MaterialList> {
scrollDirection: Axis.vertical,
onScroll: config.onScroll,
itemExtent: kListItemExtent[config.type],
padding: const EdgeDims.symmetric(vertical: 8.0) + config.scrollablePadding,
padding: const EdgeInsets.symmetric(vertical: 8.0) + config.scrollablePadding,
scrollableListPainter: _scrollbarPainter,
children: config.children
);
......
......@@ -105,7 +105,7 @@ class ListItem extends StatelessComponent {
if (left != null) {
children.add(new Container(
margin: new EdgeDims.only(right: 16.0, top: iconMarginTop),
margin: new EdgeInsets.only(right: 16.0, top: iconMarginTop),
width: 40.0,
child: new Align(
alignment: new FractionalOffset(0.0, isThreeLine ? 0.0 : 0.5),
......@@ -138,7 +138,7 @@ class ListItem extends StatelessComponent {
if (right != null) {
children.add(new Container(
margin: new EdgeDims.only(left: 16.0, top: iconMarginTop),
margin: new EdgeInsets.only(left: 16.0, top: iconMarginTop),
child: new Align(
alignment: new FractionalOffset(1.0, isThreeLine ? 0.0 : 0.5),
child: right
......@@ -151,7 +151,7 @@ class ListItem extends StatelessComponent {
onLongPress: enabled ? onLongPress : null,
child: new Container(
height: itemHeight,
padding: const EdgeDims.symmetric(horizontal: 16.0),
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new Row(
alignItems: FlexAlignItems.center,
children: children
......
......@@ -99,7 +99,7 @@ class _PopupMenuItemState<T extends PopupMenuItem<dynamic>> extends State<T> {
child: new MergeSemantics(
child: new Container(
height: config.height,
padding: const EdgeDims.symmetric(horizontal: _kMenuHorizontalPadding),
padding: const EdgeInsets.symmetric(horizontal: _kMenuHorizontalPadding),
child: item
)
)
......@@ -204,7 +204,7 @@ class _PopupMenu<T> extends StatelessComponent {
stepWidth: _kMenuWidthStep,
child: new Block(
children: children,
padding: const EdgeDims.symmetric(
padding: const EdgeInsets.symmetric(
vertical: _kMenuVerticalPadding
)
)
......
......@@ -37,7 +37,7 @@ enum _ScaffoldSlot {
class _ScaffoldLayout extends MultiChildLayoutDelegate {
_ScaffoldLayout({ this.padding });
final EdgeDims padding;
final EdgeInsets padding;
void performLayout(Size size) {
BoxConstraints looseConstraints = new BoxConstraints.loose(size);
......@@ -375,11 +375,11 @@ class ScaffoldState extends State<Scaffold> {
bool _shouldShowBackArrow;
Widget _getModifiedToolBar({ EdgeDims padding, double foregroundOpacity: 1.0, int elevation }) {
Widget _getModifiedToolBar({ EdgeInsets padding, double foregroundOpacity: 1.0, int elevation }) {
ToolBar toolBar = config.toolBar;
if (toolBar == null)
return null;
EdgeDims toolBarPadding = new EdgeDims.only(top: padding.top);
EdgeInsets toolBarPadding = new EdgeInsets.only(top: padding.top);
Widget left = toolBar.left;
if (left == null) {
if (config.drawer != null) {
......@@ -431,7 +431,7 @@ class ScaffoldState extends State<Scaffold> {
}
Widget _buildScrollableAppBar(BuildContext context) {
final EdgeDims toolBarPadding = MediaQuery.of(context)?.padding ?? EdgeDims.zero;
final EdgeInsets toolBarPadding = MediaQuery.of(context)?.padding ?? EdgeInsets.zero;
final double toolBarHeight = kToolBarHeight + toolBarPadding.top;
Widget appBar;
......@@ -468,7 +468,7 @@ class ScaffoldState extends State<Scaffold> {
}
Widget build(BuildContext context) {
EdgeDims padding = MediaQuery.of(context)?.padding ?? EdgeDims.zero;
EdgeInsets padding = MediaQuery.of(context)?.padding ?? EdgeInsets.zero;
if (_snackBars.length > 0) {
ModalRoute<dynamic> route = ModalRoute.of(context);
......@@ -538,7 +538,7 @@ class ScaffoldState extends State<Scaffold> {
new CustomMultiChildLayout(
children: children,
delegate: new _ScaffoldLayout(
padding: EdgeDims.zero
padding: EdgeInsets.zero
)
),
new Positioned(
......
......@@ -51,7 +51,7 @@ class SnackBarAction extends StatelessComponent {
Widget build(BuildContext context) {
return new Container(
margin: const EdgeDims.only(left: _kSideMargins),
margin: const EdgeInsets.only(left: _kSideMargins),
child: new FlatButton(
onPressed: onPressed,
textTheme: ButtonColor.accent,
......@@ -91,7 +91,7 @@ class SnackBar extends StatelessComponent {
List<Widget> children = <Widget>[
new Flexible(
child: new Container(
margin: const EdgeDims.symmetric(vertical: _kSingleLineVerticalPadding),
margin: const EdgeInsets.symmetric(vertical: _kSingleLineVerticalPadding),
child: new DefaultTextStyle(
style: Typography.white.subhead,
child: content
......@@ -120,7 +120,7 @@ class SnackBar extends StatelessComponent {
elevation: 6,
color: _kSnackBackground,
child: new Container(
margin: const EdgeDims.symmetric(horizontal: _kSideMargins),
margin: const EdgeInsets.symmetric(horizontal: _kSideMargins),
child: new Theme(
data: new ThemeData(
brightness: ThemeBrightness.dark,
......
......@@ -28,7 +28,7 @@ const double _kTextAndIconTabHeight = 72.0;
const double _kTabIndicatorHeight = 2.0;
const double _kMinTabWidth = 72.0;
const double _kMaxTabWidth = 264.0;
const EdgeDims _kTabLabelPadding = const EdgeDims.symmetric(horizontal: 12.0);
const EdgeInsets _kTabLabelPadding = const EdgeInsets.symmetric(horizontal: 12.0);
const double _kTabBarScrollDrag = 0.025;
const Duration _kTabBarScroll = const Duration(milliseconds: 300);
......@@ -342,7 +342,7 @@ class _Tab extends StatelessComponent {
children: <Widget>[
new Container(
child: _buildLabelIcon(context),
margin: const EdgeDims.only(bottom: 10.0)
margin: const EdgeInsets.only(bottom: 10.0)
),
_buildLabelText()
],
......@@ -988,7 +988,7 @@ class TabPageSelector<T> extends StatelessComponent {
return new Container(
width: 12.0,
height: 12.0,
margin: new EdgeDims.all(4.0),
margin: new EdgeInsets.all(4.0),
decoration: new BoxDecoration(
backgroundColor: background,
border: new Border.all(color: selectedColor.end),
......
......@@ -126,7 +126,7 @@ class _TimePickerState extends State<TimePicker> {
new AspectRatio(
aspectRatio: 1.0,
child: new Container(
margin: const EdgeDims.all(12.0),
margin: const EdgeInsets.all(12.0),
child: new _Dial(
mode: _mode,
selectedTime: config.selectedTime,
......@@ -214,12 +214,12 @@ class _TimePickerHeader extends StatelessComponent {
onTap: _handleChangeDayPeriod,
behavior: HitTestBehavior.opaque,
child: new Container(
padding: const EdgeDims.only(left: 16.0, right: 24.0),
padding: const EdgeInsets.only(left: 16.0, right: 24.0),
child: new Column(
children: <Widget>[
new Text('AM', style: amStyle),
new Container(
padding: const EdgeDims.only(top: 4.0),
padding: const EdgeInsets.only(top: 4.0),
child: new Text('PM', style: pmStyle)
),
],
......
......@@ -49,7 +49,7 @@ class _TimePickerDialogState extends State<_TimePickerDialog> {
selectedTime: _selectedTime,
onChanged: _handleTimeChanged
),
contentPadding: EdgeDims.zero,
contentPadding: EdgeInsets.zero,
actions: <Widget>[
new FlatButton(
child: new Text('CANCEL'),
......
......@@ -23,7 +23,7 @@ class ToolBar extends StatelessComponent {
this.elevation: 4,
this.backgroundColor,
this.textTheme,
this.padding: EdgeDims.zero
this.padding: EdgeInsets.zero
}) : super(key: key) {
assert((flexibleSpace != null) ? tabBar == null : true);
assert((tabBar != null) ? flexibleSpace == null : true);
......@@ -38,7 +38,7 @@ class ToolBar extends StatelessComponent {
final int elevation;
final Color backgroundColor;
final TextTheme textTheme;
final EdgeDims padding;
final EdgeInsets padding;
ToolBar copyWith({
Key key,
......@@ -50,7 +50,7 @@ class ToolBar extends StatelessComponent {
int elevation,
Color backgroundColor,
TextTheme textTheme,
EdgeDims padding
EdgeInsets padding
}) {
return new ToolBar(
key: key ?? this.key,
......@@ -103,7 +103,7 @@ class ToolBar extends StatelessComponent {
toolBarRow.add(
new Flexible(
child: new Padding(
padding: new EdgeDims.only(left: 24.0),
padding: new EdgeInsets.only(left: 24.0),
child: center != null ? new DefaultTextStyle(style: centerStyle, child: center) : null
)
)
......@@ -111,7 +111,7 @@ class ToolBar extends StatelessComponent {
if (right != null)
toolBarRow.addAll(right);
EdgeDims combinedPadding = new EdgeDims.symmetric(horizontal: 8.0);
EdgeInsets combinedPadding = new EdgeInsets.symmetric(horizontal: 8.0);
if (padding != null)
combinedPadding += padding;
......@@ -121,7 +121,7 @@ class ToolBar extends StatelessComponent {
final Widget toolBar = new ConstrainedBox(
constraints: new BoxConstraints(maxHeight: toolBarHeight),
child: new Padding(
padding: new EdgeDims.only(left: combinedPadding.left, right: combinedPadding.right),
padding: new EdgeInsets.only(left: combinedPadding.left, right: combinedPadding.right),
child: new ClipRect(
child: new OverflowBox(
alignment: const FractionalOffset(0.0, 1.0), // bottom justify
......@@ -130,7 +130,7 @@ class ToolBar extends StatelessComponent {
child: new DefaultTextStyle(
style: sideStyle,
child: new Padding(
padding: new EdgeDims.only(top: combinedPadding.top, bottom: combinedPadding.bottom),
padding: new EdgeInsets.only(top: combinedPadding.top, bottom: combinedPadding.bottom),
child: new Row(children: toolBarRow)
)
)
......
......@@ -12,9 +12,9 @@ import 'theme.dart';
const double _kDefaultTooltipBorderRadius = 2.0;
const double _kDefaultTooltipHeight = 32.0;
const EdgeDims _kDefaultTooltipPadding = const EdgeDims.symmetric(horizontal: 16.0);
const EdgeInsets _kDefaultTooltipPadding = const EdgeInsets.symmetric(horizontal: 16.0);
const double _kDefaultVerticalTooltipOffset = 24.0;
const EdgeDims _kDefaultTooltipScreenEdgeMargin = const EdgeDims.all(10.0);
const EdgeInsets _kDefaultTooltipScreenEdgeMargin = const EdgeInsets.all(10.0);
const Duration _kDefaultTooltipFadeDuration = const Duration(milliseconds: 200);
const Duration _kDefaultTooltipShowDuration = const Duration(seconds: 2);
......@@ -56,9 +56,9 @@ class Tooltip extends StatefulComponent {
final double opacity;
final double borderRadius;
final double height;
final EdgeDims padding;
final EdgeInsets padding;
final double verticalOffset;
final EdgeDims screenEdgeMargin;
final EdgeInsets screenEdgeMargin;
final bool preferBelow;
final Duration fadeDuration;
final Duration showDuration;
......@@ -198,7 +198,7 @@ class _TooltipPositionDelegate extends OneChildLayoutDelegate {
});
final Point target;
final double verticalOffset;
final EdgeDims screenEdgeMargin;
final EdgeInsets screenEdgeMargin;
final bool preferBelow;
BoxConstraints getConstraintsForChild(BoxConstraints constraints) => constraints.loosen();
......@@ -257,11 +257,11 @@ class _TooltipOverlay extends StatelessComponent {
final double opacity;
final double borderRadius;
final double height;
final EdgeDims padding;
final EdgeInsets padding;
final Animation<double> animation;
final Point target;
final double verticalOffset;
final EdgeDims screenEdgeMargin;
final EdgeInsets screenEdgeMargin;
final bool preferBelow;
Widget build(BuildContext context) {
......
......@@ -9,9 +9,9 @@ import 'package:flutter/services.dart';
import 'basic_types.dart';
import 'decoration.dart';
import 'edge_dims.dart';
import 'edge_insets.dart';
export 'edge_dims.dart' show EdgeDims;
export 'edge_insets.dart' show EdgeInsets;
/// A side of a border of a box.
class BorderSide {
......@@ -93,9 +93,9 @@ class Border {
/// The left side of this border.
final BorderSide left;
/// The widths of the sides of this border represented as an EdgeDims.
EdgeDims get dimensions {
return new EdgeDims.TRBL(top.width, right.width, bottom.width, left.width);
/// The widths of the sides of this border represented as an EdgeInsets.
EdgeInsets get dimensions {
return new EdgeInsets.TRBL(top.width, right.width, bottom.width, left.width);
}
Border scale(double t) {
......@@ -797,7 +797,7 @@ class BoxDecoration extends Decoration {
final BoxShape shape;
/// The inset space occupied by the border.
EdgeDims get padding => border?.dimensions;
EdgeInsets get padding => border?.dimensions;
/// Returns a new box decoration that is scaled by the given factor.
BoxDecoration scale(double factor) {
......
......@@ -3,16 +3,16 @@
// found in the LICENSE file.
import 'basic_types.dart';
import 'edge_dims.dart';
import 'edge_insets.dart';
export 'edge_dims.dart' show EdgeDims;
export 'edge_insets.dart' show EdgeInsets;
// This group of classes is intended for painting in cartesian coordinates.
abstract class Decoration {
const Decoration();
bool debugAssertValid() => true;
EdgeDims get padding => null;
EdgeInsets get padding => null;
Decoration lerpFrom(Decoration a, double t) => this;
Decoration lerpTo(Decoration b, double t) => b;
bool hitTest(Size size, Point position) => true;
......
......@@ -10,22 +10,22 @@ import 'basic_types.dart';
///
/// Typically used for an offset from each of the four sides of a box. For
/// example, the padding inside a box can be represented using this class.
class EdgeDims {
/// Constructs an EdgeDims from offsets from the top, right, bottom and left.
const EdgeDims.TRBL(this.top, this.right, this.bottom, this.left);
class EdgeInsets {
/// Constructs insets from offsets from the top, right, bottom and left.
const EdgeInsets.TRBL(this.top, this.right, this.bottom, this.left);
/// Constructs an EdgeDims where all the offsets are value.
const EdgeDims.all(double value)
/// Constructs insets where all the offsets are value.
const EdgeInsets.all(double value)
: top = value, right = value, bottom = value, left = value;
/// Constructs an EdgeDims with only the given values non-zero.
const EdgeDims.only({ this.top: 0.0,
/// Constructs insets with only the given values non-zero.
const EdgeInsets.only({ this.top: 0.0,
this.right: 0.0,
this.bottom: 0.0,
this.left: 0.0 });
/// Constructs an EdgeDims with symmetrical vertical and horizontal offsets.
const EdgeDims.symmetric({ double vertical: 0.0,
/// Constructs insets with symmetrical vertical and horizontal offsets.
const EdgeInsets.symmetric({ double vertical: 0.0,
double horizontal: 0.0 })
: top = vertical, left = horizontal, bottom = vertical, right = horizontal;
......@@ -50,18 +50,18 @@ class EdgeDims {
/// The total offset in the horizontal direction.
double get vertical => top + bottom;
/// The size that this EdgeDims would occupy with an empty interior.
/// The size that this EdgeInsets would occupy with an empty interior.
Size get collapsedSize => new Size(horizontal, vertical);
/// An EdgeDims with top and bottom as well as left and right flipped.
EdgeDims get flipped => new EdgeDims.TRBL(bottom, left, top, right);
/// An EdgeInsets with top and bottom as well as left and right flipped.
EdgeInsets get flipped => new EdgeInsets.TRBL(bottom, left, top, right);
Rect inflateRect(Rect rect) {
return new Rect.fromLTRB(rect.left - left, rect.top - top, rect.right + right, rect.bottom + bottom);
}
EdgeDims operator -(EdgeDims other) {
return new EdgeDims.TRBL(
EdgeInsets operator -(EdgeInsets other) {
return new EdgeInsets.TRBL(
top - other.top,
right - other.right,
bottom - other.bottom,
......@@ -69,8 +69,8 @@ class EdgeDims {
);
}
EdgeDims operator +(EdgeDims other) {
return new EdgeDims.TRBL(
EdgeInsets operator +(EdgeInsets other) {
return new EdgeInsets.TRBL(
top + other.top,
right + other.right,
bottom + other.bottom,
......@@ -78,8 +78,8 @@ class EdgeDims {
);
}
EdgeDims operator *(double other) {
return new EdgeDims.TRBL(
EdgeInsets operator *(double other) {
return new EdgeInsets.TRBL(
top * other,
right * other,
bottom * other,
......@@ -87,8 +87,8 @@ class EdgeDims {
);
}
EdgeDims operator /(double other) {
return new EdgeDims.TRBL(
EdgeInsets operator /(double other) {
return new EdgeInsets.TRBL(
top / other,
right / other,
bottom / other,
......@@ -96,8 +96,8 @@ class EdgeDims {
);
}
EdgeDims operator ~/(double other) {
return new EdgeDims.TRBL(
EdgeInsets operator ~/(double other) {
return new EdgeInsets.TRBL(
(top ~/ other).toDouble(),
(right ~/ other).toDouble(),
(bottom ~/ other).toDouble(),
......@@ -105,8 +105,8 @@ class EdgeDims {
);
}
EdgeDims operator %(double other) {
return new EdgeDims.TRBL(
EdgeInsets operator %(double other) {
return new EdgeInsets.TRBL(
top % other,
right % other,
bottom % other,
......@@ -114,17 +114,17 @@ class EdgeDims {
);
}
/// Linearly interpolate between two EdgeDims.
/// Linearly interpolate between two EdgeInsets.
///
/// If either is null, this function interpolates from [EdgeDims.zero].
static EdgeDims lerp(EdgeDims a, EdgeDims b, double t) {
/// If either is null, this function interpolates from [EdgeInsets.zero].
static EdgeInsets lerp(EdgeInsets a, EdgeInsets b, double t) {
if (a == null && b == null)
return null;
if (a == null)
return b * t;
if (b == null)
return a * (1.0 - t);
return new EdgeDims.TRBL(
return new EdgeInsets.TRBL(
ui.lerpDouble(a.top, b.top, t),
ui.lerpDouble(a.right, b.right, t),
ui.lerpDouble(a.bottom, b.bottom, t),
......@@ -132,15 +132,15 @@ class EdgeDims {
);
}
/// An EdgeDims with zero offsets in each direction.
static const EdgeDims zero = const EdgeDims.TRBL(0.0, 0.0, 0.0, 0.0);
/// An EdgeInsets with zero offsets in each direction.
static const EdgeInsets zero = const EdgeInsets.TRBL(0.0, 0.0, 0.0, 0.0);
bool operator ==(dynamic other) {
if (identical(this, other))
return true;
if (other is! EdgeDims)
if (other is! EdgeInsets)
return false;
final EdgeDims typedOther = other;
final EdgeInsets typedOther = other;
return top == typedOther.top &&
right == typedOther.right &&
bottom == typedOther.bottom &&
......@@ -149,5 +149,5 @@ class EdgeDims {
int get hashCode => hashValues(top, left, bottom, right);
String toString() => "EdgeDims($top, $right, $bottom, $left)";
String toString() => "EdgeInsets($top, $right, $bottom, $left)";
}
......@@ -107,7 +107,7 @@ class BoxConstraints extends Constraints {
}
/// Returns new box constraints that are smaller by the given edge dimensions.
BoxConstraints deflate(EdgeDims edges) {
BoxConstraints deflate(EdgeInsets edges) {
assert(edges != null);
assert(debugAssertIsNormalized);
double horizontal = edges.left + edges.right;
......
......@@ -40,7 +40,7 @@ class GridSpecification {
this.rowOffsets,
this.columnSpacing: 0.0,
this.rowSpacing: 0.0,
this.padding: EdgeDims.zero
this.padding: EdgeInsets.zero
}) {
assert(_debugIsMonotonic(columnOffsets));
assert(_debugIsMonotonic(rowOffsets));
......@@ -61,7 +61,7 @@ class GridSpecification {
int rowCount,
this.rowSpacing: 0.0,
this.columnSpacing: 0.0,
this.padding: EdgeDims.zero
this.padding: EdgeInsets.zero
}) : columnOffsets = _generateRegularOffsets(columnCount, tileWidth),
rowOffsets = _generateRegularOffsets(rowCount, tileHeight) {
assert(_debugIsMonotonic(columnOffsets));
......@@ -105,7 +105,7 @@ class GridSpecification {
///
/// The grid's size encloses the spaced rows and columns and is then inflated
/// by the padding.
final EdgeDims padding;
final EdgeInsets padding;
/// The size of the grid.
Size get gridSize => new Size(columnOffsets.last + padding.horizontal, rowOffsets.last + padding.vertical);
......@@ -189,7 +189,7 @@ abstract class GridDelegateWithInOrderChildPlacement extends GridDelegate {
GridDelegateWithInOrderChildPlacement({
this.columnSpacing: 0.0,
this.rowSpacing: 0.0,
this.padding: EdgeDims.zero
this.padding: EdgeInsets.zero
}) {
assert(columnSpacing != null && columnSpacing >= 0.0);
assert(rowSpacing != null && rowSpacing >= 0.0);
......@@ -203,7 +203,7 @@ abstract class GridDelegateWithInOrderChildPlacement extends GridDelegate {
final double rowSpacing;
// Insets for the entire grid.
final EdgeDims padding;
final EdgeInsets padding;
GridChildPlacement getChildPlacement(GridSpecification specification, int index, Object placementData) {
final int columnCount = specification.columnOffsets.length - 1;
......@@ -227,7 +227,7 @@ class FixedColumnCountGridDelegate extends GridDelegateWithInOrderChildPlacement
this.columnCount,
double columnSpacing: 0.0,
double rowSpacing: 0.0,
EdgeDims padding: EdgeDims.zero,
EdgeInsets padding: EdgeInsets.zero,
this.tileAspectRatio: 1.0
}) : super(columnSpacing: columnSpacing, rowSpacing: rowSpacing, padding: padding) {
assert(columnCount != null && columnCount >= 0);
......@@ -285,7 +285,7 @@ class MaxTileWidthGridDelegate extends GridDelegateWithInOrderChildPlacement {
this.tileAspectRatio: 1.0,
double columnSpacing: 0.0,
double rowSpacing: 0.0,
EdgeDims padding: EdgeDims.zero
EdgeInsets padding: EdgeInsets.zero
}) : super(columnSpacing: columnSpacing, rowSpacing: rowSpacing, padding: padding) {
assert(maxTileWidth != null && maxTileWidth >= 0.0);
assert(tileAspectRatio != null && tileAspectRatio > 0.0);
......
......@@ -15,7 +15,7 @@ class RenderList extends RenderVirtualViewport<ListParentData> {
RenderList({
List<RenderBox> children,
double itemExtent,
EdgeDims padding,
EdgeInsets padding,
int virtualChildCount,
Offset paintOffset: Offset.zero,
Axis mainAxis: Axis.vertical,
......@@ -45,9 +45,9 @@ class RenderList extends RenderVirtualViewport<ListParentData> {
markNeedsLayout();
}
EdgeDims get padding => _padding;
EdgeDims _padding;
void set padding (EdgeDims newValue) {
EdgeInsets get padding => _padding;
EdgeInsets _padding;
void set padding (EdgeInsets newValue) {
if (_padding == newValue)
return;
_padding = newValue;
......
......@@ -84,7 +84,7 @@ abstract class RenderShiftedBox extends RenderBox with RenderObjectWithChildMixi
/// padding, effectively creating empty space around the child.
class RenderPadding extends RenderShiftedBox {
RenderPadding({
EdgeDims padding,
EdgeInsets padding,
RenderBox child
}) : _padding = padding, super(child) {
assert(padding != null);
......@@ -92,9 +92,9 @@ class RenderPadding extends RenderShiftedBox {
}
/// The amount to pad the child in each dimension.
EdgeDims get padding => _padding;
EdgeDims _padding;
void set padding (EdgeDims value) {
EdgeInsets get padding => _padding;
EdgeInsets _padding;
void set padding (EdgeInsets value) {
assert(value != null);
assert(value.isNonNegative);
if (_padding == value)
......
......@@ -108,8 +108,8 @@ class WidgetsApp extends StatefulComponent {
WidgetsAppState<WidgetsApp> createState() => new WidgetsAppState<WidgetsApp>();
}
EdgeDims _getPadding(ui.WindowPadding padding) {
return new EdgeDims.TRBL(padding.top, padding.right, padding.bottom, padding.left);
EdgeInsets _getPadding(ui.WindowPadding padding) {
return new EdgeInsets.TRBL(padding.top, padding.right, padding.bottom, padding.left);
}
class WidgetsAppState<T extends WidgetsApp> extends State<T> implements BindingObserver {
......
......@@ -354,7 +354,7 @@ class Padding extends OneChildRenderObjectWidget {
}
/// The amount to pad the child in each dimension.
final EdgeDims padding;
final EdgeInsets padding;
RenderPadding createRenderObject(BuildContext context) => new RenderPadding(padding: padding);
......@@ -926,18 +926,18 @@ class Container extends StatelessComponent {
final Decoration foregroundDecoration;
/// Empty space to surround the decoration.
final EdgeDims margin;
final EdgeInsets margin;
/// Empty space to inscribe inside the decoration.
final EdgeDims padding;
final EdgeInsets padding;
/// The transformation matrix to apply before painting the container.
final Matrix4 transform;
EdgeDims get _paddingIncludingDecoration {
EdgeInsets get _paddingIncludingDecoration {
if (decoration == null || decoration.padding == null)
return padding;
EdgeDims decorationPadding = decoration.padding;
EdgeInsets decorationPadding = decoration.padding;
if (padding == null)
return decorationPadding;
return padding + decorationPadding;
......@@ -949,7 +949,7 @@ class Container extends StatelessComponent {
if (child == null && (constraints == null || !constraints.isTight))
current = new ConstrainedBox(constraints: const BoxConstraints.expand());
EdgeDims effectivePadding = _paddingIncludingDecoration;
EdgeInsets effectivePadding = _paddingIncludingDecoration;
if (effectivePadding != null)
current = new Padding(padding: effectivePadding, child: current);
......@@ -1248,7 +1248,7 @@ class FixedColumnCountGrid extends GridRenderObjectWidgetBase {
this.columnSpacing,
this.rowSpacing,
this.tileAspectRatio: 1.0,
this.padding: EdgeDims.zero
this.padding: EdgeInsets.zero
}) : super(key: key, children: children) {
assert(columnCount != null);
}
......@@ -1266,7 +1266,7 @@ class FixedColumnCountGrid extends GridRenderObjectWidgetBase {
final double tileAspectRatio;
/// The amount of padding to apply to each child.
final EdgeDims padding;
final EdgeInsets padding;
FixedColumnCountGridDelegate createDelegate() {
return new FixedColumnCountGridDelegate(
......@@ -1290,7 +1290,7 @@ class MaxTileWidthGrid extends GridRenderObjectWidgetBase {
this.columnSpacing,
this.rowSpacing,
this.tileAspectRatio: 1.0,
this.padding: EdgeDims.zero
this.padding: EdgeInsets.zero
}) : super(key: key, children: children) {
assert(maxTileWidth != null);
}
......@@ -1308,7 +1308,7 @@ class MaxTileWidthGrid extends GridRenderObjectWidgetBase {
final double rowSpacing;
/// The amount of padding to apply to each child.
final EdgeDims padding;
final EdgeInsets padding;
MaxTileWidthGridDelegate createDelegate() {
return new MaxTileWidthGridDelegate(
......
......@@ -280,7 +280,7 @@ class _FocusState extends State<Focus> {
}
Size _mediaSize;
EdgeDims _mediaPadding;
EdgeInsets _mediaPadding;
void _ensureVisibleIfFocused() {
if (!Focus._atScope(context))
......@@ -295,7 +295,7 @@ class _FocusState extends State<Focus> {
MediaQueryData data = MediaQuery.of(context);
if (data != null) {
Size newMediaSize = data.size;
EdgeDims newMediaPadding = data.padding;
EdgeInsets newMediaPadding = data.padding;
if (newMediaSize != _mediaSize || newMediaPadding != _mediaPadding) {
_mediaSize = newMediaSize;
_mediaPadding = newMediaPadding;
......
......@@ -27,11 +27,11 @@ class DecorationTween extends Tween<Decoration> {
}
}
/// An interpolation between two [EdgeDims]s.
class EdgeDimsTween extends Tween<EdgeDims> {
EdgeDimsTween({ EdgeDims begin, EdgeDims end }) : super(begin: begin, end: end);
/// An interpolation between two [EdgeInsets]s.
class EdgeInsetsTween extends Tween<EdgeInsets> {
EdgeInsetsTween({ EdgeInsets begin, EdgeInsets end }) : super(begin: begin, end: end);
EdgeDims lerp(double t) => EdgeDims.lerp(begin, end, t);
EdgeInsets lerp(double t) => EdgeInsets.lerp(begin, end, t);
}
/// An interpolation between two [Matrix4]s.
......@@ -215,10 +215,10 @@ class AnimatedContainer extends AnimatedWidgetBase {
final Decoration foregroundDecoration;
/// Empty space to surround the decoration.
final EdgeDims margin;
final EdgeInsets margin;
/// Empty space to inscribe inside the decoration.
final EdgeDims padding;
final EdgeInsets padding;
/// The transformation matrix to apply before painting the container.
final Matrix4 transform;
......@@ -256,8 +256,8 @@ class _AnimatedContainerState extends AnimatedWidgetBaseState<AnimatedContainer>
BoxConstraintsTween _constraints;
DecorationTween _decoration;
DecorationTween _foregroundDecoration;
EdgeDimsTween _margin;
EdgeDimsTween _padding;
EdgeInsetsTween _margin;
EdgeInsetsTween _padding;
Matrix4Tween _transform;
Tween<double> _width;
Tween<double> _height;
......@@ -267,8 +267,8 @@ class _AnimatedContainerState extends AnimatedWidgetBaseState<AnimatedContainer>
_constraints = visitor(_constraints, config.constraints, (dynamic value) => new BoxConstraintsTween(begin: value));
_decoration = visitor(_decoration, config.decoration, (dynamic value) => new DecorationTween(begin: value));
_foregroundDecoration = visitor(_foregroundDecoration, config.foregroundDecoration, (dynamic value) => new DecorationTween(begin: value));
_margin = visitor(_margin, config.margin, (dynamic value) => new EdgeDimsTween(begin: value));
_padding = visitor(_padding, config.padding, (dynamic value) => new EdgeDimsTween(begin: value));
_margin = visitor(_margin, config.margin, (dynamic value) => new EdgeInsetsTween(begin: value));
_padding = visitor(_padding, config.padding, (dynamic value) => new EdgeInsetsTween(begin: value));
_transform = visitor(_transform, config.transform, (dynamic value) => new Matrix4Tween(begin: value));
_width = visitor(_width, config.width, (dynamic value) => new Tween<double>(begin: value));
_height = visitor(_height, config.height, (dynamic value) => new Tween<double>(begin: value));
......
......@@ -27,7 +27,7 @@ class MediaQueryData {
final double devicePixelRatio;
/// The padding around the edges of the media (e.g., the screen).
final EdgeDims padding;
final EdgeInsets padding;
/// The orientation of the media (e.g., whether the device is in landscape or portrait mode).
Orientation get orientation {
......
......@@ -684,7 +684,7 @@ class Block extends StatelessComponent {
}
final List<Widget> children;
final EdgeDims padding;
final EdgeInsets padding;
final double initialScrollOffset;
final Axis scrollDirection;
final ViewportAnchor scrollAnchor;
......
......@@ -37,7 +37,7 @@ class ScrollableList extends Scrollable {
final double itemExtent;
final bool itemsWrap;
final EdgeDims padding;
final EdgeInsets padding;
final ScrollableListPainter scrollableListPainter;
final Iterable<Widget> children;
......@@ -110,7 +110,7 @@ class _VirtualListViewport extends VirtualViewport {
final ViewportAnchor anchor;
final double itemExtent;
final bool itemsWrap;
final EdgeDims padding;
final EdgeInsets padding;
final RenderObjectPainter overlayPainter;
double get _leadingPadding {
......@@ -180,7 +180,7 @@ class _VirtualListViewportElement extends VirtualViewportElement {
void layout(BoxConstraints constraints) {
final int length = renderObject.virtualChildCount;
final double itemExtent = widget.itemExtent;
final EdgeDims padding = widget.padding ?? EdgeDims.zero;
final EdgeInsets padding = widget.padding ?? EdgeInsets.zero;
final Size containerSize = renderObject.size;
double containerExtent;
......@@ -250,7 +250,7 @@ class ListViewport extends _VirtualListViewport with VirtualViewportFromIterable
ViewportAnchor anchor: ViewportAnchor.start,
double itemExtent,
bool itemsWrap: false,
EdgeDims padding,
EdgeInsets padding,
RenderObjectPainter overlayPainter,
this.children
}) : super(
......@@ -301,7 +301,7 @@ class ScrollableLazyList extends Scrollable {
final double itemExtent;
final int itemCount;
final ItemListBuilder itemBuilder;
final EdgeDims padding;
final EdgeInsets padding;
final ScrollableListPainter scrollableListPainter;
ScrollableState createState() => new _ScrollableLazyListState();
......@@ -359,7 +359,7 @@ class LazyListViewport extends _VirtualListViewport with VirtualViewportFromBuil
Axis mainAxis: Axis.vertical,
ViewportAnchor anchor: ViewportAnchor.start,
double itemExtent,
EdgeDims padding,
EdgeInsets padding,
RenderObjectPainter overlayPainter,
this.itemCount,
this.itemBuilder
......
......@@ -7,12 +7,12 @@ import 'package:flutter/painting.dart';
import 'package:test/test.dart';
void main() {
test("EdgeDims.lerp()", () {
EdgeDims a = new EdgeDims.all(10.0);
EdgeDims b = new EdgeDims.all(20.0);
expect(EdgeDims.lerp(a, b, 0.25), equals(a * 1.25));
expect(EdgeDims.lerp(a, b, 0.25), equals(b * 0.625));
expect(EdgeDims.lerp(a, b, 0.25), equals(a + const EdgeDims.all(2.5)));
expect(EdgeDims.lerp(a, b, 0.25), equals(b - const EdgeDims.all(7.5)));
test("EdgeInsets.lerp()", () {
EdgeInsets a = new EdgeInsets.all(10.0);
EdgeInsets b = new EdgeInsets.all(20.0);
expect(EdgeInsets.lerp(a, b, 0.25), equals(a * 1.25));
expect(EdgeInsets.lerp(a, b, 0.25), equals(b * 0.625));
expect(EdgeInsets.lerp(a, b, 0.25), equals(a + const EdgeInsets.all(2.5)));
expect(EdgeInsets.lerp(a, b, 0.25), equals(b - const EdgeInsets.all(7.5)));
});
}
......@@ -34,7 +34,7 @@ void main() {
child: size
);
RenderBox padding = new RenderPadding(
padding: new EdgeDims.all(50.0),
padding: new EdgeInsets.all(50.0),
child: inner
);
RenderBox flex = new RenderFlex(
......@@ -67,7 +67,7 @@ void main() {
RenderBox coloredBox = new RenderDecoratedBox(
decoration: new BoxDecoration()
);
RenderBox paddingBox = new RenderPadding(padding: const EdgeDims.all(10.0),
RenderBox paddingBox = new RenderPadding(padding: const EdgeInsets.all(10.0),
child: coloredBox);
RenderBox root = new RenderDecoratedBox(
decoration: new BoxDecoration(),
......@@ -82,7 +82,7 @@ void main() {
RenderDecoratedBox coloredBox = new RenderDecoratedBox(
decoration: new BoxDecoration());
RenderPadding paddedBox = new RenderPadding(
child: coloredBox, padding: const EdgeDims.all(10.0));
child: coloredBox, padding: const EdgeInsets.all(10.0));
layout(paddedBox);
......
......@@ -83,7 +83,7 @@ Widget buildImageAtRatio(String image, Key key, double ratio, bool inferSize) {
data: new MediaQueryData(
size: const Size(windowSize, windowSize),
devicePixelRatio: ratio,
padding: const EdgeDims.all(0.0)
padding: const EdgeInsets.all(0.0)
),
child: new AssetVendor(
bundle: new TestAssetBundle(),
......
......@@ -81,7 +81,7 @@ void main() {
scaffoldKey.currentState.showBottomSheet((BuildContext context) {
return new Container(
margin: new EdgeDims.all(40.0),
margin: new EdgeInsets.all(40.0),
child: new Text('BottomSheet')
);
}).closed.then((_) {
......
......@@ -12,7 +12,7 @@ void main() {
testWidgets((WidgetTester tester) {
tester.pumpWidget(
new Container(
padding: new EdgeDims.all(50.0),
padding: new EdgeInsets.all(50.0),
decoration: new BoxDecoration(
shape: BoxShape.circle,
border: new Border.all(width: 10.0, color: const Color(0x80FF00FF)),
......
......@@ -39,7 +39,7 @@ Widget buildDismissableItem(int item) {
Widget widgetBuilder() {
return new Container(
padding: const EdgeDims.all(10.0),
padding: const EdgeInsets.all(10.0),
child: new ScrollableList(
scrollDirection: scrollDirection,
itemExtent: itemExtent,
......
......@@ -100,7 +100,7 @@ void main() {
new ScrollableList(
key: new GlobalKey(),
itemExtent: 290.0,
padding: new EdgeDims.TRBL(20.0, 15.0, 10.0, 5.0),
padding: new EdgeInsets.TRBL(20.0, 15.0, 10.0, 5.0),
children: items.map((int item) {
return new Container(
child: new GestureDetector(
......@@ -135,7 +135,7 @@ void main() {
key: new GlobalKey(),
itemExtent: 290.0,
scrollAnchor: ViewportAnchor.end,
padding: new EdgeDims.TRBL(20.0, 15.0, 10.0, 5.0),
padding: new EdgeInsets.TRBL(20.0, 15.0, 10.0, 5.0),
children: items.map((int item) {
return new Container(
child: new GestureDetector(
......
......@@ -71,7 +71,7 @@ void main() {
tester.pumpWidget(
new ScrollableList(
itemExtent: 290.0,
padding: new EdgeDims.only(top: 250.0),
padding: new EdgeInsets.only(top: 250.0),
scrollDirection: Axis.vertical,
children: items.map((int item) {
return new Container(
......
......@@ -28,9 +28,9 @@ void main() {
key: key,
message: 'TIP',
height: 20.0,
padding: const EdgeDims.all(5.0),
padding: const EdgeInsets.all(5.0),
verticalOffset: 20.0,
screenEdgeMargin: const EdgeDims.all(10.0),
screenEdgeMargin: const EdgeInsets.all(10.0),
preferBelow: false,
fadeDuration: const Duration(seconds: 1),
showDuration: const Duration(seconds: 2),
......@@ -82,9 +82,9 @@ void main() {
key: key,
message: 'TIP',
height: 100.0,
padding: const EdgeDims.all(0.0),
padding: const EdgeInsets.all(0.0),
verticalOffset: 100.0,
screenEdgeMargin: const EdgeDims.all(100.0),
screenEdgeMargin: const EdgeInsets.all(100.0),
preferBelow: false,
fadeDuration: const Duration(seconds: 1),
showDuration: const Duration(seconds: 2),
......@@ -138,9 +138,9 @@ void main() {
key: key,
message: 'TIP',
height: 100.0,
padding: const EdgeDims.all(0.0),
padding: const EdgeInsets.all(0.0),
verticalOffset: 100.0,
screenEdgeMargin: const EdgeDims.all(100.0),
screenEdgeMargin: const EdgeInsets.all(100.0),
preferBelow: false,
fadeDuration: const Duration(seconds: 1),
showDuration: const Duration(seconds: 2),
......@@ -205,9 +205,9 @@ void main() {
key: key,
message: 'TIP',
height: 100.0,
padding: const EdgeDims.all(0.0),
padding: const EdgeInsets.all(0.0),
verticalOffset: 100.0,
screenEdgeMargin: const EdgeDims.all(100.0),
screenEdgeMargin: const EdgeInsets.all(100.0),
preferBelow: true,
fadeDuration: const Duration(seconds: 1),
showDuration: const Duration(seconds: 2),
......@@ -260,9 +260,9 @@ void main() {
key: key,
message: 'TIP',
height: 10.0,
padding: const EdgeDims.all(0.0),
padding: const EdgeInsets.all(0.0),
verticalOffset: 10.0,
screenEdgeMargin: const EdgeDims.all(10.0),
screenEdgeMargin: const EdgeInsets.all(10.0),
preferBelow: true,
fadeDuration: const Duration(seconds: 1),
showDuration: const Duration(seconds: 2),
......@@ -317,9 +317,9 @@ void main() {
key: key,
message: 'TIP',
height: 10.0,
padding: const EdgeDims.all(0.0),
padding: const EdgeInsets.all(0.0),
verticalOffset: 10.0,
screenEdgeMargin: const EdgeDims.all(10.0),
screenEdgeMargin: const EdgeInsets.all(10.0),
preferBelow: true,
fadeDuration: const Duration(seconds: 1),
showDuration: const Duration(seconds: 2),
......
......@@ -68,7 +68,7 @@ class MarkdownBody extends MarkdownBodyRaw {
///
/// new ScrollableViewport(
/// child: new Padding(
/// padding: new EdgeDims.all(16.0),
/// padding: new EdgeInsets.all(16.0),
/// child: new Markdown(data: markdownSource)
/// )
/// )
......
......@@ -29,7 +29,7 @@ class MarkdownRaw extends StatelessComponent {
this.data,
this.markdownStyle,
this.syntaxHighlighter,
this.padding: const EdgeDims.all(16.0),
this.padding: const EdgeInsets.all(16.0),
this.onTapLink
});
......@@ -43,7 +43,7 @@ class MarkdownRaw extends StatelessComponent {
final SyntaxHighlighter syntaxHighlighter;
/// Padding used
final EdgeDims padding;
final EdgeInsets padding;
/// Callback when a link is tapped
final MarkdownLinkCallback onTapLink;
......@@ -94,7 +94,7 @@ class MarkdownBodyRaw extends StatefulComponent {
///
/// new ScrollableViewport(
/// child: new Padding(
/// padding: new EdgeDims.all(16.0),
/// padding: new EdgeInsets.all(16.0),
/// child: new MarkdownBodyRaw(
/// data: markdownSource,
/// markdownStyle: myStyle
......@@ -382,7 +382,7 @@ class _Block {
}
else {
bullet = new Padding(
padding: new EdgeDims.only(right: 5.0),
padding: new EdgeInsets.only(right: 5.0),
child: new Text(
"${blockPosition + 1}.",
style: new TextStyle(textAlign: TextAlign.right)
......@@ -404,19 +404,19 @@ class _Block {
}
BoxDecoration decoration;
EdgeDims padding;
EdgeInsets padding;
if (tag == 'blockquote') {
decoration = markdownStyle.blockquoteDecoration;
padding = new EdgeDims.all(markdownStyle.blockquotePadding);
padding = new EdgeInsets.all(markdownStyle.blockquotePadding);
} else if (tag == 'pre') {
decoration = markdownStyle.codeblockDecoration;
padding = new EdgeDims.all(markdownStyle.codeblockPadding);
padding = new EdgeInsets.all(markdownStyle.codeblockPadding);
}
return new Container(
padding: padding,
margin: new EdgeDims.only(bottom: spacing),
margin: new EdgeInsets.only(bottom: spacing),
child: contents,
decoration: decoration
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment