Skip to content

Instantly share code, notes, and snippets.

View pdslly's full-sized avatar

pdslly

View GitHub Profile
@pdslly
pdslly / dart_futures_01.dart
Last active October 24, 2019 06:06
dart_futures
final myFuture = http.get(""https://example.com);
// 许多的Dart异步API都是返回的Futures.
@pdslly
pdslly / dart_futures_02.dart
Created October 24, 2019 06:07
dart_futures
RaisedButton(
onPressed: () {
final myFuture = http.get('https://my.image.url');
myFuture.then((resp) {
setImage(resp);
});
},
child: Text('Click me!'),
)