pub struct FormFieldState<T: Clone + 'static> { /* private fields */ }Expand description
The current state of a FormField. Passed to the FormFieldBuilder method for use in
constructing the form field’s widget.
Its associated functions are the bodies Dart’s FormFieldState<T> gives its subclasses:
the virtuals’ defaults, which an override calls where Dart writes super.…, and the
lifecycle a subclass’s State and RestorationMixin impls run at Dart’s
super.initState() and the rest.
Implementations§
Source§impl<T: Clone + 'static> FormFieldState<T>
impl<T: Clone + 'static> FormFieldState<T>
Sourcepub fn save<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>(
this: Handle<S>,
app: &mut App,
)
pub fn save<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>( this: Handle<S>, app: &mut App, )
Sourcepub fn reset<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>(
this: Handle<S>,
app: &mut App,
)
pub fn reset<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>( this: Handle<S>, app: &mut App, )
Sourcepub fn clear_error<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>(
this: Handle<S>,
app: &mut App,
)
pub fn clear_error<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>( this: Handle<S>, app: &mut App, )
Sourcepub fn validate<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>(
this: Handle<S>,
app: &mut App,
) -> bool
pub fn validate<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>( this: Handle<S>, app: &mut App, ) -> bool
Sourcepub fn did_change<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>(
this: Handle<S>,
app: &mut App,
value: Option<T>,
)
pub fn did_change<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>( this: Handle<S>, app: &mut App, value: Option<T>, )
Sourcepub fn restoration_id<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>(
this: Handle<S>,
app: &App,
) -> Option<&str>
pub fn restoration_id<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>( this: Handle<S>, app: &App, ) -> Option<&str>
Dart’s FormFieldState.restorationId.
Sourcepub fn restore_state<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>(
this: Handle<S>,
app: &mut App,
_old_bucket: Option<Handle<RestorationBucket>>,
_initial_restore: bool,
)
pub fn restore_state<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>( this: Handle<S>, app: &mut App, _old_bucket: Option<Handle<RestorationBucket>>, _initial_restore: bool, )
Dart’s FormFieldState.restoreState.
Sourcepub fn deactivate<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>(
this: Handle<S>,
app: &mut App,
)
pub fn deactivate<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>( this: Handle<S>, app: &mut App, )
Dart’s FormFieldState.deactivate, run where the leaf’s State::deactivate would call
super.deactivate().
Sourcepub fn init_state<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>(
this: Handle<S>,
app: &mut App,
)
pub fn init_state<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>( this: Handle<S>, app: &mut App, )
Dart’s FormFieldState.initState, with the field initializers Dart runs as the state is
constructed.
Sourcepub fn did_update_widget<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>(
this: Handle<S>,
app: &mut App,
old_widget: &S::Widget,
)
pub fn did_update_widget<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>( this: Handle<S>, app: &mut App, old_widget: &S::Widget, )
Dart’s FormFieldState.didUpdateWidget.
Sourcepub fn did_change_dependencies<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>(
this: Handle<S>,
app: &mut App,
)
pub fn did_change_dependencies<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>( this: Handle<S>, app: &mut App, )
Dart’s FormFieldState.didChangeDependencies.
Sourcepub fn dispose<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>(
this: Handle<S>,
app: &mut App,
)
pub fn dispose<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>( this: Handle<S>, app: &mut App, )
Dart’s FormFieldState.dispose.
Sourcepub fn build<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>(
this: Handle<S>,
app: &mut App,
context: BuildContext,
) -> WidgetRef
pub fn build<S: FormFieldStateLeaf<Widget: FormFieldLeaf<Value = T>>>( this: Handle<S>, app: &mut App, context: BuildContext, ) -> WidgetRef
Dart’s FormFieldState.build.
Trait Implementations§
Source§impl<T: Clone + 'static> FormFieldStateLeaf for FormFieldState<T>
impl<T: Clone + 'static> FormFieldStateLeaf for FormFieldState<T>
Source§fn form_field_state_data(
self: Handle<Self>,
app: &App,
) -> &FormFieldStateData<FormFieldValue<Self>>
fn form_field_state_data( self: Handle<Self>, app: &App, ) -> &FormFieldStateData<FormFieldValue<Self>>
Source§fn form_field_state_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut FormFieldStateData<FormFieldValue<Self>>
fn form_field_state_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut FormFieldStateData<FormFieldValue<Self>>
Source§fn value(self: Handle<Self>, app: &App) -> Option<&FormFieldValue<Self>>
fn value(self: Handle<Self>, app: &App) -> Option<&FormFieldValue<Self>>
Source§fn error_text(self: Handle<Self>, app: &App) -> Option<String>
fn error_text(self: Handle<Self>, app: &App) -> Option<String>
FormFieldData::validator callback, or
the manually provided error message using the FormFieldData::force_error_text
property. Read moreSource§fn has_error(self: Handle<Self>, app: &App) -> bool
fn has_error(self: Handle<Self>, app: &App) -> bool
Source§fn has_interacted_by_user(self: Handle<Self>, app: &App) -> bool
fn has_interacted_by_user(self: Handle<Self>, app: &App) -> bool
Source§fn is_valid(self: Handle<Self>, app: &mut App) -> bool
fn is_valid(self: Handle<Self>, app: &mut App) -> bool
Source§fn save(self: Handle<Self>, app: &mut App)
fn save(self: Handle<Self>, app: &mut App)
FormField’s on_saved method with the current value.Source§fn clear_error(self: Handle<Self>, app: &mut App)
fn clear_error(self: Handle<Self>, app: &mut App)
Source§fn validate(self: Handle<Self>, app: &mut App) -> bool
fn validate(self: Handle<Self>, app: &mut App) -> bool
FormFieldData::validator to set the error_text only if
FormFieldData::force_error_text is None. When
FormFieldData::force_error_text is not None, FormFieldData::validator will not
be called. Read moreSource§fn did_change(
self: Handle<Self>,
app: &mut App,
value: Option<FormFieldValue<Self>>,
)
fn did_change( self: Handle<Self>, app: &mut App, value: Option<FormFieldValue<Self>>, )
Slider’s Slider.onChanged argument. Read moreSource§fn set_value(
self: Handle<Self>,
app: &mut App,
value: Option<FormFieldValue<Self>>,
)
fn set_value( self: Handle<Self>, app: &mut App, value: Option<FormFieldValue<Self>>, )
Source§fn as_form_field_state(
self: Handle<Self>,
) -> AnyFormFieldState<FormFieldValue<Self>>
fn as_form_field_state( self: Handle<Self>, ) -> AnyFormFieldState<FormFieldValue<Self>>
AnyFormFieldState: what to pass where a Dart API takes a
FormFieldState<T>.Source§fn as_dynamic_form_field_state(self: Handle<Self>) -> DynamicFormFieldState
fn as_dynamic_form_field_state(self: Handle<Self>) -> DynamicFormFieldState
DynamicFormFieldState: what to pass where a Dart API takes
a FormFieldState<dynamic>.Source§impl<T: Clone + 'static> RestorationMixin for FormFieldState<T>
impl<T: Clone + 'static> RestorationMixin for FormFieldState<T>
Source§fn restoration_mixin_data(
self: Handle<Self>,
app: &App,
) -> &RestorationMixinData
fn restoration_mixin_data( self: Handle<Self>, app: &App, ) -> &RestorationMixinData
Source§fn restoration_mixin_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut RestorationMixinData
fn restoration_mixin_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut RestorationMixinData
Source§fn restoration_id(self: Handle<Self>, app: &App) -> Option<&str>
fn restoration_id(self: Handle<Self>, app: &App) -> Option<&str>
RestorationBucket in which the mixin will store the
restoration data of all registered properties. Read moreSource§fn restore_state(
self: Handle<Self>,
app: &mut App,
old_bucket: Option<Handle<RestorationBucket>>,
initial_restore: bool,
)
fn restore_state( self: Handle<Self>, app: &mut App, old_bucket: Option<Handle<RestorationBucket>>, initial_restore: bool, )
Source§fn bucket(self: Handle<Self>, app: &App) -> Option<Handle<RestorationBucket>>
fn bucket(self: Handle<Self>, app: &App) -> Option<Handle<RestorationBucket>>
RestorationBucket used for the restoration data of the RestorablePropertys
registered to this mixin. Read moreSource§fn did_toggle_bucket(
self: Handle<Self>,
app: &mut App,
old_bucket: Option<Handle<RestorationBucket>>,
)
fn did_toggle_bucket( self: Handle<Self>, app: &mut App, old_bucket: Option<Handle<RestorationBucket>>, )
Source§fn register_for_restoration(
self: Handle<Self>,
app: &mut App,
property: AnyRestorableProperty,
restoration_id: &str,
)
fn register_for_restoration( self: Handle<Self>, app: &mut App, property: AnyRestorableProperty, restoration_id: &str, )
RestorableProperty for state restoration. Read moreSource§fn unregister_from_restoration(
self: Handle<Self>,
app: &mut App,
property: AnyRestorableProperty,
)
fn unregister_from_restoration( self: Handle<Self>, app: &mut App, property: AnyRestorableProperty, )
RestorableProperty from state restoration. Read moreSource§fn did_update_restoration_id(self: Handle<Self>, app: &mut App)
fn did_update_restoration_id(self: Handle<Self>, app: &mut App)
restoration_id
changes. Read moreSource§fn restore_pending(self: Handle<Self>, app: &mut App) -> bool
fn restore_pending(self: Handle<Self>, app: &mut App) -> bool
restore_state will be called at the beginning of the
next build phase. Read moreSource§fn did_change_dependencies_restoration(self: Handle<Self>, app: &mut App)
fn did_change_dependencies_restoration(self: Handle<Self>, app: &mut App)
RestorationMixin.didChangeDependencies, called by the State from its own
State::did_change_dependencies.Source§fn dispose_restoration(self: Handle<Self>, app: &mut App)
fn dispose_restoration(self: Handle<Self>, app: &mut App)
Source§fn as_restoration_mixin(self: Handle<Self>) -> AnyRestorationMixin
fn as_restoration_mixin(self: Handle<Self>) -> AnyRestorationMixin
AnyRestorationMixin — what a RestorableProperty keeps as
its owner.Source§fn do_restore(
self: Handle<Self>,
app: &mut App,
old_bucket: Option<Handle<RestorationBucket>>,
)
fn do_restore( self: Handle<Self>, app: &mut App, old_bucket: Option<Handle<RestorationBucket>>, )
_doRestore.Source§fn update_bucket_if_necessary(
self: Handle<Self>,
app: &mut App,
parent: Option<Handle<RestorationBucket>>,
restore_pending: bool,
) -> bool
fn update_bucket_if_necessary( self: Handle<Self>, app: &mut App, parent: Option<Handle<RestorationBucket>>, restore_pending: bool, ) -> bool
_updateBucketIfNecessary. Returns true if bucket has been
replaced with a new bucket; it is the responsibility of the caller to dispose the old
bucket when this returns true.Source§fn set_new_bucket_if_necessary(
self: Handle<Self>,
app: &mut App,
new_bucket: Option<Ref<RestorationBucket>>,
restore_pending: bool,
) -> bool
fn set_new_bucket_if_necessary( self: Handle<Self>, app: &mut App, new_bucket: Option<Ref<RestorationBucket>>, restore_pending: bool, ) -> bool
_setNewBucketIfNecessary. Returns true if bucket has been
replaced with a new bucket; it is the responsibility of the caller to dispose the old
bucket when this returns true.Source§fn update_property(
self: Handle<Self>,
app: &mut App,
property: AnyRestorableProperty,
)
fn update_property( self: Handle<Self>, app: &mut App, property: AnyRestorableProperty, )
_updateProperty.Source§fn unregister(
self: Handle<Self>,
app: &mut App,
property: AnyRestorableProperty,
)
fn unregister( self: Handle<Self>, app: &mut App, property: AnyRestorableProperty, )
RestorationMixin._unregister.Source§impl<T: Clone + 'static> State for FormFieldState<T>
impl<T: Clone + 'static> State for FormFieldState<T>
Source§fn state_data(self: Handle<Self>, app: &App) -> &StateData<Self::Widget>
fn state_data(self: Handle<Self>, app: &App) -> &StateData<Self::Widget>
state
(state_accessors!).Source§fn state_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut StateData<Self::Widget>
fn state_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut StateData<Self::Widget>
state_data.Source§fn deactivate(self: Handle<Self>, app: &mut App)
fn deactivate(self: Handle<Self>, app: &mut App)
Source§fn init_state(self: Handle<Self>, app: &mut App)
fn init_state(self: Handle<Self>, app: &mut App)
Source§fn did_update_widget(
self: Handle<Self>,
app: &mut App,
old_widget: &FormField<T>,
)
fn did_update_widget( self: Handle<Self>, app: &mut App, old_widget: &FormField<T>, )
Source§fn did_change_dependencies(self: Handle<Self>, app: &mut App)
fn did_change_dependencies(self: Handle<Self>, app: &mut App)
Source§fn dispose(self: Handle<Self>, app: &mut App)
fn dispose(self: Handle<Self>, app: &mut App)
Source§fn build(self: Handle<Self>, app: &mut App, context: BuildContext) -> WidgetRef
fn build(self: Handle<Self>, app: &mut App, context: BuildContext) -> WidgetRef
Source§fn widget(self: Handle<Self>, app: &App) -> &Self::Widget
fn widget(self: Handle<Self>, app: &App) -> &Self::Widget
Source§fn context(self: Handle<Self>, app: &App) -> BuildContext
fn context(self: Handle<Self>, app: &App) -> BuildContext
Source§fn set_state(self: Handle<Self>, app: &mut App, f: impl FnOnce(&mut Self))
fn set_state(self: Handle<Self>, app: &mut App, f: impl FnOnce(&mut Self))
Source§fn activate(self: Handle<Self>, app: &mut App)
fn activate(self: Handle<Self>, app: &mut App)
deactivate. Read moreSource§fn debug_fill_properties(
self: Handle<Self>,
app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( self: Handle<Self>, app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties this state shows where its element’s dump
names it (state: ScrollableState#1a2b3(offset: 0.0)), after the lifecycle and mounting
properties State’s base adds, which the framework adds first.