PageTransitionsBuilder class abstract
Defines a page transition animation for a PageRoute.
PageTransitionsBuilder can be used directly with widget layer primitives in any design system. Custom PageRoute subclasses can accept a PageTransitionsBuilder and delegate to its buildTransitions method when overriding ModalRoute.buildTransitions. This enables reusable transition animations that work with Navigator and other navigation primitives.
Example usage
To create a local project with this code sample, run:
flutter create --sample=widgets.PageTransitionsBuilder.1 mysample
As an example of usage, in the Material library this class is used by PageTransitionsTheme to define a MaterialPageRoute page transition animation. Apps can configure the map of builders for ThemeData.pageTransitionsTheme to customize the default MaterialPageRoute page transition animation for different platforms.
See also:
- PageTransitionsTheme, which uses this class to configure page transitions.
- MaterialPageRoute, which uses this class to build its transition.
- FadeUpwardsPageTransitionsBuilder, which defines a page transition that's similar to the one provided by Android O.
- OpenUpwardsPageTransitionsBuilder, which defines a page transition that's similar to the one provided by Android P.
- ZoomPageTransitionsBuilder, which defines the default page transition that's similar to the one provided in Android Q.
- CupertinoPageTransitionsBuilder, which defines a horizontal page transition that matches native iOS page transitions.
- FadeForwardsPageTransitionsBuilder, which defines a page transition that's similar to the one provided by Android U.
Constructors
- PageTransitionsBuilder.new()
-
Abstract const constructor. This constructor enables subclasses to provide
const constructors so that they can be used in const expressions.
const
Properties
- delegatedTransition → DelegatedTransitionBuilder?
-
Provides a secondary transition to the previous route.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- reverseTransitionDuration → Duration
-
The duration the transition going in reverse.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transitionDuration → Duration
-
The duration the transition going forwards.
no setter
Methods
-
buildTransitions<
T> (PageRoute< T> route, BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) → Widget -
Wraps the child with one or more transition widgets which define how
routearrives on and leaves the screen. -
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