BloomFormGroup class

Reactive controller for a nested group of named form controls.

Implements BloomFormControl so nested groups can be composed hierarchically within BloomForm or BloomFieldArray.

final addressGroup = BloomFormGroup({
  'street': BloomFormField(validators: [required()]),
  'city': BloomFormField(validators: [required()]),
});
Implemented types

Constructors

BloomFormGroup(Map<String, BloomFormControl> fields, {List<String? Function(Map<String, dynamic>)> validators = const [], List<Future<String?> Function(Map<String, dynamic> values)> asyncValidators = const [], Duration asyncDebounce = const Duration(milliseconds: 300)})
Creates a BloomFormGroup managing the given map of named fields.

Properties

asyncDebounce → Duration
Debounce duration applied when validateAsync is called with debounce: true.
final
asyncValidators → List<Future<String?> Function(Map<String, dynamic> values)>
Optional group-level asynchronous validators evaluated against the raw value map.
final
errors ↔ Signal<List<String>>
Reactive signal containing group-level validation errors.
latefinaloverride-getter
fields → Map<String, BloomFormControl>
Map of all registered child controls.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isDirty ↔ ReadonlySignal<bool>
Computed signal returning true when at least one child control's isDirty is true.
latefinaloverride-getter
isTouched ↔ Signal<bool>
Reactive signal indicating whether this group has been touched.
latefinaloverride-getter
isValid ↔ ReadonlySignal<bool>
Computed signal returning true when every child control's isValid is true and group-level errors is empty.
latefinaloverride-getter
isValidating ↔ ReadonlySignal<bool>
Reactive signal indicating whether group-level or child-level validation is currently running.
latefinaloverride-getter
rawValue → Map<String, dynamic>
Untyped structured map of all child values.
no setteroverride
rawValues → Map<String, dynamic>
Snapshot map of all child values keyed by field name.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
validators → List<String? Function(Map<String, dynamic>)>
Optional group-level synchronous validators evaluated against the raw value map.
final
values → Map<String, String>
Snapshot map of string representations of child values.
no setter

Methods

getControl<T extends BloomFormControl>(String name) → T
Returns the registered control under name typed as T.
getField(String name) → BloomFormField
Returns the BloomFormField registered under name.
getValue(String name) → String
Returns the string value of the field registered under name.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets all child controls to their initial values and clears errors and isTouched.
override
toString() → String
A string representation of this object.
inherited
touch() → void
Marks this group and all its child controls as touched.
override
validate() → bool
Runs group-level validators and validate on every child control.
override
validateAsync({bool debounce = false}) → Future<bool>
Asynchronously validates all child controls and evaluates group-level asyncValidators.
override

Operators

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