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