openModal method

Future<R?> openModal(
  1. BuildContext context, {
  2. bool useScaffold = true,
  3. P? args,
  4. ModalArgsBuilder<P>? argsBuilder,
  5. bool expand = true,
  6. bool showHandle = true,
  7. bool dismissible = true,
  8. String? label,
  9. bool replace = false,
  10. double? height,
  11. double? width,
  12. Constraints? constraints,
  13. bool nestModals = false,
  14. bool useRootNavigator = true,
})

Implementation

Future<R?> openModal(
  BuildContext context, {
  bool useScaffold = true,
  P? args,
  ModalArgsBuilder<P>? argsBuilder,
  bool expand = true,
  bool showHandle = true,
  bool dismissible = true,
  String? label,
  bool replace = false,
  double? height,
  double? width,
  Constraints? constraints,
  bool nestModals = false,
  bool useRootNavigator = true,
}) async {
  final _args = args ?? argsBuilder?.call(null);
  if (this is AppPageRoute<R, P>) {
    final ar = this as AppPageRoute<R, P>;
    return await Modals.open<R>(
      context,
      useScaffold: useScaffold,
      displayDragHandle: showHandle,
      dismissible: dismissible,
      draggable: dismissible,
      nestModals: nestModals,
      height: height,
      width: width,
      useRootNavigator: useRootNavigator,
      expand: expand,
      settings: PathRouteSettings.ofAppRoute(ar, routeParams: _args),
      constraints: constraints,
      builder: memoizeScrollBuild(
        (context) {
          final _args = args ?? argsBuilder?.call(null);
          return ar.handleAny(context, _args);
        },
      ),
    );
  } else {
    return await go(context, args: _args);
  }
}