AdvancedBooleanFieldController<E extends Object> class
A specialization of AdvancedFieldController for a bool value.
- Inheritance
-
- Object
- AdvancedFieldController<
bool, E> - AdvancedBooleanFieldController
Constructors
-
AdvancedBooleanFieldController({bool initialValue = false, Validator<
bool, E> ? validator, AsyncValidation<bool, E> ? asyncValidation, FocusNode? focusNode, String? name}) - Creates a new AdvancedBooleanFieldController.
Properties
- error → E?
-
The current error — shortcut for
value.error.no setterinherited - fieldValue → bool
-
The current value — shortcut for
value.value.no setterinherited - focusNode → FocusNode
-
The FocusNode bound to this field: the one given to the constructor, or
one created on first use. See ValidationMode.onUnfocus. Throws a
StateError once disposed.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isDisposed → bool
-
Whether this controller has been disposed. Once true it stays true.
no setterinherited
- lastFailure → AsyncValidationFailure?
-
Details behind FieldStatus.failedValidation, or null when the field is
not in that state. Diagnostic only.
no setterinherited
- name → String?
-
Optional label used in reported errors and as the
FocusNodedebug label. Not used for identity — fields are identified by reference.finalinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
value
→ AdvancedFieldState<
bool, E> -
The current value of the object.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
clearErrors(
) → void -
Clears both errors, and drops the verdict since the code it produced is
being erased. This is how to invalidate an async check whose answer depends
on state outside the value.
inherited
-
debugSetState(
AdvancedFieldState< bool, E> state) → void -
Test-only seeder for state combinations the pipeline never produces, such
as an AdvancedFieldState.asyncError with no round having run. Carries no
verdict, so validate re-runs the async validator for it.
inherited
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
focus(
) → void -
Requests focus via
focusNode. A no-op once disposed.inherited -
getValueSetter(
) → ValueSetter< bool> ? -
Returns
nullif the field is readonly, otherwise setValue. Useful where a nullonChangeis what disables a widget.inherited -
handleUnfocus(
) → Future< void> -
Called when focus moves away from the field. This is what
ValidationMode.onUnfocus reacts to. With
focusNodebound, focus loss calls this for you; pickers and dropdowns must call it themselves. Runs pending debounce immediately and validates read-only fields, same as validate.inherited -
markReadOnly(
) → void -
Prevents further changes of value
T. validate still validates a read-only field.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
prefill(
bool newValue, {bool force = false}) → void -
Writes
newValueon behalf of the program, not the user. A no-op on a read-only field unlessforceis true.inherited -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
reset(
) → void -
Resets the field to its initial value, clearing both errors, the status,
the verdict and lastFailure. Keeps AdvancedFieldState.validationMode
and AdvancedFieldState.readOnly.
inherited
-
revalidateSync(
) → void -
Re-runs the sync validator when the gate allows it, nothing otherwise.
inherited
-
setError(
E? error) → void -
Sets a new
erroron AdvancedFieldState.validationError. Passing null clears it and the status follows.inherited -
setValidationMode(
ValidationMode mode) → void -
Gives this field its own validation mode, ignoring the form's from now on.
Cannot be undone — the field no longer follows form mode changes.
Does not trigger validation by itself.
inherited
-
setValue(
bool newValue, {bool force = false}) → void -
Sets a new
newValueon behalf of the user. A no-op on a read-only field unlessforceis true.inherited -
subscribeToFields(
List< AdvancedFieldController> fields) → void -
Subscribes to the
fieldsand re-runs this field's sync validator whenever any of their values change. Replaces any earlier subscription.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
unmarkReadOnly(
) → void -
Allows further changes of value
T.inherited -
validate(
) → Future< bool> -
Runs a full validation round on the current value and reports whether the
field ended up AdvancedFieldState.isValid.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited