show method

This method is used to display the progress dialog.

This method returns Future<AdaptiveProgressDialogResult<T?>>.

The method can be awaited to get the dialog result data.

Possible states are:

Implementation

Future<AdaptiveProgressDialogResult<T?>> show(BuildContext context) async {
  final result = await showDialog<AdaptiveProgressDialogResult<T?>>(
    context: context,
    barrierDismissible: isDismissible,
    builder: (context) => ProgressDialog(
      title: title,
      content: content,
      confirmationButtonLabel: confirmationButtonLabel,
      cancelButtonLabel: cancelButtonLabel,
      confirmButtonCallback: confirmButtonCallback,
      adaptiveProgressDialogStyle: adaptiveProgressDialogStyle,
    ),
  );

  if (result == null) return AdaptiveProgressDialogResult.closed();
  return result;
}