Rename and refactor ScrollView hierarchy (#7865)
This prepares us for a CustomScrollView that takes slivers.
This commit is contained in:
@@ -134,7 +134,7 @@ class CardsDemo extends StatelessWidget {
|
||||
appBar: new AppBar(
|
||||
title: new Text('Travel stream')
|
||||
),
|
||||
body: new ScrollView(
|
||||
body: new ListView(
|
||||
itemExtent: TravelDestinationItem.height,
|
||||
padding: const EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0),
|
||||
children: destinations.map((TravelDestination destination) {
|
||||
|
||||
@@ -41,7 +41,7 @@ class _ChipDemoState extends State<ChipDemo> {
|
||||
|
||||
return new Scaffold(
|
||||
appBar: new AppBar(title: new Text('Chips')),
|
||||
body: new ScrollView(
|
||||
body: new ListView(
|
||||
children: chips.map((Widget widget) {
|
||||
return new Container(
|
||||
height: 100.0,
|
||||
|
||||
@@ -98,7 +98,7 @@ class ColorSwatchTabView extends StatelessWidget {
|
||||
}).toList());
|
||||
}
|
||||
|
||||
return new ScrollView(
|
||||
return new ListView(
|
||||
itemExtent: kColorItemHeight,
|
||||
children: colorItems,
|
||||
);
|
||||
|
||||
@@ -165,7 +165,7 @@ class _DataTableDemoState extends State<DataTableDemo> {
|
||||
Widget build(BuildContext context) {
|
||||
return new Scaffold(
|
||||
appBar: new AppBar(title: new Text('Data tables')),
|
||||
body: new ScrollView(
|
||||
body: new ListView(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
children: <Widget>[
|
||||
new PaginatedDataTable(
|
||||
|
||||
@@ -89,7 +89,7 @@ class DialogDemoState extends State<DialogDemo> {
|
||||
appBar: new AppBar(
|
||||
title: new Text('Dialogs')
|
||||
),
|
||||
body: new ScrollView(
|
||||
body: new ListView(
|
||||
padding: const EdgeInsets.symmetric(vertical: 24.0, horizontal: 72.0),
|
||||
children: <Widget>[
|
||||
new RaisedButton(
|
||||
|
||||
@@ -88,7 +88,7 @@ class _DrawerDemoState extends State<DrawerDemo> with TickerProviderStateMixin {
|
||||
title: new Text('Navigation drawer'),
|
||||
),
|
||||
drawer: new Drawer(
|
||||
child: new ScrollView(
|
||||
child: new ListView(
|
||||
children: <Widget>[
|
||||
new UserAccountsDrawerHeader(
|
||||
accountName: new Text('Zach Widget'),
|
||||
|
||||
@@ -157,7 +157,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
||||
)
|
||||
]
|
||||
),
|
||||
body: new ScrollView(
|
||||
body: new ListView(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
children: <Widget>[
|
||||
new Container(
|
||||
|
||||
@@ -339,7 +339,7 @@ class GridListDemoState extends State<GridListDemo> {
|
||||
body: new Column(
|
||||
children: <Widget>[
|
||||
new Expanded(
|
||||
child: new ScrollGrid.count(
|
||||
child: new GridView.count(
|
||||
crossAxisCount: (orientation == Orientation.portrait) ? 2 : 3,
|
||||
mainAxisSpacing: 4.0,
|
||||
crossAxisSpacing: 4.0,
|
||||
|
||||
@@ -161,7 +161,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
|
||||
)
|
||||
]
|
||||
),
|
||||
body: new ScrollView(
|
||||
body: new ListView(
|
||||
children: leaveBehindItems.map(buildItem).toList()
|
||||
)
|
||||
);
|
||||
|
||||
@@ -40,7 +40,7 @@ class ListDemoState extends State<ListDemo> {
|
||||
decoration: new BoxDecoration(
|
||||
border: new Border(top: new BorderSide(color: Colors.black26))
|
||||
),
|
||||
child: new ScrollView(
|
||||
child: new ListView(
|
||||
shrinkWrap: true,
|
||||
children: <Widget>[
|
||||
new ListItem(
|
||||
|
||||
@@ -83,7 +83,7 @@ class MenuDemoState extends State<MenuDemo> {
|
||||
)
|
||||
]
|
||||
),
|
||||
body: new ScrollView(
|
||||
body: new ListView(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
children: <Widget>[
|
||||
// Pressing the PopupMenuButton on the right of this item shows
|
||||
|
||||
@@ -29,7 +29,7 @@ class _SnackBarDemoState extends State<SnackBarDemo> {
|
||||
int _snackBarIndex = 1;
|
||||
|
||||
Widget buildBody(BuildContext context) {
|
||||
return new ScrollView(
|
||||
return new ListView(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
children: <Widget>[
|
||||
new Text(_text1),
|
||||
|
||||
@@ -127,7 +127,7 @@ class TabsDemo extends StatelessWidget {
|
||||
),
|
||||
body: new TabBarView(
|
||||
children: _allPages.keys.map((_Page page) {
|
||||
return new ScrollView(
|
||||
return new ListView(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
|
||||
itemExtent: _CardDataItem.height,
|
||||
children: _allPages[page].map((_CardData data) {
|
||||
|
||||
@@ -22,7 +22,7 @@ class TooltipDemo extends StatelessWidget {
|
||||
),
|
||||
body: new Builder(
|
||||
builder: (BuildContext context) {
|
||||
return new ScrollView(
|
||||
return new ListView(
|
||||
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 ScrollView(children: styleItems)
|
||||
body: new ListView(children: styleItems)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,6 +305,6 @@ class GalleryDrawer extends StatelessWidget {
|
||||
));
|
||||
}
|
||||
|
||||
return new Drawer(child: new ScrollView(children: allDrawerItems));
|
||||
return new Drawer(child: new ListView(children: allDrawerItems));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ class GridLists {
|
||||
// START gridlists
|
||||
// Creates a scrollable grid list with images
|
||||
// loaded from the web.
|
||||
new ScrollGrid.count(
|
||||
new GridView.count(
|
||||
crossAxisCount: 3,
|
||||
childAspectRatio: 1.0,
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
|
||||
@@ -76,12 +76,12 @@ class AdaptiveContainer extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (MediaQuery.of(context).size.width < _kGridViewBreakpoint) {
|
||||
return new ScrollView(
|
||||
return new ListView(
|
||||
itemExtent: _kListItemExtent,
|
||||
children: names.map((String name) => new AdaptedListItem(name: name)).toList(),
|
||||
);
|
||||
} else {
|
||||
return new ScrollGrid.extent(
|
||||
return new GridView.extent(
|
||||
maxCrossAxisExtent: _kMaxTileWidth,
|
||||
children: names.map((String name) => new AdaptedGridItem(name: name)).toList(),
|
||||
);
|
||||
|
||||
@@ -121,7 +121,7 @@ class StockHomeState extends State<StockHome> {
|
||||
|
||||
Widget _buildDrawer(BuildContext context) {
|
||||
return new Drawer(
|
||||
child: new ScrollView(
|
||||
child: new ListView(
|
||||
children: <Widget>[
|
||||
new DrawerHeader(child: new Center(child: new Text('Stocks'))),
|
||||
new DrawerItem(
|
||||
|
||||
@@ -240,7 +240,7 @@ class StockSettingsState extends State<StockSettings> {
|
||||
]);
|
||||
return true;
|
||||
});
|
||||
return new ScrollView(
|
||||
return new ListView(
|
||||
padding: const EdgeInsets.symmetric(vertical: 20.0),
|
||||
children: rows,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user