openModal method
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,
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);
}
}