Skip to content

Instantly share code, notes, and snippets.

@kikuchy
Created April 5, 2019 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kikuchy/bb4c335d7eb55b6bdfd9686930f424ea to your computer and use it in GitHub Desktop.
Save kikuchy/bb4c335d7eb55b6bdfd9686930f424ea to your computer and use it in GitHub Desktop.
When Completable#isCompleted will be true if you give running Future to Completable#complete?
import "dart:async";
void main() async {
final job = Future.delayed(Duration(seconds: 2), () => print("ended"));
final completer = Completer()..complete(job);
print(completer.isCompleted); // fal....true!?!?!?
await job;
print(completer.isCompleted); // true, of course.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment