pub struct AutomaticKeepAlive {
pub key: Option<KeyRef>,
pub child: WidgetRef,
}Expand description
Allows subtrees to request to be kept alive in lazy lists.
This widget is like KeepAlive but instead of being explicitly configured,
it listens to KeepAliveNotification messages from the child and other
descendants.
The subtree is kept alive whenever there is one or more descendant that has
sent a KeepAliveNotification and not yet triggered its
KeepAliveNotification::handle.
To send these notifications, consider using AutomaticKeepAliveClientMixin.
See also:
AutomaticKeepAliveClientMixin, which is a mixin with convenience methods for clients ofAutomaticKeepAlive. Used withStatesubclasses.KeepAlivewhich marks a child as needing to stay alive even when it’s in a lazy list that would otherwise remove it.
Fields§
§key: Option<KeyRef>See Widget::key.
child: WidgetRefThe widget below this widget in the tree.
Implementations§
Source§impl AutomaticKeepAlive
impl AutomaticKeepAlive
Sourcepub fn new<K>(child: impl IntoWidget<K>) -> AutomaticKeepAlive
pub fn new<K>(child: impl IntoWidget<K>) -> AutomaticKeepAlive
Creates a widget that listens to KeepAliveNotifications and maintains a
KeepAlive widget appropriately.
Sourcepub fn key(self, key: KeyRef) -> AutomaticKeepAlive
pub fn key(self, key: KeyRef) -> AutomaticKeepAlive
Dart AutomaticKeepAlive(key:).
Trait Implementations§
Source§impl Debug for AutomaticKeepAlive
impl Debug for AutomaticKeepAlive
Source§impl StatefulWidget for AutomaticKeepAlive
impl StatefulWidget for AutomaticKeepAlive
Source§type State = AutomaticKeepAliveState
type State = AutomaticKeepAliveState
The state this widget creates.
Source§fn create_state(&self) -> AutomaticKeepAliveState
fn create_state(&self) -> AutomaticKeepAliveState
Creates the mutable state for this widget at a given location in the tree. Read more
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
Dart’s
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_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
See
Widget::type_name. A stateful form another widget kind becomes (an animated or
status transition widget) names the widget it wraps.Auto Trait Implementations§
impl !RefUnwindSafe for AutomaticKeepAlive
impl !Send for AutomaticKeepAlive
impl !Sync for AutomaticKeepAlive
impl !UnwindSafe for AutomaticKeepAlive
impl Forget for AutomaticKeepAlive
impl Freeze for AutomaticKeepAlive
impl Move for AutomaticKeepAlive
impl Unpin for AutomaticKeepAlive
impl UnsafeUnpin for AutomaticKeepAlivewhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: 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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
The widget as a tree node, made where this is called: its
creation_location.