iws_form_bloc 5.0.1
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_uipackage). Widgets now import and usepackage:material_ui/material_ui.dartinstead ofpackage:flutter/material.dart. For more details, see What's new in Flutter 3.47. - Removed deprecated
loadFaildparameter fromFormBlocConsumer(useloadFailedinstead). - Removed deprecated
ConfirmPasswordFieldBloc(useTextFieldBlocwith custom validators orcrossValidatorsinFormBlocinstead).
4.1.2 #
- Fixed a bug in
TextFieldBlocBuilderwhere theonChangedcallback was not called when the field value was updated programmatically (e.g., viafield.updateValue()).
4.1.1 #
- Updated documentation.
4.1.0 #
- Added
CheckboxListFieldBlocBuilderfor 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. FormBlocConsumerparameterloadFaildrenamed toloadFailed(old name is@Deprecatedand still works but will be removed in v5).SearchStatenow includesqueryParametersandcurrentPagefields — subclasses must be updated if any exist.ConfirmPasswordFieldBlocis now deprecated — useTextFieldBlocwith a custom validator or crossValidators inFormBlocinstead.
New Features #
- Internationalization (i18n):
FormBlocLocalizationsabstract class with built-inFormBlocLocalizationsEn(default) andFormBlocLocalizationsEsimplementations. FormBlocConfig: Global configuration singleton — callFormBlocConfig.setLocalizations(...)once inmain()to change the language of all validation errors and UI messages.FormBlocLocalizationsDelegate: OptionalLocalizationsDelegatethat integrates withMaterialApp.localizationsDelegates. Automatically callsFormBlocConfig.setLocalizations()when the app locale changes, enabling reactive locale switching without manual configuration.resetForm(): NewFormBloc.resetForm({bool keepValues = false})method andFormBlocResetevent to reset all fields to their initial state.- Cross-field validation: Override
crossValidatorsin yourFormBlocto add validators that receive all field values and return field-specific errors. - Configurable validation debounce:
FormBlocnow acceptsvalidationDebounceparameter to throttle validation on rapid keystrokes. RadioGroupFieldBlocBuilder: New widget rendering a group ofRadioListTilewidgets bound to aSelectFieldBloc.SliderFieldBlocBuilder: New widget rendering aSliderbound to anInputFieldBloc<double, D>.SelectFieldBloc.itemsLoader: OptionalFuture<List<T>> Function()for async item loading viafield.loadItems().lastUpdatedFieldNameinFormBlocState: Enables granularbuildWhenchecks in all builders.
Performance Improvements #
- O(1) field lookup:
FormBlocState.fieldByName(name)uses aHashMapinstead of linear search (firstWhere). buildWhenon all builders: All 13 field builder widgets now usebuildWhento skip rebuilds when an unrelated field changes.currentPageinListStateandSearchState: Mutable_currentPageinstance variable removed fromListBlocandSearchBloc— 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()whenaddPasswordField()was not called. - Fixed
FormBlocState.copyWithunable to explicitly setfailureResponse,successResponse, orlastUpdatedFieldNametonull(sentinel pattern applied). - Fixed
PasswordFieldBlocBuildernot initializing its controller with a pre-loaded field value (edit forms now show the existing value). - Fixed
SearchStatemissingqueryParameters— now consistent withListStateadded in v2.5.0.
3.1.0 #
- Changed visual appearance of
DateFieldBlocBuilderfromTextFieldtoListTile. - Added
ListTileSelectBlocBuilderas a visual alternative toInputChipBlocBuilder.
3.0.0 #
- Added
modifiedFieldstracking to FormBloc to identify which fields have been changed since initialization or last successful submit. - Added
getModifiedFields(),hasModifiedFields(),isFieldModified(fieldName), andclearModifiedFields()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
cacheConfigparameter toListBlocandPaginatedListBlocconstructors for HTTP caching support. - Enhanced all pagination events (
ListFetched,ListRefresh,PaginatedListNextPage,PaginatedListPreviousPage,PaginatedListGoToPage,PaginatedListRefresh) withcacheConfigparameter. - Automatic cache refresh on refresh events to ensure fresh data when explicitly requested.
- Added
usePaginationparameter toListBlocto 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
PaginatedListBlocfor 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
queryParametersfromListBlocconstructor/stateful field intoListStateso 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.