pageRoute<T> method
PageRoute<T>
pageRoute<T>({
- WidgetBuilder? builder,
- Widget? widget,
- bool maintainState = true,
- bool fullscreenDialog = false,
- String? title,
- RouteSettings? settings,
Builds the primary contents of the route.
Implementation
PageRoute<T> pageRoute<T>(
{WidgetBuilder? builder,
Widget? widget,
bool maintainState = true,
bool fullscreenDialog = false,
String? title,
RouteSettings? settings}) {
assert(widget != null || builder != null);
switch (this) {
case RoutePushStyle.cupertino:
return CupertinoPageRoute<T>(
title: title,
settings: settings,
maintainState: maintainState,
fullscreenDialog: fullscreenDialog,
builder: builder ?? widget!.toWidgetBuilder);
case RoutePushStyle.material:
return MaterialPageRoute<T>(
settings: settings,
maintainState: maintainState,
fullscreenDialog: fullscreenDialog,
builder: builder ?? widget!.toWidgetBuilder);
}
}