Created
October 21, 2024 12:57
-
-
Save tejainece/423385a87c4499d49c0b625d0f89bc34 to your computer and use it in GitHub Desktop.
Does waiting the same future multiple times succeed and give same value?
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'; | |
Future<void> main() async { | |
final completer = Completer<bool>(); | |
final future = completer.future; | |
completer.complete(true); | |
print(await future); | |
print(await future); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment