Last active
July 23, 2019 22:23
-
-
Save kwalrath/af5e1465970b74aa9e8b9dbd5ef685b5 to your computer and use it in GitHub Desktop.
event loop example #2
This file contains hidden or 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
| 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