lucid_validation
A Dart/Flutter package for building strongly typed validation rules inspired by FluentValidation and created by the Flutterando community.
1.4.0
4.8K downloads/mo
#3900 most downloaded on pub.dev
Flutterando/lucid_validation
What this package is like to depend on
Last release 2 months ago
09 Jun 2026
Ships unpredictably
gaps range from 2 weeks to 1.2 years
Most releases are documented
notes for 18 of 21 stable releases
Nothing withdrawn
no release was ever pulled
2 years old
21 releases · first in 2024
1 release in the last 12 months
see the full history below
Release timeline
21 releases · Aug 2024 to Jun 2026Releases
latest 21-
1.4.009 Jun 2026Release notes
Open source →What's Changed
- 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.
Release notes
Open source →- 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.
- Added
-
1.3.119 Apr 2025Release notes
Open source →Release notes
Open source →What's Changed
- Added nullable support for phone number validation
Full Changelog: v1.3.0...v1.3.1
-
1.3.014 Apr 2025Release notes
Open source →What's Changed
- Added support for list validation using
setEach, allowing nested validators with index-aware error reporting.
Full Changelog: v1.2.7...v1.3.0
Release notes
Open source →- Added support for list validation using
setEach, allowing nested validators with index-aware error reporting.
- Added support for list validation using
-
1.2.714 Apr 2025Release notes
Open source →What's Changed
- Aded hasNoSequentialRepeatedCharacters and hasNoSequentialCharacters
- Aded validPhoneWithCountryCodeBR and validPhoneBR
New Contributors
Full Changelog: v1.2.5...v1.2.7
-
1.2.509 Feb 2025Release notes
Open source →What's Changed
- docs: update README for English localization instructions by @andre-morpanini-maersk in #4
New Contributors
- @andre-morpanini-maersk made their first contribution in #4
Full Changelog: v1.2.4...v1.2.5
-
1.2.423 Jan 2025 -
1.2.323 Jan 2025 -
1.2.223 Jan 2025 -
1.2.123 Jan 2025 -
1.2.019 Dec 2024Release notes
Open source →What's Changed
- [DRAFT] feature: initial proposal of 'is not null' by @wellgenio in #3
New Contributors
- @wellgenio made their first contribution in #3
Full Changelog: v1.1.0...v1.2.0
-
1.1.008 Oct 2024 -
1.0.129 Aug 2024Release notes
Open source →- Added valid greaterThanOrEqualTo, greaterThan, lessThanOrEqualTo, lessThan, inclusiveBetween and exclusiveBetween
-
1.0.027 Aug 2024 -
0.0.725 Aug 2024 -
0.0.625 Aug 2024Nothing published for this version
-
0.0.524 Aug 2024 -
0.0.424 Aug 2024Nothing published for this version
-
0.0.324 Aug 2024 -
0.0.224 Aug 2024 -
0.0.124 Aug 2024Nothing published for this version
-
0.0.1+124 Aug 2024