glade_forms 5.0.0
glade_forms: ^5.0.0 copied to clipboard
A universal way to define form validators with support of translations.
5.0.0 #
Breaking change release
In order to introduce support for warning level validations, several breaking changes were made:
GladeInputErrorwas renamed toGladeInputValidationto better reflect its purpose.GladeErrorKeyswas renamed toGladeValidationsKeysErrorTranslatorwas renamed toValidationTranslatorto align with the new naming conventionsdevErrorparameter inGladeValidatormethods was renamed todevMessageto maintain consistency.translateErrorparameter was renamed tovalidationTranslatein bothGladeInputandGladeModelto better represent its functionality.DefaultTranslationswas renamed toDefaultValidationTranslationsto clarify its role in the validation process.- Rename
defaultErrorTranslatetodefaultValidationTranslateinGladeModelfor consistency with other renamings.
New features:
GladeInputValidationnow includes anerrorSeverityproperty, which can be eithererrororwarning.- The
GladeValidatorclass was updated to support warning level validations. - The
GladeInputclass was modified to handle warning level validations appropriately - The
GladeModelclass was also updated to manage warning level validations effectively.
4.2.0 #
- Upgrade dependencies
- Upgrade to Flutter SDK 3.35.0
- Change constraint to Dart sdk: ">=3.8.0 <4.0.0"
4.1.2 #
- [Add]: Add
metaDatatoSatisfyPredicatePartandGladeValidator.satisfyPredicate()to allow passing additional data. - [Add]: Add
getMaxLength()inttoGladeStringInputto get maximum length of the string ifmaxLength()standard validator is used.
4.0.2 #
- [Fix]: Fix
ValueTransformin nullable type does not allow null values.
4.0.1 #
- Fix
input.updateValueshouldTriggerOnChangeparameter, so now next updates already triggeronChange.- Add tests.
- Fix code so it is valid Dart 3.6.0 (Flutter 3.27).
4.0.0 #
Breaking change release
-
Specialized versions of inputs such as
IntInputorStringInputwere renamed toGlade*Input. -
Removed specialized version factories. Now specialized versions are sub-classes of GladeInput
- This removes the weird possibility to create calls such as
StringInput.intInput()which in the end threw a runtime exception due to type mismatch.
- This removes the weird possibility to create calls such as
-
Renamed
valueConverterincreate()factory to match internal namestringToValueConverterwhich is more explicit -
Rename
resetToPure()toresetToInitialValue() -
Change
setAsNewPuretosetNewInitialValue()- Updates input to new initial value
- Optionally input's value can be reset into new initial value (
shouldResetToInitialValueargument).
-
On Model level
- Rename
resetToPure()toresetToInitialValue() - Change
setAsNewPuretosetInputValuesAsNewInitialValues()- Updates all inputs to new initial value
- Optionally input's value can be reset into new initial value (
shouldResetToInitialValueargument).
- Rename
-
Rename
GladeModelDebugInfotoGladeFormDebugInfoto align with other widgets. -
Rename
GadeModelDebugInfoModaltoGladeFormDebugInfoModal. -
Rename ValidatorResult.
isInvalidtoisNotValidto align with properties in GladeInput and GladeModel. -
Added
setNewInitialValueAsCurrentValuemethod as shorthand for setting new initial value as current input's value. -
Added
GladeDateTimeInput- specialized GladeInput for DateTime inputs. -
Added
inclusiveargument forintvalidations. -
GladeIntInputandGladeDateTimeInputoffer *Nullable versions to support null valuesStringInputdoes not offer a nullable version as we believe that in most cases you don't really need to differentiate between a null string and an empty string. Feel free to open an issue if you disagree.
-
Added Add
isPositive()andisNegative()to Int validator. -
Added Add
validationErrorsgetter as shorthand for getting input's error -
Added Add several extension methods on List of GladeInputError such as
hasErrorKey(). -
Fixed Input did not propagate initialValue into TextEditingController.
-
Fixed Fix nullability value in
devErrorcallback in validator.
3.1.1 #
- Add typedefs
IntInputandBooleanInput - Fix GladeModelDebugInfo colors in DarkMode.
3.1.0 #
- updated dependencies
3.0.1 #
3.0.0 #
Breaking change release
- [Add]: Add
allowBlankparameter toisEmptystring validator. - [Add]: Add
IntInputas a specialized variant of GladeInput - [Add]: Support skipping particular validation with
shouldValidatecallback. - [Breaking]: The
resetToPuremethod on both GladeInput and GladeModel has been renamed tosetAsNewPure. This change better reflects the method's behavior of setting a new pure state rather than resetting to the original state. - [Add]: New
resetToPuremethod added to both GladeInput and GladeModel. This method truly resets the input(s) to their initial value(s) and marks them as pure.
2.3.0 #
- RETRACTED version, should be 3.0.0
2.2.0 #
- [Add]: Add
resetToPureon model level.
2.1.0 #
- [Add]: Add
defaultTranslateErroron model level.
2.0.1 #
- [Fix]: Fix
isUri()to handle URL corectly
2.0.0 #
- [Breaking]: TextEditingController is no more created automatically. When TextEditingController is used, input's behavior is slightly changed. See README.md for full info.
- [Breaking]: GladeInput's controller is now private. Use factory constructors to create input.
- [Breaking]:
Extraparameter removed - [Breaking]:
dependenciesare no longer passed intoonChangeand in validator. - [Breaking]: GladeInput is no longer ChangeNotifier
- [Add]: onDependencyChange - callback is called when any (or multiple with groupEdit()) dependency was udpated.
- Improvement: GladeModelDebugInfo now colorize String values to visualize whitespace.
1.6.0 #
- Improvement: GladeModelDebugInfo is more colorful and polished.
- Improvement: Support deep collection equality when comparing
valueandinitialValue. - [Feat]:
allInputsgetter to support "dynamic" model's inputs validation.
1.5.0 #
- [Feat]: Add
updateWhenNotNullto support shorthand syntax for Widgets with nullable type parameter.
1.4.0 #
- [Feat]: Support non-data-holding inputs to enable "view" inputs.
- [Feat]: Add the
shouldTriggerOnChangeparameter toupdateValueso one can opt-out fromonChangecallback being triggered. - [Fix]: Export
ChangesInfo.
1.3.2 #
- [Fix]:
GladeInputnow preserves selection. (Before, a cursor jumped at the end.)
1.3.1 #
- [Fix]: Fixed
GladeInput.createassert to allow null forvalueandinitialValuewhen input's type is nullable.
1.3.0 #
- [Fix]: When using
GladeInput.create, passing onlyvalueended up in UI vs model not being synced. Now that's fixed. - [Breaking]: StringInput only works with
Stringnow.
1.2.1 #
- [Fix]: Value passed to factory constructor is not reflected in TextController.
1.2.0 #
- [Feat]: Add
GladeFormListenerwidget allowing to listen for model's changes - [Feat]: Add
groupEdit()method in GladeModel allows to update multiple inputs at once.- Works great with
GladeFormListener
- Works great with
- [Feat]: Add
valueTransformin GladeInput. Transform value before it is assigned into value.- Firstly
stringToTypeConverteris called if needed, thenvalueTransform.
- Firstly
- [Feat]: Add
updateValue(T value)as shorthand for inputs when field is not TextField. - [Feat]: Add
resetToPuremethod allowing to reset input into pure state. - [Fix]: Conversion error does not update model's stats and formatted errors.
1.1.2 #
- Fix links in readme
1.1.1 #
- Improve Readme
1.1.0 #
- [Feat]: Add
onChange- support for listening changes and potentially update other inputs based on change
- [Feat]: GladeInput exports TextEditingController now for connecting it with FormField properly
- [Breaking]: StringInput is now alias. Use
GladeInput.stringInputto create string variant
1.0.1 #
- Fix example
1.0.0 #
- Initial version.