pushAndRemoveUntil static method
Implementation
static void pushAndRemoveUntil(
ParentAnimation animation, bool Function(Route<dynamic>) predicate) {
switch (animation) {
case FadeScaleAnimation anim:
Navigator.pushAndRemoveUntil(
anim.context,
FadeScalePageRoute(
nextPage: anim.nextPage,
currentPage: anim.context.widget,
initialScale: anim.initialScale,
animationDuration: anim.duration,
),
predicate,
);
break;
case FlipAnimation anim:
Navigator.pushAndRemoveUntil(
anim.context,
FlipPageRoute(
nextPage: anim.nextPage,
currentPage: anim.context.widget,
animationDuration: anim.duration,
axis: anim.axis,
fadeIn: anim.fadeIn,
forward: anim.forward,
),
predicate,
);
break;
case FlyInAnimation anim:
Navigator.pushAndRemoveUntil(
anim.context,
FlyInPageRoute(
nextPage: animation.nextPage,
currentPage: animation.context.widget,
animationDuration: animation.duration,
axis: anim.axis,
inclination: anim.inclination,
fadeIn: anim.fadeIn,
forward: anim.forward,
),
predicate,
);
break;
case SlideAnimation anim:
Navigator.pushAndRemoveUntil(
anim.context,
SlidePageRoute(
nextPage: anim.nextPage,
currentPage: anim.context.widget,
animationDuration: anim.duration,
direction: anim.direction,
),
predicate,
);
break;
case RotateAnimation anim:
Navigator.pushAndRemoveUntil(
anim.context,
RotatePageRoute(
nextPage: anim.nextPage,
currentPage: anim.context.widget,
animationDuration: anim.duration,
numberOfRotations: anim.numberOfRotations,
clockwise: anim.clockwise,
),
predicate,
);
break;
case SwirlAnimation anim:
Navigator.pushAndRemoveUntil(
anim.context,
SwirlPageRoute(
nextPage: anim.nextPage,
currentPage: anim.context.widget,
animationDuration: anim.duration,
numberOfHalfRotations: anim.numberOfHalfRotations,
forward: anim.forward,
axis: anim.axis,
),
predicate,
);
break;
case CornerAnimation anim:
Navigator.pushAndRemoveUntil(
anim.context,
CornerPageRoute(
nextPage: anim.nextPage,
currentPage: anim.context.widget,
animationDuration: anim.duration,
corner: anim.corner,
),
predicate,
);
break;
}
}