Rename and refactor ScrollView hierarchy (#7865)

This prepares us for a CustomScrollView that takes slivers.
This commit is contained in:
Ian Hickson
2017-02-03 16:05:43 -08:00
committed by GitHub
parent 7fea0593f5
commit 332a23030b
49 changed files with 363 additions and 167 deletions

View File

@@ -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) {

View File

@@ -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,

View File

@@ -98,7 +98,7 @@ class ColorSwatchTabView extends StatelessWidget {
}).toList());
}
return new ScrollView(
return new ListView(
itemExtent: kColorItemHeight,
children: colorItems,
);

View File

@@ -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(

View File

@@ -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(

View File

@@ -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'),

View File

@@ -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(

View File

@@ -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,

View File

@@ -161,7 +161,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
)
]
),
body: new ScrollView(
body: new ListView(
children: leaveBehindItems.map(buildItem).toList()
)
);

View File

@@ -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(

View File

@@ -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

View File

@@ -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),

View File

@@ -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) {

View File

@@ -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(

View File

@@ -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)
);
}
}

View File

@@ -305,6 +305,6 @@ class GalleryDrawer extends StatelessWidget {
));
}
return new Drawer(child: new ScrollView(children: allDrawerItems));
return new Drawer(child: new ListView(children: allDrawerItems));
}
}

View File

@@ -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),

View File

@@ -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(),
);

View File

@@ -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(

View File

@@ -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,
);