Created
October 14, 2020 13:04
-
-
Save rrousselGit/5549f829dd9e105628e2bf5b2ebc9ce4 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
// 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