Skip to content

Instantly share code, notes, and snippets.

View Mol0ko's full-sized avatar

Nikita Krasavin Mol0ko

View GitHub Profile
@Mol0ko
Mol0ko / main.dart
Created June 9, 2021 12:41
Future, async, await example
void main() async {
print('Fetching user profile...');
print(await fetchUserProfile());
}
Future<Map<String, dynamic>> fetchUserProfile() async {
await Future.delayed(Duration(seconds: 2));
return {'id': 12345, 'name': 'John'};
}