flutter_hook_form 2.0.7
flutter_hook_form: ^2.0.7 copied to clipboard
A Flutter package that provides a hook to manage form fields.
2.0.6 #
- π§ Upgrade dart SDK to ^3.8.0
2.0.2 #
Improvements #
- β»οΈ Update initialization business logic to avoid loosing initial value state on rebuild.
2.0.0 #
Breaking changes #
- π₯
FormProviderhas been renamed toHookedFormProvider - π₯
FormFieldSchemeandHookedFieldIdhave been merged intoHookField - π₯
FormSchemanow declare afieldsproperty to setup form fiels instead of usingsuperconstructor - π₯
buildersyntax has changed onHookedFormFieldallowing to declare anonymous parameters.
Improvements #
- π Fix
PatternValidatorfor failing on empty strings. Now fails only on non-empty values.
New Features #
- β¨
FormControllercan now be initialized- Generated
FormSchemadeclare a static to initialized eachHookField withInitialValuemethod has been added toHookFieldto initialized a hook field with a given value.
- Generated
1.1.1 #
Improvements #
- β¨ Enhanced
FormFieldsControllerwith improved validation and error handling:- Added optional
notifyandclearErrorsparameters tovalidate()method for more control - Added
setError()method withnotifyparameter to control rebuilds - Introduced
clearForcedErrors()method to manage form errors independently - Added new state tracking properties:
hasBeenInteracted- Detects if any field has been interacted with by userhasChanged- Checks if any field value differs from its initial value
- Added optional
Fix #
- π Update form generator to correctly identify closing brackets for generic types in annotations.
1.1.0 #
New Features #
-
β¨ Introduced
HookedFieldId<F, T>with generic type parameters for improved type safety:- The form schema type
Fis now included in the field ID - This enables better type inference when using form fields
- No need to specify form schema type in most widget usages
- The form schema type
-
π Added reactive form capabilities:
- Form controller now properly notifies listeners when field values change
- Added
registerFieldChangemethod to track field modifications - Added methods to check if fields are dirty:
isDirty,areAnyDirty,areAllDirty
-
β¨ Introduced
HookedFormFieldandHookedTextFormField:- Updated to use the new
fieldHookparameter instead offieldKey - Better type inference from field hooks
- Added support for tracking field changes
- Updated to use the new
Improvements #
-
π Comprehensive documentation updates:
- Added examples for custom form fields
- Improved explanation of form initialization
- Added section on writing custom form fields
- Updated code examples to use the latest API
-
π Fixed validation issues:
- Resolved bug where forced errors took precedence over validation errors
- Improved error clearing during validation
- Better handling of field rebuilds after validation
Breaking Changes #
- π Renamed parameter from
fieldKeytofieldHookin form field widgets- Update your code to use
fieldHook: MySchema.fieldinstead offieldKey: MySchema.field - This change better reflects the purpose of the parameter
- Update your code to use
1.0.0 #
Breaking Changes #
-
β οΈ Validator usage has been updated to support internationalization:
- Validators are now declared in a list instead of being chained in a function.
- Validators now return
errorCodeinstead of error messages - Error messages are handled through the
FormErrorMessagesclass - Custom validators need to extend
Validator<T>and provide anerrorCode - See the documentation for migration details
-
β¨ Add code generation support for form schemas
-
π Add built-in internationalization support
-
π οΈ Improve code organization and maintainability
0.0.4 #
- Add comprehensive documentation
- Update exports
- Add example for package demonstration
0.0.3 #
- Downgrade mime package to 1.0.6
0.0.2 #
- Add test suite and improve comments
0.0.1 #
- Init project