pageRoute<T> method

PageRoute<T> pageRoute<T>({
  1. WidgetBuilder? builder,
  2. Widget? widget,
  3. bool maintainState = true,
  4. bool fullscreenDialog = false,
  5. String? title,
  6. 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);
  }
}