Skip to content

Instantly share code, notes, and snippets.

@rrousselGit
Created October 14, 2020 13:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rrousselGit/5549f829dd9e105628e2bf5b2ebc9ce4 to your computer and use it in GitHub Desktop.
Save rrousselGit/5549f829dd9e105628e2bf5b2ebc9ce4 to your computer and use it in GitHub Desktop.
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
Future<void> asyncFunction() async {
print('a');
await Future.value();
print('b');
}
Stream<void> asyncGenerator() async* {
print('c');
}
void main() {
runApp(Container());
asyncFunction();
asyncGenerator().listen((_) {});
WidgetsBinding.instance.addPostFrameCallback((_) => print('d'));
Future(() => print('e'));
Future(() {}).then((_) => print('f'));
Future.sync(() => print('g'));
Future.sync(() {}).then((_) => print('h'));
Future.value().then((_) => print('i'));
Future.microtask(() => print('j'));
Future.microtask(() {}).then((_) => print('k'));
WidgetsBinding.instance.addPostFrameCallback((_) => print('l'));
print('m');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment