Change Block children to be a named parameter

This commit is contained in:
Hans Muller
2016-01-21 16:59:52 -08:00
parent 05f79b4e45
commit 8218ff683f
28 changed files with 85 additions and 69 deletions

View File

@@ -121,7 +121,7 @@ class CardCollectionState extends State<CardCollection> {
return new Drawer(
child: new IconTheme(
data: const IconThemeData(color: IconThemeColor.black),
child: new Block(<Widget>[
child: new Block(children: <Widget>[
new DrawerHeader(child: new Text('Options')),
buildDrawerCheckbox("Make card labels editable", _editable, _toggleEditable),
buildDrawerCheckbox("Snap fling scrolls to center", _snapToCenter, _toggleSnapToCenter),

View File

@@ -95,7 +95,7 @@ class CrabPage extends StatelessComponent {
return new Material(
color: const Color(0x00000000),
child: new Block(
<Widget>[
children: <Widget>[
new Stack(
children: <Widget>[
new HeroImage(

View File

@@ -41,7 +41,7 @@ class HorizontalScrollingApp extends StatelessComponent {
return new Center(
child: new Container(
height: 50.0,
child: new Block(circles, scrollDirection: Axis.horizontal)
child: new Block(children: circles, scrollDirection: Axis.horizontal)
)
);
}

View File

@@ -53,10 +53,12 @@ class PostDemoState extends State<PostDemo> {
),
body: new Material(
child: new Block(
[new Text(
"${_response ?? 'Loading...'}",
style: Typography.black.body1
)]
children: <Widget>[
new Text(
"${_response ?? 'Loading...'}",
style: Typography.black.body1
)
]
)
),
floatingActionButton: new FloatingActionButton(

View File

@@ -88,7 +88,7 @@ class _MimicDemoState extends State<MimicDemo> {
return new GestureDetector(
onTap: _handleTap,
onLongPress: _reset,
child: new Block(children)
child: new Block(children: children)
);
}
}

View File

@@ -8,7 +8,8 @@ class Home extends StatelessComponent {
Widget build(BuildContext context) {
return new Material(
child: new Center(
child: new Block(<Widget>[
child: new Block(
children: <Widget>[
new Text(
'You are at home.',
style: Theme.of(context).text.display2.copyWith(textAlign: TextAlign.center)
@@ -34,7 +35,8 @@ class Shopping extends StatelessComponent {
return new Material(
color: Colors.deepPurple[300],
child: new Center(
child: new Block(<Widget>[
child: new Block(
children: <Widget>[
new Text(
'Village Shop',
style: Theme.of(context).text.display2.copyWith(textAlign: TextAlign.center)
@@ -60,7 +62,8 @@ class Adventure extends StatelessComponent {
return new Material(
color: Colors.red[300],
child: new Center(
child: new Block(<Widget>[
child: new Block(
children: <Widget>[
new Text(
'Monster\'s Lair',
style: Theme.of(context).text.display2.copyWith(textAlign: TextAlign.center)

View File

@@ -79,7 +79,7 @@ class PageableListAppState extends State<PageableListApp> {
Widget _buildDrawer() {
return new Drawer(
child: new Block(<Widget>[
child: new Block(children: <Widget>[
new DrawerHeader(child: new Text('Options')),
new DrawerItem(
icon: 'navigation/more_horiz',

View File

@@ -106,7 +106,7 @@ class SmoothBlockState extends State<SmoothBlock> {
class SmoothResizeDemo extends StatelessComponent {
Widget build(BuildContext context) {
return new Block(_kColors.map((Map<int, Color> color) => new SmoothBlock(color: color)).toList());
return new Block(children: _kColors.map((Map<int, Color> color) => new SmoothBlock(color: color)).toList());
}
}