MaterialPage<T> class

A page that creates a material style PageRoute.

For Android, the entrance transition for the page zooms in and fades in while the exiting page zooms out and fades out. The exit transition is similar, but in reverse.

For iOS, the page slides in from the right and exits in reverse. The page also shifts to the left in parallax when another page enters to cover it. (These directions are flipped in environments with a right-to-left reading direction.)

By default, when the created route is replaced by another, the previous route remains in memory. To free all the resources when this is not necessary, set maintainState to false.

The fullscreenDialog property specifies whether the created route is a fullscreen modal dialog. On iOS, those routes animate from the bottom to the top rather than horizontally.

The type T specifies the return type of the route which can be supplied as the route is popped from the stack via Navigator.transitionDelegate by providing the optional result argument to the RouteTransitionRecord.markForPop in the TransitionDelegate.resolve.

See also:

Inheritance

Constructors

MaterialPage({required Widget child, bool maintainState = true, bool fullscreenDialog = false, bool allowSnapshotting = true, LocalKey? key, bool canPop = true, PopInvokedWithResultCallback<T> onPopInvoked = _defaultPopInvokedHandler, String? name, Object? arguments, String? restorationId})
Creates a material page.
const

Properties

allowSnapshotting bool
Whether the route transition will prefer to animate a snapshot of the entering/exiting routes.
final
arguments Object?
The arguments passed to this route.
finalinherited
canPop bool
When false, blocks the associated route from being popped.
finalinherited
child Widget
The content to be shown in the Route created by this page.
final
fullscreenDialog bool
Whether this page route is a full-screen dialog.
final
hashCode int
The hash code for this object.
no setterinherited
key LocalKey?
The key associated with this page.
finalinherited
maintainState bool
Whether the route should remain in memory when it is inactive.
final
name String?
The name of the route (e.g., "/settings").
finalinherited
onPopInvoked PopInvokedWithResultCallback<T>
Called after a pop on the associated route was handled.
finalinherited
restorationId String?
Restoration ID to save and restore the state of the Route configured by this page.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

canUpdate(Page other) bool
Whether this page can be updated with the other page.
inherited
createRoute(BuildContext context) Route<T>
Creates the Route that corresponds to this page.
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.
inherited