Skip to content

Instantly share code, notes, and snippets.

View werediver's full-sized avatar
💭
🦀

Raman Fedaseyeu werediver

💭
🦀
View GitHub Profile
void main() async {
await variant1();
variant2();
print("xxx");
}
Future<void> variant1() async {
final result = await y();
// async gap
print("y: $result");
@werediver
werediver / main.dart
Last active November 1, 2022 14:00
Container types and the `map()` function in Dart
void main() {
print(f(true).map((value) => value + 1));
print(f(false).map((value) => value + 1));
print([1, 2, 3].map((value) => "x ${value + 1}"));
print([].map((value) => value + 1));
}
// Methods like
// map, flatMap / expand, filter / where, firstWhere, reduce, fold