Page<T> class abstract

Describes the configuration of a Route.

The type argument T is the corresponding Route's return type, as used by Route.currentResult, Route.popped, and Route.didPop.

The canPop and onPopInvoked are used for intercepting pops.

This sample demonstrates how to use this canPop and onPopInvoked to intercept pops.
link

To create a local project with this code sample, run:
flutter create --sample=widgets.Page.1 mysample

See also:

Inheritance
Implementers

Constructors

Page({LocalKey? key, String? name, Object? arguments, String? restorationId, bool canPop = true, PopInvokedWithResultCallback<T> onPopInvoked = _defaultPopInvokedHandler})
Creates a page and initializes key for subclasses.
const

Properties

arguments Object?
The arguments passed to this route.
finalinherited
canPop bool
When false, blocks the associated route from being popped.
final
hashCode int
The hash code for this object.
no setterinherited
key LocalKey?
The key associated with this page.
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.
final
restorationId String?
Restoration ID to save and restore the state of the Route configured by this page.
final
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.
createRoute(BuildContext context) Route<T>
Creates the Route that corresponds to this page.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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