showIndicator method
Show indicator and dialog.
Display an indicator if you are waiting for the task to end.
context
: Build context.
actionOnFinish
: Action after the task is finished.
Implementation
Future<T?> showIndicator(
BuildContext context, {
void Function(T? value)? actionOnFinish,
}) async {
await Future<void>.delayed(Duration.zero);
_UIFuture.show<T>(context, this, actionOnFinish: actionOnFinish);
final value = await this;
await Future<void>.delayed(Duration.zero);
return value;
}