Last updated:
0 purchases
future ext
ControllableFuture #
Cancel the Future
final controllable = ControllableFuture(() async {
/// some asynchronous code here,
}, onCancel: () {
// return an alternate value
});
// to wait
await controllable.future;
// to cancel
controllable.cancel();
copied to clipboard
Why not CancelableOperaion in package:async ? #
It does not step out of the Future on cancellation. It just ignores the Future.
But this package actually cancels it.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.