Last active
October 6, 2021 17:02
-
-
Save rrousselGit/15f7d2060849da96839f5dabdfba6d62 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 'package:flutter/foundation.dart'; | |
void main() { | |
print('start'); | |
awaitFn(); | |
thenFn(); | |
print('end'); | |
} | |
Future<void> awaitFn() async { | |
print('awaitFn start'); | |
await SynchronousFuture(42); | |
print('awaitFn end'); | |
} | |
Future<void> thenFn() { | |
print('thenFn start'); | |
return SynchronousFuture(42).then((value) { | |
print('thenFn end'); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment