reactive_forms_lbc 5.0.4 copy "reactive_forms_lbc: ^5.0.4" to clipboard
reactive_forms_lbc: ^5.0.4 copied to clipboard

This is a set of widgets for reactive_forms package in Listener/Builder/Consumer paradigm the same as bloc library does.

reactive_forms_lbc #

This is a set of widgets for reactive_forms package in Listener/Builder/Consumer paradigm the same as bloc library does.

Available widgets:

Listeners #

  • ReactiveFormControlStatusListener
  • ReactiveFormControlFocusListener
  • ReactiveFormControlTouchListener
  • ReactiveFormControlValueListener
  • ReactiveFormArrayCollectionListener

Builders #

  • ReactiveFormControlValueBuilder
  • ReactiveFormControlStatusBuilder
  • ReactiveFormControlTouchBuilder
  • ReactiveFormControlFocusBuilder
  • ReactiveFormArrayCollectionBuilder

Consumers #

  • ReactiveFormControlValueConsumer
  • ReactiveFormControlStatusConsumer
  • ReactiveFormControlTouchConsumer
  • ReactiveFormControlFocusConsumer
  • ReactiveFormArrayCollectionConsumer

FormArray collection changes #

ReactiveFormArrayCollection* widgets observe FormArray.collectionChanges and report per-item additions and removals with the affected control and its index. Bulk operations (addAll, etc.) emit one callback per item, in order.

ReactiveFormArrayCollectionListener<Map<String, Object?>>(
  formArrayName: 'rows', // or: formArray: myFormArray,
  onItemAdded: (context, array, control, addedIndex) {
    // control is the newly added AbstractControl<Map<String, Object?>>
    // addedIndex is its position in the new controls list
  },
  onItemRemoved: (context, array, control, removedIndex) {
    // control is the removed AbstractControl
    // removedIndex is the position it was at before removal
  },
  child: ...,
)

ReactiveFormArrayCollectionBuilder rebuilds its builder: (context, FormArray<T>) whenever the collection changes; ReactiveFormArrayCollectionConsumer combines both. All three accept either formArrayName (resolved through the surrounding ReactiveForm) or a direct formArray reference.

Getting Started #

Run example project to see how it works.

3
likes
160
points
380
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

This is a set of widgets for reactive_forms package in Listener/Builder/Consumer paradigm the same as bloc library does.

Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

flutter, nested, reactive_forms

More

Packages that depend on reactive_forms_lbc