I'm trying to add an async callback to a model in a flutter application so the model can give the view an opportunity to show some dialog before the model continues on. However, I can't seem to find an async callback. I see VoidedCallback but I don't see anything like Callback<Future>.
Flutter has an async version of the VoidCallback typedef, namely AsyncCallback. See: https://api.flutter.dev/flutter/foundation/AsyncCallback.html
The VoidCallback is just a signature for method callback without parameters.
typedef VoidCallback = void Function();
You can create your own:
typedef FutureCallback = void Function(Future);
Or you can just use the final Function(Function) foo = yourcallback directly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With