Skip to content

Instantly share code, notes, and snippets.

@Classy-Bear
Last active January 18, 2020 20:38
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/f81a005588403706ad50d686ce9b8919 to your computer and use it in GitHub Desktop.
Save Classy-Bear/f81a005588403706ad50d686ce9b8919 to your computer and use it in GitHub Desktop.
@override
void initState() {
super.initState();
random = Random();
refreshList();
}
Future<Null> refreshList() async {
refreshKey.currentState?.show();
await Future.delayed(Duration(seconds: 2));
setState(() {
list = 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