closeModalAsync method
Async version of closeModal — await it before navigating further to guarantee the router has already updated.
Implementation
Future<void> closeModalAsync(String modalId, {BuildContext? context}) async {
final router = context != null ? GoRouter.of(context) : _getRouter();
await NavigationUtils.closeModalAsync(router, modalId);
}