CustomNavigator class

A utility class that provides static methods for navigating between pages with custom transitions. This class is used to encapsulate the logic for pushing pages with various transition animations, making it easier to apply consistent transitions throughout the application.

Constructors

CustomNavigator()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

push(ParentAnimation animation) → void
Constructs a Navigator object that pushes a new page onto the navigation stack with a custom transition animation. The animation parameter is an instance of a ParentAnimation class that defines the animation to be used. The animation parameter can be any of the following types:
pushAndRemoveUntil(ParentAnimation animation, bool predicate(Route)) → void
Constructs a Navigator object that pushes a new page onto the navigation stack with a custom transition animation and removes all pages from the navigation stack until the predicate returns true. The animation parameter is an instance of a ParentAnimation class that defines the animation to be used. The animation parameter can be any of the following types:
pushCorner({required BuildContext context, Corner corner = Corner.bottomLeft, required Widget nextPage, Duration duration = const Duration(milliseconds: 500)}) → void
Pushes a new page onto the navigation stack with a corner transition animation. The context parameter is the context of the current page. The nextPage parameter is the widget that will be displayed on the new page. The corner parameter specifies the corner of the screen where the new page will appear, with a default of Corner.bottomLeft. The duration parameter specifies the duration of the animation, with a default of 500 milliseconds.
pushFadeScale({required BuildContext context, required Widget nextPage, Duration duration = const Duration(milliseconds: 500), double initialScale = 0.0}) → void
Pushes a new page onto the navigation stack with a fade and scale transition animation. The context parameter is the context of the current page. The nextPage parameter is the widget that will be displayed on the new page. The duration parameter specifies the duration of the animation, with a default of 500 milliseconds. The initialScale parameter specifies the initial scale of the page being pushed, with a default of 0.0.
pushFlip({required BuildContext context, required Widget nextPage, Duration duration = const Duration(milliseconds: 500), AxisDirection axis = AxisDirection.left, bool fadeIn = true, bool forward = false}) → void
Pushes a new page onto the navigation stack with a flip transition animation. The context parameter is the context of the current page. The nextPage parameter is the widget that will be displayed on the new page. The duration parameter specifies the duration of the animation, with a default of 500 milliseconds. The axis parameter specifies the axis along which the flip animation should occur, with a default of AxisDirection.left. The fadeIn parameter determines whether the next page should fade in or not, with a default of true. The forward parameter determines whether the flip animation should go from left to right (true) or right to left (false), with a default of false.
pushFlyin({required BuildContext context, required Widget nextPage, Duration duration = const Duration(milliseconds: 500), AxisDirection axis = AxisDirection.left, AxisDirection inclination = AxisDirection.up, bool fadeIn = true, bool forward = false}) → void
Pushes a new page onto the navigation stack with a fly-in transition animation. The context parameter is the context of the current page. The nextPage parameter is the widget that will be displayed on the new page. The duration parameter specifies the duration of the animation, with a default of 500 milliseconds. The axis parameter specifies the axis along which the fly-in animation should occur, with a default of AxisDirection.left. The inclination parameter specifies the axis along which the fly-in animation should be inclined, with a default of AxisDirection.up. The fadeIn parameter determines whether the next page should fade in or not, with a default of true. The forward parameter determines whether the fly-in animation should go from left to right (true) or right to left (false), with a default of false.
pushReplacement(ParentAnimation animation) → void
Constructs a Navigator object that pushes a new page onto the navigation stack with a custom transition animation and replaces the current page. The animation parameter is an instance of a ParentAnimation class that defines the animation to be used. The animation parameter can be any of the following types:
pushRotate({required BuildContext context, required Widget nextPage, Duration duration = const Duration(milliseconds: 500), int numberOfTurns = 1, bool clockwise = true}) → void
Pushes a new page onto the navigation stack with a rotate transition animation. The context parameter is the context of the current page. The nextPage parameter is the widget that will be displayed on the new page. The duration parameter specifies the duration of the animation, with a default of 500 milliseconds. The numberOfTurns parameter specifies the number of half rotations the animation will make, with a default of 1. The clockwise parameter specifies the direction of rotation, with true meaning clockwise and false meaning counterclockwise.
pushSlide({required BuildContext context, required Widget nextPage, AxisDirection direction = AxisDirection.left, Duration duration = const Duration(milliseconds: 500)}) → void
Pushes a new page onto the navigation stack with a slide transition animation. The context parameter is the context of the current page. The nextPage parameter is the widget that will be displayed on the new page. The direction parameter specifies the direction of the slide animation, with a default of AxisDirection.left. The duration parameter specifies the duration of the animation, with a default of 500 milliseconds.
pushSwirl({required BuildContext context, required Widget nextPage, Duration duration = const Duration(milliseconds: 500), int numHalfRotations = 1, bool forward = true, Axis axis = Axis.vertical}) → void
Pushes a new page onto the navigation stack with a swirl transition animation. The context parameter is the context of the current page. The nextPage parameter is the widget that will be displayed on the new page. The duration parameter specifies the duration of the animation, with a default of 500 milliseconds. The numHalfRotations parameter specifies the number of half rotations the swirl animation should make, with a default of 1. The forward parameter determines the direction of the swirl animation, with true meaning the swirl goes outward and false meaning it goes inward. The axis parameter specifies the axis along which the swirl animation should occur, with a default of Axis.vertical.