Created with <3 with dartpad.dev.
Created
September 25, 2023 06:11
-
-
Save maks/21314f3d51d37753f3eaa901075367f2 to your computer and use it in GitHub Desktop.
reverberating-oak-9145
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:math"; | |
// Example of use Dart's "late final" lazily initialised cached async value | |
void main() async { | |
late final Future<int> magicNumber = Future.value(Random().nextInt(100)); | |
print("1. magic number:${await magicNumber}"); | |
print("2. magic number:${await magicNumber}"); | |
print("3. magic number:${await magicNumber}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment