Commit a4eca317 authored by Adam Barth's avatar Adam Barth Committed by GitHub

Use ScrollView in examples a manual_tests (#7645)

This patch deploys ScrollView in a number of demos and manual tests.
parent 905353b4
......@@ -589,7 +589,7 @@ class GalleryDrawer extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Drawer(
child: new Block(
child: new ScrollView(
children: <Widget>[
new FancyDrawerHeader(),
new DrawerItem(
......
......@@ -123,7 +123,8 @@ class CardCollectionState extends State<CardCollection> {
return new Drawer(
child: new IconTheme(
data: const IconThemeData(color: Colors.black),
child: new Block(children: <Widget>[
child: new ScrollView(
children: <Widget>[
new DrawerHeader(child: new Center(child: new Text('Options'))),
buildDrawerCheckbox("Make card labels editable", _editable, _toggleEditable),
buildDrawerCheckbox("Snap fling scrolls to center", _snapToCenter, _toggleSnapToCenter),
......@@ -149,7 +150,8 @@ class CardCollectionState extends State<CardCollection> {
onPressed: () { debugDumpApp(); debugDumpRenderTree(); },
child: new Text('Dump App to Console')
),
])
]
)
)
);
}
......
......@@ -84,7 +84,8 @@ class PageableListAppState extends State<PageableListApp> {
Widget _buildDrawer() {
return new Drawer(
child: new Block(children: <Widget>[
child: new ScrollView(
children: <Widget>[
new DrawerHeader(child: new Center(child: new Text('Options'))),
new DrawerItem(
icon: new Icon(Icons.more_horiz),
......@@ -108,7 +109,8 @@ class PageableListAppState extends State<PageableListApp> {
]
)
)
])
]
)
);
}
......
......@@ -41,7 +41,7 @@ class _ChipDemoState extends State<ChipDemo> {
return new Scaffold(
appBar: new AppBar(title: new Text('Chips')),
body: new Block(
body: new ScrollView(
children: chips.map((Widget widget) {
return new Container(
height: 100.0,
......
......@@ -88,7 +88,7 @@ class _DrawerDemoState extends State<DrawerDemo> with TickerProviderStateMixin {
title: new Text('Navigation drawer'),
),
drawer: new Drawer(
child: new Block(
child: new ScrollView(
children: <Widget>[
new UserAccountsDrawerHeader(
accountName: new Text('Zach Widget'),
......
......@@ -161,7 +161,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
)
]
),
body: new Block(
body: new ScrollView(
children: leaveBehindItems.map(buildItem).toList()
)
);
......
......@@ -29,9 +29,8 @@ class _SnackBarDemoState extends State<SnackBarDemo> {
int _snackBarIndex = 1;
Widget buildBody(BuildContext context) {
return new Padding(
return new Block(
padding: const EdgeInsets.all(24.0),
child: new Block(
children: <Widget>[
new Text(_text1),
new Text(_text2),
......@@ -63,7 +62,6 @@ class _SnackBarDemoState extends State<SnackBarDemo> {
);
})
.toList()
)
);
}
......
......@@ -22,7 +22,7 @@ class TooltipDemo extends StatelessWidget {
),
body: new Builder(
builder: (BuildContext context) {
return new Block(
return new ScrollView(
children: <Widget>[
new Text(_introText, style: theme.textTheme.subhead),
new Row(
......
......@@ -66,7 +66,7 @@ class TypographyDemo extends StatelessWidget {
return new Scaffold(
appBar: new AppBar(title: new Text('Typography')),
body: new Block(children: styleItems)
body: new ScrollView(children: styleItems)
);
}
}
......@@ -305,6 +305,6 @@ class GalleryDrawer extends StatelessWidget {
));
}
return new Drawer(child: new Block(children: allDrawerItems));
return new Drawer(child: new ScrollView(children: allDrawerItems));
}
}
......@@ -121,7 +121,8 @@ class StockHomeState extends State<StockHome> {
Widget _buildDrawer(BuildContext context) {
return new Drawer(
child: new Block(children: <Widget>[
child: new ScrollView(
children: <Widget>[
new DrawerHeader(child: new Center(child: new Text('Stocks'))),
new DrawerItem(
icon: new Icon(Icons.assessment),
......@@ -177,7 +178,8 @@ class StockHomeState extends State<StockHome> {
icon: new Icon(Icons.help),
onPressed: _handleShowAbout,
child: new Text('About'))
])
]
)
);
}
......
......@@ -241,8 +241,8 @@ class StockSettingsState extends State<StockSettings> {
return true;
});
return new Block(
padding: const EdgeInsets.symmetric(vertical: 20.0),
children: rows,
padding: const EdgeInsets.symmetric(vertical: 20.0)
);
}
......
......@@ -73,9 +73,8 @@ class StockSymbolPage extends StatelessWidget {
appBar: new AppBar(
title: new Text(stock.name)
),
body: new Block(
children: <Widget>[
new Container(
body: new SingleChildScrollView(
child: new Container(
margin: new EdgeInsets.all(20.0),
child: new Card(
child: new _StockSymbolView(
......@@ -88,7 +87,6 @@ class StockSymbolPage extends StatelessWidget {
)
)
)
]
)
);
}
......
......@@ -39,7 +39,7 @@ void main() {
children.add(const SizedBox(height: 18.0));
children.add(new Center(child: new CircularProgressIndicator(value: progressMax > 0 ? progress / progressMax : null)));
}
return new Block(children: children);
return new ScrollView(children: children);
},
),
),
......
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