pushModal<T> method

Future<T?> pushModal<T>({
  1. required Widget modal,
  2. PageTransition transition = const PageSlideTransition(),
})

Implementation

Future<T?> pushModal<T>({
  required Widget modal,
  PageTransition transition = const PageSlideTransition(),
}) {
  final info = ModalRouteInfo(
    path: "",
    page: modal.runtimeType,
    useRootNavigator: true,
    transition: transition,
  );

  final page = _pageFromRouteInfo<T>(info, modal);

  _stack.add(page);

  notifyListeners();

  return page.popped;
}