Skip to content

Instantly share code, notes, and snippets.

@timsneath
Created April 5, 2018 00:33
Show Gist options
  • Save timsneath/7c4f355ef2f66dcc451a8eb3eaab7501 to your computer and use it in GitHub Desktop.
Save timsneath/7c4f355ef2f66dcc451a8eb3eaab7501 to your computer and use it in GitHub Desktop.
Simple refresh button in Flutter
_refreshAction() {
setState(() {
_response = http.read(dadJokeApi, headers: httpHeaders);
});
}
floatingActionButton: new FloatingActionButton(
onPressed: _refreshAction,
tooltip: 'New joke',
child: new Icon(Icons.refresh),
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment