pub struct RestorableTextEditingController { /* private fields */ }Expand description
A RestorableProperty that knows how to store and restore a
TextEditingController.
The TextEditingController is accessible via the value
getter. During state restoration, the property will restore
TextEditingController::text_value to the value it had when the restoration data it is
getting restored from was collected.
Implementations§
Source§impl RestorableTextEditingController
impl RestorableTextEditingController
Sourcepub fn new(app: &mut App) -> Ref<RestorableTextEditingController>
pub fn new(app: &mut App) -> Ref<RestorableTextEditingController>
Creates a RestorableTextEditingController.
This constructor treats a missing text argument as if it were the empty string.
Sourcepub fn text(
app: &mut App,
text: impl Into<String>,
) -> Ref<RestorableTextEditingController>
pub fn text( app: &mut App, text: impl Into<String>, ) -> Ref<RestorableTextEditingController>
Dart RestorableTextEditingController(text:).
Sourcepub fn from_value(
app: &mut App,
value: TextEditingValue,
) -> Ref<RestorableTextEditingController>
pub fn from_value( app: &mut App, value: TextEditingValue, ) -> Ref<RestorableTextEditingController>
Creates a RestorableTextEditingController from an initial TextEditingValue.
Trait Implementations§
Source§impl ChangeNotifier for RestorableTextEditingController
impl ChangeNotifier for RestorableTextEditingController
fn change_notifier_data(&self) -> &ChangeNotifierData
fn change_notifier_data_mut(&mut self) -> &mut ChangeNotifierData
Source§fn will_add_listener(self: Handle<Self>, app: &mut App)
fn will_add_listener(self: Handle<Self>, app: &mut App)
Runs before the listener is stored. Dart overrides of
addListener that
work before super.addListener go here.Source§fn did_remove_listener(self: Handle<Self>, app: &mut App)
fn did_remove_listener(self: Handle<Self>, app: &mut App)
Runs after the listener is removed. Dart overrides of
removeListener that
work after super.removeListener go here.Source§impl RestorableChangeNotifier for RestorableTextEditingController
impl RestorableChangeNotifier for RestorableTextEditingController
Source§fn dispose_value(
self: Handle<Self>,
app: &mut App,
value: Ref<TextEditingController>,
)
fn dispose_value( self: Handle<Self>, app: &mut App, value: Ref<TextEditingController>, )
Dart’s
_value!.dispose(): how the wrapped notifier is discarded.Source§fn init_with_value(self: Handle<Self>, app: &mut App, value: Self::Value)
fn init_with_value(self: Handle<Self>, app: &mut App, value: Self::Value)
Dart’s
RestorableChangeNotifier.initWithValue.Source§fn dispose_old_value(self: Handle<Self>, app: &mut App)
fn dispose_old_value(self: Handle<Self>, app: &mut App)
Dart’s
_disposeOldValue.Source§impl RestorableListenable for RestorableTextEditingController
impl RestorableListenable for RestorableTextEditingController
Source§fn restorable_listenable_data(
self: Handle<Self>,
app: &App,
) -> &RestorableListenableData<Self::Value>
fn restorable_listenable_data( self: Handle<Self>, app: &App, ) -> &RestorableListenableData<Self::Value>
Dart’s
RestorableListenable._value, held under the field listenable
(restorable_listenable_accessors!).Source§fn restorable_listenable_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut RestorableListenableData<Self::Value>
fn restorable_listenable_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut RestorableListenableData<Self::Value>
Source§fn value(self: Handle<Self>, app: &App) -> Self::Value
fn value(self: Handle<Self>, app: &App) -> Self::Value
The listenable stored in this property. Read more
Source§fn init_with_value(self: Handle<Self>, app: &mut App, value: Self::Value)
fn init_with_value(self: Handle<Self>, app: &mut App, value: Self::Value)
Dart’s
RestorableListenable.initWithValue: the old listenable is dropped and this
property listens to the new one.Source§fn notification_listener(self: Handle<Self>) -> Listener
fn notification_listener(self: Handle<Self>) -> Listener
Dart’s
notifyListeners tear-off: the listener this property keeps on its value.Source§fn forward_notification(self: Handle<Self>, app: &mut App)
fn forward_notification(self: Handle<Self>, app: &mut App)
The body behind
notification_listener.Source§impl RestorableProperty for RestorableTextEditingController
impl RestorableProperty for RestorableTextEditingController
Source§type Value = Retained<Handle<TextEditingController>>
type Value = Retained<Handle<TextEditingController>>
The object this property wraps; Dart’s type argument
T.Source§fn restorable_property_data(
self: Handle<Self>,
app: &App,
) -> &RestorablePropertyData
fn restorable_property_data( self: Handle<Self>, app: &App, ) -> &RestorablePropertyData
The registration with a
RestorationMixin, held under the field property
(restorable_property_accessors!).Source§fn restorable_property_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut RestorablePropertyData
fn restorable_property_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut RestorablePropertyData
Source§fn create_default_value(
self: Handle<Self>,
app: &mut App,
) -> Ref<TextEditingController>
fn create_default_value( self: Handle<Self>, app: &mut App, ) -> Ref<TextEditingController>
Called by the
RestorationMixin if no restoration data is available to restore the
value of the property from, to obtain the default value for the property. Read moreSource§fn from_primitives(
self: Handle<Self>,
app: &mut App,
data: &RestorationData,
) -> Ref<TextEditingController>
fn from_primitives( self: Handle<Self>, app: &mut App, data: &RestorationData, ) -> Ref<TextEditingController>
Called by the
RestorationMixin to convert the data previously retrieved from
to_primitives back into an object of type
Value that this property should wrap. Read moreSource§fn init_with_value(
self: Handle<Self>,
app: &mut App,
value: Ref<TextEditingController>,
)
fn init_with_value( self: Handle<Self>, app: &mut App, value: Ref<TextEditingController>, )
Called by the
RestorationMixin with the value returned by either
create_default_value or
from_primitives to set the value that this property currently
wraps. Read moreSource§fn to_primitives(self: Handle<Self>, app: &App) -> RestorationData
fn to_primitives(self: Handle<Self>, app: &App) -> RestorationData
Called by the
RestorationMixin to retrieve the information that this property wants
to store in the restoration data. Read moreSource§fn dispose(self: Handle<Self>, app: &mut App)
fn dispose(self: Handle<Self>, app: &mut App)
Discards any resources used by the property, unregistering it from its owner.
Source§fn enabled(self: Handle<Self>, app: &App) -> bool
fn enabled(self: Handle<Self>, app: &App) -> bool
Whether the object currently returned by
to_primitives should
be included in the restoration state. Read moreSource§fn dispose_property(self: Handle<Self>, app: &mut App)
fn dispose_property(self: Handle<Self>, app: &mut App)
Dart’s
RestorableProperty.dispose body. An override that runs super.dispose()
calls this.Source§fn did_dispose(self: Handle<Self>, app: &mut App)
fn did_dispose(self: Handle<Self>, app: &mut App)
Runs at the end of
dispose: what a Dart override does after its
super.dispose() call.Source§fn is_registered(self: Handle<Self>, app: &App) -> bool
fn is_registered(self: Handle<Self>, app: &App) -> bool
Whether this property is currently registered with a
RestorationMixin.Source§fn as_property(self: Handle<Self>) -> AnyRestorableProperty
fn as_property(self: Handle<Self>) -> AnyRestorableProperty
This property as the erased
AnyRestorableProperty — what to pass where a Dart API
takes a RestorableProperty<Object?>.Auto Trait Implementations§
impl !RefUnwindSafe for RestorableTextEditingController
impl !Send for RestorableTextEditingController
impl !Sync for RestorableTextEditingController
impl !UnwindSafe for RestorableTextEditingController
impl Forget for RestorableTextEditingController
impl Freeze for RestorableTextEditingControllerwhere
*const u8 is !null: Freeze,
PhantomData<Option<Listener>>: Freeze,
*const RcInner<Cell<usize>> is !null: Freeze,
PhantomData<RcInner<Cell<usize>>>: Freeze,
PhantomData<u8>: Freeze,
NonZero<u32>: Freeze,
&'static RestorationMixinVTable: Freeze,
PhantomData<fn() -> TextEditingController>: Freeze,
*const RcInner<Keep> is !null: Freeze,
PhantomData<RcInner<Keep>>: Freeze,
impl Move for RestorableTextEditingController
impl Unpin for RestorableTextEditingController
impl UnsafeUnpin for RestorableTextEditingControllerwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Option<Listener>>: UnsafeUnpin,
*const RcInner<Cell<usize>> is !null: UnsafeUnpin,
PhantomData<RcInner<Cell<usize>>>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
&'static RestorationMixinVTable: UnsafeUnpin,
PhantomData<fn() -> TextEditingController>: UnsafeUnpin,
*const RcInner<Keep> is !null: UnsafeUnpin,
PhantomData<RcInner<Keep>>: 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