Commit 1251f01e authored by Adam Barth's avatar Adam Barth

Convert some Columns into Blocks (#3210)

These columns were secretly re-creating Block in a more complex way. Now we
just use Block directly.
parent e456d863
...@@ -159,95 +159,87 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -159,95 +159,87 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
) )
] ]
), ),
body: new Padding( body: new Block(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: new ScrollableViewport( children: <Widget>[
child: new Column( new Container(
crossAxisAlignment: CrossAxisAlignment.stretch, padding: const EdgeInsets.symmetric(vertical: 8.0),
mainAxisAlignment: MainAxisAlignment.collapse, decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(color: theme.dividerColor))
),
child: new Align(
alignment: FractionalOffset.bottomLeft,
child: new Text('Event name', style: theme.textTheme.display2)
)
),
new Container(
padding: const EdgeInsets.symmetric(vertical: 8.0),
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(color: theme.dividerColor))
),
child: new Align(
alignment: FractionalOffset.bottomLeft,
child: new Text('Location', style: theme.textTheme.title.copyWith(color: Colors.black54))
)
),
new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
new Container( new Text('From', style: theme.textTheme.caption),
padding: const EdgeInsets.symmetric(vertical: 8.0), new DateTimeItem(
decoration: new BoxDecoration( dateTime: _fromDateTime,
border: new Border(bottom: new BorderSide(color: theme.dividerColor)) onChanged: (DateTime value) {
), setState(() {
child: new Align( _fromDateTime = value;
alignment: FractionalOffset.bottomLeft, _saveNeeded = true;
child: new Text('Event name', style: theme.textTheme.display2) });
) }
), )
new Container( ]
padding: const EdgeInsets.symmetric(vertical: 8.0), ),
decoration: new BoxDecoration( new Column(
border: new Border(bottom: new BorderSide(color: theme.dividerColor)) crossAxisAlignment: CrossAxisAlignment.start,
), children: <Widget>[
child: new Align( new Text('To', style: theme.textTheme.caption),
alignment: FractionalOffset.bottomLeft, new DateTimeItem(
child: new Text('Location', style: theme.textTheme.title.copyWith(color: Colors.black54)) dateTime: _toDateTime,
) onChanged: (DateTime value) {
), setState(() {
new Column( _toDateTime = value;
crossAxisAlignment: CrossAxisAlignment.stretch, _saveNeeded = true;
mainAxisAlignment: MainAxisAlignment.end, });
children: <Widget>[ }
new Text('From', style: theme.textTheme.caption),
new DateTimeItem(
dateTime: _fromDateTime,
onChanged: (DateTime value) {
setState(() {
_fromDateTime = value;
_saveNeeded = true;
});
}
)
]
),
new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
new Text('To', style: theme.textTheme.caption),
new DateTimeItem(
dateTime: _toDateTime,
onChanged: (DateTime value) {
setState(() {
_toDateTime = value;
_saveNeeded = true;
});
}
)
]
),
new Container(
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(color: theme.dividerColor))
),
child: new Row(
children: <Widget> [
new Checkbox(
value: _allDayValue,
onChanged: (bool value) {
setState(() {
_allDayValue = value;
_saveNeeded = true;
});
}
),
new Text('All-day')
]
)
) )
] ]
.map((Widget child) { ),
return new Container( new Container(
padding: const EdgeInsets.symmetric(vertical: 8.0), decoration: new BoxDecoration(
height: 96.0, border: new Border(bottom: new BorderSide(color: theme.dividerColor))
child: child ),
); child: new Row(
}) children: <Widget> [
.toList() new Checkbox(
value: _allDayValue,
onChanged: (bool value) {
setState(() {
_allDayValue = value;
_saveNeeded = true;
});
}
),
new Text('All-day')
]
)
) )
) ]
.map((Widget child) {
return new Container(
padding: const EdgeInsets.symmetric(vertical: 8.0),
height: 96.0,
child: child
);
})
.toList()
) )
); );
} }
......
...@@ -38,9 +38,7 @@ class ListDemoState extends State<ListDemo> { ...@@ -38,9 +38,7 @@ class ListDemoState extends State<ListDemo> {
decoration: new BoxDecoration( decoration: new BoxDecoration(
border: new Border(top: new BorderSide(color: Colors.black26)) border: new Border(top: new BorderSide(color: Colors.black26))
), ),
child: new Column( child: new Block(
mainAxisAlignment: MainAxisAlignment.collapse,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[ children: <Widget>[
new ListItem( new ListItem(
dense: true, dense: true,
......
...@@ -19,8 +19,7 @@ class TooltipDemo extends StatelessWidget { ...@@ -19,8 +19,7 @@ class TooltipDemo extends StatelessWidget {
), ),
body: new Builder( body: new Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return new Column( return new Block(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[ children: <Widget>[
new Text(_introText, style: theme.textTheme.subhead), new Text(_introText, style: theme.textTheme.subhead),
new Row( new Row(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment