lucid_validation 1.4.0
lucid_validation: ^1.4.0 copied to clipboard
A Dart/Flutter package for building strongly typed validation rules inspired by FluentValidation and created by the Flutterando community.
1.4.0 #
- Added
ValidationResulthelpers:errorsByKey(errors grouped by field) andfirstErrorFor(key). - Added
validateAndThrow/validateAndThrowAsync, throwing aLucidValidationExceptionwith all failures. - Added numeric
inclusiveBetween/exclusiveBetweenvalidators (previously only available forDateTime). - Added
validUrl,length(min, max),isInEnumandprecisionScalevalidators (each with anOrNullvariant). - Added
withMessage,withErrorCodeandwithNamefor fluent, chained customization of the previous rule. - Added asynchronous validation:
mustAsync,mustWithAsync,useAsyncandLucidValidator.validateAsync. - Added
ruleForEachto validate each item of a collection inline (without a dedicated validator class). - Added rule sets via
ruleSet(name, () {...})andvalidate(entity, ruleSets: [...]). - Added
includeto compose/reuse validators of the same entity type. - Added
unless(the inverse ofwhen);whenandunlessnow compose. - Added
normalizeto sanitize a value before validation (e.g. trim/lowercase) without mutating the entity. - Added
switchOnfor polymorphic/branching validations based on discriminator values (e.g. enums, Strings, ints). - Added
LucidValidator.inlinefactory constructor to build validators on the fly without subclassing. - Added
rulesForFieldandrulesForFieldAsyncto evaluate and inspect the status of all rules on a specific field (e.g. for password checklist widgets). - Added
getExceptionsandgetExceptionsByKeyto directly retrieve raw lists of validation exceptions. - Added
useanduseAsyncbuilders to manually construct custom rules with full control over the createdValidationException.
1.3.1 #
- Added nullable support for phone number validation
1.3.0 #
- Added support for list validation using
setEach, allowing nested validators with index-aware error reporting.
1.2.7 #
- Aded hasNoSequentialRepeatedCharacters and hasNoSequentialCharacters
1.2.6 #
- Aded validPhoneWithCountryCodeBR and validPhoneBR
1.2.5 #
- Aded Exception serialization
1.2.4 #
- Fix overrideCallback in byField
1.2.3 #
- Added overrideCallback in byField
1.2.2 #
- Added validCPFOrCNPJ
1.2.1 #
- Added getExceptions and getExceptionsByKey
1.2.0 #
- Added support nullable
1.1.0 #
- Added Label
1.0.1 #
- Added valid greaterThanOrEqualTo, greaterThan, lessThanOrEqualTo, lessThan, inclusiveBetween and exclusiveBetween
1.0.0 #
- Production release
0.0.7 #
- Added
whenandsetValidator
0.0.5 #
- Added must and mustWith
0.0.3 #
- Added Cascade Mode
0.0.2 #
- Added valid CEP, CNPJ and CreditCard
0.0.1+1 #
- Initial Release