RiftForm class

A reactive form group with validation and auto-save.

RiftForm manages a collection of RiftFormField instances and provides form-level validation, dirty tracking, and auto-persist to a Rift box.

Constructors

RiftForm({Box? box, bool autoSave = false, Duration debounceDuration = const Duration(milliseconds: 500)})
Creates a RiftForm.

Properties

allErrors Map<String, List<String>>
Gets all validation errors grouped by field key.
no setter
autoSave bool
Whether to auto-save when field values change.
final
box Box?
The backing Rift box.
final
debounceDuration Duration
Debounce duration for auto-save.
final
fieldCount int
The number of fields.
no setter
fieldKeys Iterable<String>
All field keys.
no setter
hashCode int
The hash code for this object.
no setterinherited
isClean bool
Whether all fields are clean.
no setter
isDirty bool
Whether any field has been modified.
no setter
isInvalid bool
Whether any field is invalid.
no setter
isValid bool
Whether all fields are valid.
no setter
onStateChanged Stream<FormState>
A stream of form state changes.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state FormState
The current form state.
no setter

Methods

dispose() → void
Disposes the form and all its fields.
field<T>({required String key, List<FieldValidator<T>> validators = const [], T? initialValue}) RiftFormField<T>
Creates or gets a form field for key.
getField<T>(String key) RiftFormField<T>?
Gets a form field by key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets all fields to their initial values.
save() Future<bool>
Saves all field values to the backing box.
toString() String
A string representation of this object.
inherited
validate() bool
Validates all fields and returns whether the form is valid.

Operators

operator ==(Object other) bool
The equality operator.
inherited