Index: pkg/barback/lib/src/utils.dart |
diff --git a/pkg/barback/lib/src/utils.dart b/pkg/barback/lib/src/utils.dart |
index 9da4b0e71d74b0de28c6b678526195dfd72c5747..7529fa974d580e91bd4b23531d43b02e7552e40a 100644 |
--- a/pkg/barback/lib/src/utils.dart |
+++ b/pkg/barback/lib/src/utils.dart |
@@ -101,3 +101,6 @@ Future pumpEventQueue([int times=20]) { |
return new Future.delayed(Duration.ZERO, () => pumpEventQueue(times - 1)); |
} |
+/// Like [new Future], but avoids issue 11911 by using [new Future.value] under |
+/// the covers. |
+Future newFuture(callback()) => new Future.value().then((_) => callback()); |