animationPage static method

Future animationPage(
  1. String routeName,
  2. PageType pageType,
  3. AnimatedPageBuilder animatedBuilder, [
  4. Map? params,
  5. Duration? transitionDuration = defaultPushDuration,
  6. bool opaque = true,
  7. bool barrierDismissible = false,
  8. Color? barrierColor,
  9. String? barrierLabel,
  10. bool maintainState = true,
  11. bool fullscreenDialog = false,
  12. 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);
  }
}