pub struct MaterialPage {
pub key: Option<KeyRef>,
pub can_pop: bool,
pub on_pop_invoked: Option<PopInvokedWithResultCallback>,
pub name: Option<String>,
pub arguments: Option<Rc<dyn Any>>,
pub restoration_id: Option<String>,
pub child: WidgetRef,
pub maintain_state: bool,
pub fullscreen_dialog: bool,
pub allow_snapshotting: bool,
pub include_route_semantics: bool,
}Expand description
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
maintain_state to false.
The fullscreen_dialog 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.
See also:
MaterialPageRoute, which is thePageRouteversion of this class
Fields§
§key: Option<KeyRef>See Page::key.
can_pop: boolSee Page::can_pop.
on_pop_invoked: Option<PopInvokedWithResultCallback>See Page::on_pop_invoked.
name: Option<String>See Page::name.
arguments: Option<Rc<dyn Any>>See Page::arguments.
restoration_id: Option<String>See Page::restoration_id.
child: WidgetRefThe content to be shown in the Route created by this page.
maintain_state: boolWhether the route should remain in memory when it is inactive.
fullscreen_dialog: boolWhether this page route is a full-screen dialog.
allow_snapshotting: boolWhether the route transition will prefer to animate a snapshot of the entering and exiting routes.
include_route_semantics: boolWhether the route introduces a route scope in the semantics tree; see
MaterialRouteTransitionMixin::include_route_semantics.
Implementations§
Source§impl MaterialPage
impl MaterialPage
Sourcepub fn new<K>(child: impl IntoWidget<K>) -> MaterialPage
pub fn new<K>(child: impl IntoWidget<K>) -> MaterialPage
Creates a material page; Dart’s optional arguments are the setters.
Dart’s defaults: maintain_state true, fullscreen_dialog false, allow_snapshotting
true, include_route_semantics true, can_pop true.
Sourcepub fn maintain_state(self, maintain_state: bool) -> MaterialPage
pub fn maintain_state(self, maintain_state: bool) -> MaterialPage
Dart MaterialPage(maintainState:).
Sourcepub fn fullscreen_dialog(self, fullscreen_dialog: bool) -> MaterialPage
pub fn fullscreen_dialog(self, fullscreen_dialog: bool) -> MaterialPage
Dart MaterialPage(fullscreenDialog:).
Sourcepub fn allow_snapshotting(self, allow_snapshotting: bool) -> MaterialPage
pub fn allow_snapshotting(self, allow_snapshotting: bool) -> MaterialPage
Dart MaterialPage(allowSnapshotting:).
Sourcepub fn include_route_semantics(
self,
include_route_semantics: bool,
) -> MaterialPage
pub fn include_route_semantics( self, include_route_semantics: bool, ) -> MaterialPage
Dart MaterialPage(includeRouteSemantics:).
Sourcepub fn key(self, key: KeyRef) -> MaterialPage
pub fn key(self, key: KeyRef) -> MaterialPage
Dart MaterialPage(key:).
Sourcepub fn can_pop(self, can_pop: bool) -> MaterialPage
pub fn can_pop(self, can_pop: bool) -> MaterialPage
Dart MaterialPage(canPop:).
Sourcepub fn on_pop_invoked(
self,
on_pop_invoked: PopInvokedWithResultCallback,
) -> MaterialPage
pub fn on_pop_invoked( self, on_pop_invoked: PopInvokedWithResultCallback, ) -> MaterialPage
Dart MaterialPage(onPopInvoked:).
Sourcepub fn name(self, name: String) -> MaterialPage
pub fn name(self, name: String) -> MaterialPage
Dart MaterialPage(name:).
Sourcepub fn arguments(self, arguments: Rc<dyn Any>) -> MaterialPage
pub fn arguments(self, arguments: Rc<dyn Any>) -> MaterialPage
Dart MaterialPage(arguments:).
Sourcepub fn restoration_id(self, restoration_id: String) -> MaterialPage
pub fn restoration_id(self, restoration_id: String) -> MaterialPage
Dart MaterialPage(restorationId:).
Trait Implementations§
Source§impl Clone for MaterialPage
impl Clone for MaterialPage
Source§impl Debug for MaterialPage
impl Debug for MaterialPage
Source§impl Page for MaterialPage
impl Page for MaterialPage
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
runtimeType in can_update.