closeModalAsync static method

Future<void> closeModalAsync(
  1. GoRouter router,
  2. String modalId
)

Implementation

static Future<void> closeModalAsync(GoRouter router, String modalId) async {
  closeModal(router, modalId);
  // A microtask isn't enough — the widget tree only rebuilds after the
  // router update on the next frame, so wait for it explicitly.
  await WidgetsBinding.instance.endOfFrame;
}