Skip to content

Instantly share code, notes, and snippets.

@rrousselGit
Last active October 6, 2021 17:02
Show Gist options
  • Save rrousselGit/15f7d2060849da96839f5dabdfba6d62 to your computer and use it in GitHub Desktop.
Save rrousselGit/15f7d2060849da96839f5dabdfba6d62 to your computer and use it in GitHub Desktop.
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