Skip to content

Instantly share code, notes, and snippets.

@michilu
Last active August 27, 2018 09:59
Show Gist options
  • Save michilu/a5d1305baf4bd3942a56c6b428790b88 to your computer and use it in GitHub Desktop.
Save michilu/a5d1305baf4bd3942a56c6b428790b88 to your computer and use it in GitHub Desktop.
import 'dart:async';
void main() async {
print(await f1(["hello"]));
}
Future<List<String>> f0(List<String> v) {
return Future.value(v);
}
Future<List<String>> f1(List<String> v) {
final Completer c = Completer();
final f = f0(v);
f.then(c.complete);
return c.future.then((v) {
return List<String>.from(v);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment