bond_form 0.0.4
bond_form: ^0.0.4 copied to clipboard
Form is a Bond package provides a convenient way to handle Form.
Changelog #
0.0.4 #
Breaking Changes #
- Renamed
updatemethod toupdateFieldinGetxFormControllerto avoid conflict withGetxController. - This change requires updating all instances where the
updatemethod was used toupdateField.
0.0.3+1 #
- Introduced BaseFormController mixin to handle common form state logic and provide reusable form management functions.
0.0.3+1 #
- add missing method
optionalonrules.dartfile
0.0.3 #
Added #
- Optional Rule: Introduced the
Optionalvalidation rule that allows fields to be marked as optional. If the field is not present (null, empty string, or empty list), validation will pass, and all other rules will be skipped. If the field is present, other rules will be validated against the value. - Enhanced Validation Logic: The
validatemethod inFormFieldStatenow properly handles theOptionalrule, ensuring that optional fields can skip validation when appropriate.
Changed #
- General Validation Logic: Updated the general validation logic to support the new
Optionalrule, improving flexibility and making form validation more intuitive for optional fields.
Fixed #
- Bug Fixes: Resolved issues related to handling
nulland empty values in form validation, ensuring that the newOptionalrule operates smoothly within the validation pipeline.
0.0.2 #
-
Automatic Body Generation with BodyConvertible Mixin • Introduced the BodyConvertible mixin, which allows automatic generation of a request body map from form state values. This simplifies the process of extracting and transforming form field values into a key-value map suitable for API requests. • The body() method automatically iterates over all form fields, applying registered transformers to generate the body map.
-
Flexible Field Transformers with TransformersRegistry • Added the TransformersRegistry class, which allows developers to register custom field transformers. These transformers can convert field values into any desired format, such as converting enum values to strings. • The registry supports both single values and collections (e.g., Set, List), automatically handling the transformation of collection elements.
0.0.1+30 #
- update dependence
0.0.1+29 #
- add
setErrormethod toFormControllermixin to set the error message of a specific field. - add
updateErrormethod toFormControllermixin to update the error message of a specific field. - The
setErrormethod directly sets a provided error message for a field, while theupdateErrormethod appends the provided error message to any existing validation errors for the field.
0.0.1+28 #
- Fix isTrue & isFalse rules to deal with null value and now support bool, String & num types.
0.0.1+27 #
- Added date field support to form extensions.
BondFormStateupdated with methods to handle date fields.dateFieldValue: Retrieves the value of a date field.dateField: Retrieves the state of a date field using a simplifiedgetmethod.
0.0.1+26 #
- Added
FileFieldStateclass to manage the state of file form fields.FileFieldStateprovides a way to manage file input fields within a form.
0.0.1+25 #
- Refactor: Separated field state and value retrieval methods into distinct files.
- Moved field state retrieval methods to
bond_form_extensions.dart. - Moved value retrieval methods to
bond_form_values.dart.
- Moved field state retrieval methods to
- Enhancement: Updated
required_values.dartto include theRequiredValuesclass for mandatory field checks. - Improvement: Improved overall code organization and maintainability by dividing responsibilities into specific files.
0.0.1+24 #
- fix
validmethod logic.
0.0.1+23 #
validNew method onBondFormStateto check a specific field validate.
0.0.1+22 #
- Added
HiddenFieldStateclass to manage the state of hidden form fields.HiddenFieldStateprovides a way to manage hidden input fields within a form.
- Updated
BondFormStatewith methods to handle hidden fields.hiddenFieldValue: Retrieves the value of a hidden field.hiddenField: Retrieves the state of a hidden field using a simplifiedgetmethod.
- Updated
RequiredValuesclass to ensure hidden field values are not null.hiddenFieldValue: Ensures the value of a hidden field is not null.
- Updated
FormControllerwith methods to update hidden field values.updateHiddenField: Updates aHiddenFieldStatewith a given value.
0.0.1+21 #
- Added the
RequiredValuesclass to ensure required form field values are not null.- Methods added to
RequiredValuesclass:textFieldValue: Ensures the value of a text field is not null.radioGroupValue: Ensures the value of a radio group field is not null.checkboxGroupValue: Ensures the first selected value of a checkbox group is not null.dropDownValue: Ensures the value of a dropdown field is not null.asyncDropDownValue: Ensures the value of an async dropdown field is not null.
- Methods added to
- Added the
requiredextension method toBondFormState.- Provides an instance of
RequiredValuesto ensure required field values are not null.
- Provides an instance of
- Updated the Dartdoc comments for
XBondFormStateextension.- Provided clear and comprehensive documentation for all methods:
textFieldValue: Retrieves the value of a text field.radioGroupValue: Retrieves the value of a radio group field.checkboxGroupValue: Retrieves the first selected value of a checkbox group.dropDownValue: Retrieves the value of a dropdown field.asyncDropDownValue: Retrieves the value of an async dropdown field.required: Returns an instance ofRequiredValuesto ensure required field values are not null.
- Provided clear and comprehensive documentation for all methods:
- Updated the Dartdoc comments for
XFormControllerextension.- Provided clear and comprehensive documentation for all methods:
updateText: Updates aTextFieldStatewith a given value.updateCheckbox: Updates aCheckboxFieldStatewith a given value.updateCheckboxGroup: Updates aCheckboxGroupFieldStatewith a given value.toggleCheckbox: Toggles the value of a specific checkbox within a checkbox group.updateDate: Updates aDateFieldStatewith a given value.updateDropDown: Updates aDropDownFieldStatewith a given value.updateAsyncDropDown: Updates aAsyncDropDownFieldStatewith a given value.updateRadioButton: Updates aRadioButtonFieldStatewith a given value.updateRadioGroup: Updates aRadioGroupFieldStatewith a given value.
- Provided clear and comprehensive documentation for all methods:
0.0.1+20 #
- fix
IsTrueandIsFalserules to deal with null value.
0.0.1+19 #
- fix
Numericrule to deal with null value.
0.0.1+18 #
- new extension methods support dealing with single bool checkbox field.
- fix
AlphaNumandAlphaDashrules to deal with null value.
0.0.1+17 #
- fix failure handling at the _onSubmit method.
0.0.1+16 #
- introduce
HasValidationErrorsmixin to update form fields state with the errors that comes from an api. services.
0.0.1+15 #
- add missing method 'updateAsyncDropDown' to
FormControllerextension.
0.0.1+14 #
- introduced the async drop down menu field state
AsyncDropDownFieldState.
0.0.1+13 #
- add more helpers methods inside
BondFormStateextension
0.0.1+12 #
- add clear method to
FormControllermixin
0.0.1+11 #
- add validate method to
FormControllermixin
0.0.1+10 #
- update readme.md file to mention the riverpod integration
0.0.1+9 #
- fix typo on readme.md file
0.0.1+8 #
- update readme.md files
- fix dart analysis issues
0.0.1+7 #
- update example.md and readme.md files
0.0.1+6 #
- fix validation localized message not rendered as excepted
0.0.1+5 #
- extract mixin FormController contains common form logic
0.0.1+4 #
- write public API has dartdoc comments
- fix dart analysis issues
0.0.1+3 #
- add necessary imports to bond form
0.0.1+2 #
- update bond_core dependency.
0.0.1+1 #
- add necessary imports to bond form
0.0.1 #
- initial release.