We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f7dce6 commit 9444a58Copy full SHA for 9444a58
lib/src/application/components/task.dart
@@ -148,10 +148,9 @@ final class StepTask<T> {
148
StepTask(this._message, this._callback);
149
150
Future<T> _start() async {
151
- if (_callback case Future<void> Function() callback) {
152
- callback().then((value) {
153
- _completer.complete(value as T);
154
- });
+ if (_callback case FutureOr<T> Function() callback) {
+ final value = await callback();
+ _completer.complete(value);
155
} else {
156
await Future.delayed(Duration(milliseconds: 100), _completer.complete);
157
}
0 commit comments