Skip to content

Instantly share code, notes, and snippets.

@kwalrath
Last active July 23, 2019 22:23
Show Gist options
  • Save kwalrath/af5e1465970b74aa9e8b9dbd5ef685b5 to your computer and use it in GitHub Desktop.
Save kwalrath/af5e1465970b74aa9e8b9dbd5ef685b5 to your computer and use it in GitHub Desktop.
event loop example #2
RaisedButton( // (1)
child: Text('Click me'),
onPressed: () { // (2)
final myFuture = http.get('https://example.com');
myFuture.then((response) { // (3)
if (response.statusCode == 200) {
print('Success!');
}
});
},
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment