Created
April 28, 2020 12:43
-
-
Save RabiRoshan/6ac289c26c2c726b145a69fa521e3c3d to your computer and use it in GitHub Desktop.
Refresh Indicator between SliverAppBar and SliverList (Like Instagram refresh) in Flutter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CustomScrollView( | |
physics: | |
const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()), | |
slivers: <Widget>[ | |
SliverAppBar( | |
title: Text( | |
"Example", | |
style: heading1, | |
), | |
floating: true, | |
elevation: 3, | |
forceElevated: true, | |
backgroundColor: backgroundWhite, | |
), | |
CupertinoSliverRefreshControl( | |
onRefresh: () async { | |
await Future.delayed(Duration(seconds: 2)); | |
}, | |
), | |
SliverList( | |
delegate: SliverChildBuilderDelegate( | |
(BuildContext context, int index) { | |
return Container( | |
color: Colors | |
.primaries[Random().nextInt(Colors.primaries.length)], | |
height: 150.0); | |
}, | |
), | |
) | |
], | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment