diff --git a/lib/src/async_memoizer.dart b/lib/src/async_memoizer.dart index c05c927..90ccfdb 100644 --- a/lib/src/async_memoizer.dart +++ b/lib/src/async_memoizer.dart @@ -40,7 +40,7 @@ class AsyncMemoizer { /// /// If [runOnce] has already been called, this returns the original result. Future runOnce(FutureOr Function() computation) { - if (!hasRun) _completer.complete(Future.sync(computation)); + if (!hasRun) _completer.complete(Future.sync(computation)); return future; } } diff --git a/lib/src/cancelable_operation.dart b/lib/src/cancelable_operation.dart index 0fc7f5d..4228602 100644 --- a/lib/src/cancelable_operation.dart +++ b/lib/src/cancelable_operation.dart @@ -105,9 +105,9 @@ class CancelableOperation { valueOrCancellation().then((T result) { if (!completer.isCanceled) { if (isCompleted) { - completer.complete(Future.sync(() => onValue(result))); + completer.complete(Future.sync(() => onValue(result))); } else if (onCancel != null) { - completer.complete(Future.sync(onCancel)); + completer.complete(Future.sync(onCancel)); } else { completer._cancel(); } @@ -115,7 +115,7 @@ class CancelableOperation { }, onError: (Object error, StackTrace stackTrace) { if (!completer.isCanceled) { if (onError != null) { - completer.complete(Future.sync(() => onError(error, stackTrace))); + completer.complete(Future.sync(() => onError(error, stackTrace))); } else { completer.completeError(error, stackTrace); }