Created
March 15, 2019 08:26
Revisions
-
dotdoom created this gist
Mar 15, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ import 'dart:async'; Future<void> b(value) async { await Future.delayed(Duration(seconds: 0)); // OR: remove the line ABOVE for fun effect. print('b(${value})'); } Future<void> a(value) async { print('a(${value})'); scheduleMicrotask(() => b(value)); // OR: replace scheduleMicrotask() with await b(value); return value + 1; } void main() { scheduleMicrotask(() => print('microtask1')); a(1).then(a).then(a); print('done'); scheduleMicrotask(() => print('microtask2')); }