Refresh indicator (#4788)

This commit is contained in:
Hans Muller
2016-06-30 10:07:28 -07:00
committed by GitHub
parent 63eedb7677
commit d9b9983e1a
6 changed files with 129 additions and 60 deletions

View File

@@ -18,6 +18,7 @@ class OverscrollDemo extends StatefulWidget {
}
class OverscrollDemoState extends State<OverscrollDemo> {
static final GlobalKey<ScrollableState> _scrollableKey = new GlobalKey<ScrollableState>();
static final List<String> _items = <String>[
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N'
];
@@ -50,6 +51,7 @@ class OverscrollDemoState extends State<OverscrollDemo> {
child: new MaterialList(
type: MaterialListType.threeLine,
padding: const EdgeInsets.all(8.0),
scrollableKey: _scrollableKey,
children: _items.map((String item) {
return new ListItem(
isThreeLine: true,
@@ -65,7 +67,11 @@ class OverscrollDemoState extends State<OverscrollDemo> {
body = new OverscrollIndicator(child: body);
break;
case IndicatorType.refresh:
body = new RefreshIndicator(child: body, refresh: refresh);
body = new RefreshIndicator(
child: body,
refresh: refresh,
scrollableKey: _scrollableKey
);
break;
}