Skip to content

Instantly share code, notes, and snippets.

@maks
Created September 25, 2023 06:11
Show Gist options
  • Save maks/21314f3d51d37753f3eaa901075367f2 to your computer and use it in GitHub Desktop.
Save maks/21314f3d51d37753f3eaa901075367f2 to your computer and use it in GitHub Desktop.
reverberating-oak-9145

reverberating-oak-9145

Created with <3 with dartpad.dev.

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