Created
April 5, 2019 06:02
-
-
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?
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
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