ScrollConfiguration (#4026)

This commit is contained in:
Hans Muller
2016-05-20 16:59:09 -07:00
parent 10c861d6e9
commit 1f06dc44cd
14 changed files with 235 additions and 92 deletions

View File

@@ -191,13 +191,11 @@ class ListDemoState extends State<ListDemo> {
)
]
),
body: new OverscrollIndicator(
child: new Scrollbar(
child: new MaterialList(
type: _itemType,
padding: new EdgeInsets.symmetric(vertical: _dense ? 4.0 : 8.0),
children: listItems
)
body: new Scrollbar(
child: new MaterialList(
type: _itemType,
padding: new EdgeInsets.symmetric(vertical: _dense ? 4.0 : 8.0),
children: listItems
)
)
);

View File

@@ -43,17 +43,22 @@ class OverscrollDemoState extends State<OverscrollDemo> {
break;
}
Widget body = new MaterialList(
type: MaterialListType.threeLine,
padding: const EdgeInsets.all(8.0),
children: _items.map((String item) {
return new ListItem(
isThreeLine: true,
leading: new CircleAvatar(child: new Text(item)),
title: new Text('This item represents $item.'),
subtitle: new Text('Even more additional list item information appears on line three.')
);
})
// The default ScrollConfiguration doesn't include the
// OverscrollIndicator. That's what we want, since this demo
// adds the OverscrollIndicator itself.
Widget body = new ScrollConfiguration(
child: new MaterialList(
type: MaterialListType.threeLine,
padding: const EdgeInsets.all(8.0),
children: _items.map((String item) {
return new ListItem(
isThreeLine: true,
leading: new CircleAvatar(child: new Text(item)),
title: new Text('This item represents $item.'),
subtitle: new Text('Even more additional list item information appears on line three.')
);
})
)
);
switch(_type) {
case IndicatorType.overscroll:
@@ -91,5 +96,4 @@ class OverscrollDemoState extends State<OverscrollDemo> {
body: body
);
}
}