Skip to content

Instantly share code, notes, and snippets.

@Classy-Bear
Last active December 20, 2019 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Classy-Bear/29c2302ee0dc862000c9dd512617c7d2 to your computer and use it in GitHub Desktop.
Save Classy-Bear/29c2302ee0dc862000c9dd512617c7d2 to your computer and use it in GitHub Desktop.
import 'dart:math';
final random = Random();
final refreshKey = GlobalKey<RefreshIndicatorState>();
var lista = [];
Future<Null> refreshList() async {
refreshKey.currentState?.show(atTop: false);
await Future.delayed(Duration(seconds: 1));
setState(() {
lista = List.generate(random.nextInt(10), (i) => "Item $i");
});
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment