materialRoute static method
创建PageRoute pushAnimated 是否有进场动画 popAnimated 是否有退场动画
Implementation
static PageRoute materialRoute(
{String? routeName,
Map? params,
bool pushAnimated = true,
bool popAnimated = true,
bool maintainState = true,
bool fullscreenDialog = false,
WidgetBuilder? builder}) {
RouteSettings userSettings =
RouteSettings(name: routeName, arguments: params);
if (builder == null) {
DStackWidgetBuilder stackWidgetBuilder =
DStack.instance.pageBuilder(routeName);
builder = stackWidgetBuilder(params);
}
DStackPageRouteBuilder route = DStackPageRouteBuilder(
pageBuilder: builder,
settings: userSettings,
maintainState: maintainState,
fullscreenDialog: fullscreenDialog,
pushTransition: pushAnimated ? defaultPushDuration : Duration.zero,
popTransition: popAnimated ? defaultPopDuration : Duration.zero,
);
return route;
}