openModalAsync<T> method

Future<T?> openModalAsync<T>(
  1. String modalId, {
  2. BuildContext? context,
})

Opens modalId and returns a Future that completes with whatever closeModalWithResult passes when the modal closes (null otherwise).

Implementation

Future<T?> openModalAsync<T>(String modalId, {BuildContext? context}) {
  final ctx = context ?? this;
  final router = GoRouter.maybeOf(ctx) ?? _getRouter();
  final navigator = _getMultilevelNavigatorFromContext(ctx);
  return NavigationUtils.openModalAsync<T>(
    router,
    navigator.navigationStorage,
    modalId,
  );
}