pub struct UnmanagedRestorationScope {
pub key: Option<KeyRef>,
pub bucket: Option<Ref<RestorationBucket>>,
pub child: WidgetRef,
}Expand description
Inserts a provided RestorationBucket into the widget tree and makes it available to
descendants via RestorationScope::of.
A restoration scope inserts a RestorationBucket into the widget tree, which descendant
widgets can access via RestorationScope::of. It is uncommon for descendants to directly
store data in this bucket. Instead, descendant widgets should consider storing their own
restoration data in a child bucket claimed with RestorationBucket::claim_child from the
bucket provided by this scope.
If bucket is None, no restoration bucket is made available to descendant
widgets (RestorationScope::of invoked from a descendant will return None). This
effectively turns off state restoration for the subtree because no bucket for storing
restoration data is made available.
See also:
RestorationScope, which inserts a bucket obtained from a surrounding restoration scope into the widget tree and makes it accessible for descendants viaRestorationScope::of.RootRestorationScope, which inserts the root bucket provided by theRestorationManagerinto the widget tree and makes it accessible for descendants viaRestorationScope::of.RestorationMixin, which may be used inStateobjects to manage the restoration data of aStatefulWidgetinstead of manually interacting withRestorationScopes andRestorationBuckets.RestorationManager, which describes the basic concepts of state restoration.
Fields§
§key: Option<KeyRef>See InheritedWidget::key.
bucket: Option<Ref<RestorationBucket>>The RestorationBucket that this widget will insert into the widget tree.
Descendant widgets may obtain this bucket via RestorationScope::of.
child: WidgetRefThe widget below this widget in the tree.
Implementations§
Source§impl UnmanagedRestorationScope
impl UnmanagedRestorationScope
Sourcepub fn new<K>(child: impl IntoWidget<K>) -> UnmanagedRestorationScope
pub fn new<K>(child: impl IntoWidget<K>) -> UnmanagedRestorationScope
Creates an UnmanagedRestorationScope.
When bucket is None state restoration is turned off for the child
and its descendants.
Sourcepub fn key(self, key: KeyRef) -> UnmanagedRestorationScope
pub fn key(self, key: KeyRef) -> UnmanagedRestorationScope
Dart UnmanagedRestorationScope(key:).
Sourcepub fn bucket(
self,
bucket: Option<Ref<RestorationBucket>>,
) -> UnmanagedRestorationScope
pub fn bucket( self, bucket: Option<Ref<RestorationBucket>>, ) -> UnmanagedRestorationScope
Dart UnmanagedRestorationScope(bucket:); None turns off state restoration for the
subtree.
Trait Implementations§
Source§impl Debug for UnmanagedRestorationScope
impl Debug for UnmanagedRestorationScope
Source§impl InheritedWidget for UnmanagedRestorationScope
impl InheritedWidget for UnmanagedRestorationScope
Source§fn update_should_notify(&self, old_widget: &UnmanagedRestorationScope) -> bool
fn update_should_notify(&self, old_widget: &UnmanagedRestorationScope) -> bool
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
this is InheritedTheme: an inherited widget that is an InheritedTheme
answers with itself, which is what InheritedTheme::capture collects.Auto Trait Implementations§
impl !RefUnwindSafe for UnmanagedRestorationScope
impl !Send for UnmanagedRestorationScope
impl !Sync for UnmanagedRestorationScope
impl !UnwindSafe for UnmanagedRestorationScope
impl Forget for UnmanagedRestorationScope
impl Freeze for UnmanagedRestorationScopewhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
NonZero<u32>: Freeze,
PhantomData<fn() -> RestorationBucket>: Freeze,
*const RcInner<Keep> is !null: Freeze,
PhantomData<RcInner<Keep>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for UnmanagedRestorationScope
impl Unpin for UnmanagedRestorationScope
impl UnsafeUnpin for UnmanagedRestorationScopewhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
PhantomData<fn() -> RestorationBucket>: UnsafeUnpin,
*const RcInner<Keep> is !null: UnsafeUnpin,
PhantomData<RcInner<Keep>>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<W> IntoWidget<InheritedKind> for Wwhere
W: InheritedWidget,
impl<W> IntoWidget<InheritedKind> for Wwhere
W: InheritedWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.