Last active
August 27, 2018 09:59
-
-
Save michilu/a5d1305baf4bd3942a56c6b428790b88 to your computer and use it in GitHub Desktop.
This file contains 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
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