iws_form_bloc 5.0.1 copy "iws_form_bloc: ^5.0.1" to clipboard
iws_form_bloc: ^5.0.1 copied to clipboard

Simplified creation of forms and listings using the BLoC pattern.

5.0.1 #

  • Fixed material ui import error in FormBlocLocalizationsDelegate.

5.0.0 #

Breaking Changes #

  • Migrated to Flutter 3.47 Material UI (material_ui package). Widgets now import and use package:material_ui/material_ui.dart instead of package:flutter/material.dart. For more details, see What's new in Flutter 3.47.
  • Removed deprecated loadFaild parameter from FormBlocConsumer (use loadFailed instead).
  • Removed deprecated ConfirmPasswordFieldBloc (use TextFieldBloc with custom validators or crossValidators in FormBloc instead).

4.1.2 #

  • Fixed a bug in TextFieldBlocBuilder where the onChanged callback was not called when the field value was updated programmatically (e.g., via field.updateValue()).

4.1.1 #

  • Updated documentation.

4.1.0 #

  • Added CheckboxListFieldBlocBuilder for multi-select checkbox lists.

4.0.1 #

  • Fixed a bug in FormLoadingDialog when trying to pop the dialog when the context is not mounted.

4.0.0 #

Breaking Changes #

  • Default language for all error messages changed from Spanish to English. Apps that rely on Spanish messages must call FormBlocConfig.setLocalizations(const FormBlocLocalizationsEs()) at startup.
  • FormBlocConsumer parameter loadFaild renamed to loadFailed (old name is @Deprecated and still works but will be removed in v5).
  • SearchState now includes queryParameters and currentPage fields — subclasses must be updated if any exist.
  • ConfirmPasswordFieldBloc is now deprecated — use TextFieldBloc with a custom validator or crossValidators in FormBloc instead.

New Features #

  • Internationalization (i18n): FormBlocLocalizations abstract class with built-in FormBlocLocalizationsEn (default) and FormBlocLocalizationsEs implementations.
  • FormBlocConfig: Global configuration singleton — call FormBlocConfig.setLocalizations(...) once in main() to change the language of all validation errors and UI messages.
  • FormBlocLocalizationsDelegate: Optional LocalizationsDelegate that integrates with MaterialApp.localizationsDelegates. Automatically calls FormBlocConfig.setLocalizations() when the app locale changes, enabling reactive locale switching without manual configuration.
  • resetForm(): New FormBloc.resetForm({bool keepValues = false}) method and FormBlocReset event to reset all fields to their initial state.
  • Cross-field validation: Override crossValidators in your FormBloc to add validators that receive all field values and return field-specific errors.
  • Configurable validation debounce: FormBloc now accepts validationDebounce parameter to throttle validation on rapid keystrokes.
  • RadioGroupFieldBlocBuilder: New widget rendering a group of RadioListTile widgets bound to a SelectFieldBloc.
  • SliderFieldBlocBuilder: New widget rendering a Slider bound to an InputFieldBloc<double, D>.
  • SelectFieldBloc.itemsLoader: Optional Future<List<T>> Function() for async item loading via field.loadItems().
  • lastUpdatedFieldName in FormBlocState: Enables granular buildWhen checks in all builders.

Performance Improvements #

  • O(1) field lookup: FormBlocState.fieldByName(name) uses a HashMap instead of linear search (firstWhere).
  • buildWhen on all builders: All 13 field builder widgets now use buildWhen to skip rebuilds when an unrelated field changes.
  • currentPage in ListState and SearchState: Mutable _currentPage instance variable removed from ListBloc and SearchBloc — page tracking is now fully observable and testable via BLoC state.

Bug Fixes #

  • Fixed mutation bug in FilterChipFieldBlocBuilder — was mutating the original list before emitting the event.
  • Fixed mutation bug in InputChipMultiBlocBuilder — same issue.
  • Fixed null assertion crash in ConfirmPasswordFieldBloc.validate() when addPasswordField() was not called.
  • Fixed FormBlocState.copyWith unable to explicitly set failureResponse, successResponse, or lastUpdatedFieldName to null (sentinel pattern applied).
  • Fixed PasswordFieldBlocBuilder not initializing its controller with a pre-loaded field value (edit forms now show the existing value).
  • Fixed SearchState missing queryParameters — now consistent with ListState added in v2.5.0.

3.1.0 #

  • Changed visual appearance of DateFieldBlocBuilder from TextField to ListTile.
  • Added ListTileSelectBlocBuilder as a visual alternative to InputChipBlocBuilder.

3.0.0 #

  • Added modifiedFields tracking to FormBloc to identify which fields have been changed since initialization or last successful submit.
  • Added getModifiedFields(), hasModifiedFields(), isFieldModified(fieldName), and clearModifiedFields() methods to FormBloc.
  • Modified fields are automatically cleared on successful form submission (emitSuccess, emitSuccessCreation, emitSuccessModification, emitDeleteSuccessful).
  • Improved field list handling to create new list instances for proper Equatable comparison.

2.7.0 #

  • Added cacheConfig parameter to ListBloc and PaginatedListBloc constructors for HTTP caching support.
  • Enhanced all pagination events (ListFetched, ListRefresh, PaginatedListNextPage, PaginatedListPreviousPage, PaginatedListGoToPage, PaginatedListRefresh) with cacheConfig parameter.
  • Automatic cache refresh on refresh events to ensure fresh data when explicitly requested.
  • Added usePagination parameter to ListBloc to control pagination behavior.

2.6.0 #

  • Fixed a bug where the current page was not incremented correctly when fetching with a null page parameter.
  • Replaced PaginatedListFetchEvent with PaginatedListGoToPage for better clarity.
  • Added PaginatedListNextPage and PaginatedListPreviousPage events for easier pagination navigation.

2.5.0 #

  • Added PaginatedListBloc for handling paginated data with more granular control over pagination states and custom events.
  • Enhanced pagination support with dedicated status transitions for better user experience.
  • Moved queryParameters from ListBloc constructor/stateful field into ListState so active filters are observable and persist across rebuilds.

2.4.1 #

  • Fixed a bug that could cause crashes related to focus management when showing or hiding the loading dialog.

2.4.0 #

  • Updated dependencies for iws_http and iws_http_model to version 1.0.0.
  • Updated readme with more examples.

2.3.2 #

  • Added error message to CheckBoxFieldBlocBuilder, InputChipFieldBlocBuilder and InputChipMultiFieldBlocBuilder.

2.3.1 #

  • Added pathParams to ListBloc events.

2.3.0 #

  • Added custom loading widget to FormBlocConsumer.
  • Updated to iws_http: 0.8.2

2.2.2 #

  • Improved password validation.

2.2.1 #

  • Fixed apiKey and auth in SearchBloc.

2.2.0 #

  • Added apiKey and auth properties to ListBloc.

2.1.1 #

  • Updated dependencies.

2.1.0 #

  • Added search bloc.

2.0.2 #

  • Fixed textStyle property in PasswordFieldBlocBuilder.

2.0.1 #

  • Updated to iws_http: 0.8.1
  • Updated to iws_http_model: 0.6.2

2.0.0 #

  • Added showCursor, validator, contextMenuBuilder and decoration properties on TextFieldBlocBuilder and PasswordFieldBlocBuilder.

Breaking changes:

  • Removed DropdwonFieldBlocBuilder.
  • Removed label, prefixIcon, helperText and border properties from TextFieldBlocBuilder and PasswordFieldBlocBuilder.

1.5.1 #

  • Updated to iws_http: 0.8.0
  • Updated to iws_http_model: 0.6.1

1.5.0 #

  • Updated to iws_http: 0.7.1
  • Updated to iws_http_model: 0.6.0

1.4.1 #

  • Fixed loading dialog.

1.4.0 #

  • Added method addFormError to FormBloc.

1.3.0 #

  • Added FormBlocAddError event on FormBloc.
  • Added dark colors to ColorType.

1.2.1 #

  • Fixed readonly property in FilterChipFieldBlocBuilder.

1.2.0 #

  • Added custome events on ListBloc.

1.1.0 #

  • Updated to iws_http: 0.6.0
  • Updated to iws_http_model: 0.5.0

1.0.0 #

  • Added delete event on ListBloc.

0.9.0 #

  • Added InputChip builder.

0.8.0 #

  • Added search parameters to ListBloc.

0.7.1 #

  • Upgrade to iws_http 0.5.1

0.7.0 #

  • Added form step validations.

0.6.3 #

  • Fixed a bug when loading forms.

0.6.2 #

  • Upgrade to iws_http 0.5.0

0.6.1 #

  • Fixed an error in email validation.

0.6.0 #

  • Added ColorSelectBlocBuilder.
  • Added action result to FormBloc.

0.5.0 #

  • The onChange method is added to the inputs.
  • Added pagination information in lists.

0.4.4 #

  • Renamed params to queryParameters in ListBloc.
  • Upgrade to iws_http 0.4.1

0.4.3 #

  • Fixed typo in DropdownFieldBlocBuilder class name.
  • Added border property to form inputs.

0.4.2 #

  • Upgrade to iws_http 0.4.0

0.4.1 #

  • Fixed a bug in the FormBlocConsumer when getting an unknown type error.

0.4.0 #

  • Added showErrorMessages attribute in FormBlocConsumer.

0.3.0 #

  • Added Color Select.
  • Added delete confirmation dialog.

0.2.0 #

  • Upgrade to iws_http_model 0.3.0

0.1.0 #

  • Upgrade to iws_http_model 0.2.0

0.0.1 #

  • Initial release.
0
likes
150
points
593
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Simplified creation of forms and listings using the BLoC pattern.

Homepage

License

MIT (license)

Dependencies

bloc, equatable, flutter, flutter_bloc, iws_cache, iws_http, iws_http_model, material_ui

More

Packages that depend on iws_form_bloc