FadeThroughPageTransitionsBuilder class
Material 3's fade through transition, as between the destinations of a navigation bar: the outgoing page fades out, and the new one fades in while growing slightly, with no overlap between the two.
Use it for pages that are not related to each other; for pages that are
steps along an axis, use SharedAxisPageTransitionsBuilder instead.
Apply it to every route through the theme:
MaterialApp(
theme: ThemeData(
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: FadeThroughPageTransitionsBuilder(),
TargetPlatform.iOS: FadeThroughPageTransitionsBuilder(),
},
),
),
)
or to a single push with FadeThroughPageRoute.
The iOS-style edge swipe back is kept (see swipeBackEnabled), and is disabled while a PopScope blocks popping.
- Inheritance
-
- Object
- PageTransitionsBuilder
- FadeThroughPageTransitionsBuilder
- Annotations
Constructors
- FadeThroughPageTransitionsBuilder({Duration duration = const Duration(milliseconds: 300), Duration? reverseDuration, Curve curve = Curves.easeInOutCubicEmphasized, double enterScale = 0.92, Color? fillColor, bool swipeBackEnabled = true})
-
Creates a fade through page transition. The defaults match Material 3.
const
Properties
- curve → Curve
-
The easing of the scale. The cross-fade is linear, as in Material 3.
final
- delegatedTransition → DelegatedTransitionBuilder?
-
Provides a secondary transition to the previous route.
no setteroverride
- duration → Duration
-
How long a push takes.
final
- enterScale → double
-
The scale the incoming page starts at.
final
- fillColor → Color?
-
Painted behind the pages while they cross-fade. Defaults to the theme's
ThemeData.scaffoldBackgroundColor.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- reverseDuration → Duration?
-
How long a pop takes. Defaults to duration.
final
- reverseTransitionDuration → Duration
-
The duration the transition going in reverse.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- swipeBackEnabled → bool
-
Whether the route can be popped by dragging from its leading edge.
final
- transitionDuration → Duration
-
The duration the transition going forwards.
no setteroverride
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.override -
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.
override