animationPage static method
Future
animationPage(
- String routeName,
- PageType pageType,
- AnimatedPageBuilder animatedBuilder, [
- Map? params,
- Duration? transitionDuration = defaultPushDuration,
- bool opaque = true,
- bool barrierDismissible = false,
- Color? barrierColor,
- String? barrierLabel,
- bool maintainState = true,
- bool fullscreenDialog = false,
- bool replace = false,
自定义进场方式
Implementation
static Future animationPage(
String routeName,
PageType pageType,
AnimatedPageBuilder animatedBuilder, [
Map? params,
Duration? transitionDuration = defaultPushDuration,
bool opaque = true,
bool barrierDismissible = false,
Color? barrierColor,
String? barrierLabel,
bool maintainState = true,
bool fullscreenDialog = false,
bool replace = false,
]) {
if (pageType == PageType.flutter) {
PageRouteBuilder route = DNavigatorManager.animationRoute(
animatedBuilder: animatedBuilder,
routeName: routeName,
params: params,
transitionDuration: transitionDuration!,
opaque: opaque,
barrierDismissible: barrierDismissible,
barrierColor: barrierColor,
barrierLabel: barrierLabel,
maintainState: maintainState,
fullscreenDialog: fullscreenDialog,
);
DNavigatorManager.nodeHandle(routeName, pageType, DStackConstant.push,
result: {}, route: route);
if (replace) {
return _navigator!.pushReplacement(route);
} else {
return _navigator!.push(route);
}
} else {
DNavigatorManager.nodeHandle(routeName, pageType, DStackConstant.push,
result: params);
return Future.value(true);
}
}