PackageTrack
Sign in Get early access

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 2026
2025 2026
Release Pre-release

Releases

latest 21
  1. 1.4.0 09 Jun 2026
    Release notes

    What's Changed

    • Added ValidationResult helpers: errorsByKey (errors grouped by field) and firstErrorFor(key).
    • Added validateAndThrow / validateAndThrowAsync, throwing a LucidValidationException with all failures.
    • Added numeric inclusiveBetween / exclusiveBetween validators (previously only available for DateTime).
    • Added validUrl, length(min, max), isInEnum and precisionScale validators (each with an OrNull variant).
    • Added withMessage, withErrorCode and withName for fluent, chained customization of the previous rule.
    • Added asynchronous validation: mustAsync, mustWithAsync, useAsync and LucidValidator.validateAsync.
    • Added ruleForEach to validate each item of a collection inline (without a dedicated validator class).
    • Added rule sets via ruleSet(name, () {...}) and validate(entity, ruleSets: [...]).
    • Added include to compose/reuse validators of the same entity type.
    • Added unless (the inverse of when); when and unless now compose.
    • Added normalize to sanitize a value before validation (e.g. trim/lowercase) without mutating the entity.
    • Added switchOn for polymorphic/branching validations based on discriminator values (e.g. enums, Strings, ints).
    • Added LucidValidator.inline factory constructor to build validators on the fly without subclassing.
    • Added rulesForField and rulesForFieldAsync to evaluate and inspect the status of all rules on a specific field (e.g. for password checklist widgets).
    • Added getExceptions and getExceptionsByKey to directly retrieve raw lists of validation exceptions.
    • Added use and useAsync builders to manually construct custom rules with full control over the created ValidationException.
    Open source →
    Release notes
    • Added ValidationResult helpers: errorsByKey (errors grouped by field) and firstErrorFor(key).
    • Added validateAndThrow / validateAndThrowAsync, throwing a LucidValidationException with all failures.
    • Added numeric inclusiveBetween / exclusiveBetween validators (previously only available for DateTime).
    • Added validUrl, length(min, max), isInEnum and precisionScale validators (each with an OrNull variant).
    • Added withMessage, withErrorCode and withName for fluent, chained customization of the previous rule.
    • Added asynchronous validation: mustAsync, mustWithAsync, useAsync and LucidValidator.validateAsync.
    • Added ruleForEach to validate each item of a collection inline (without a dedicated validator class).
    • Added rule sets via ruleSet(name, () {...}) and validate(entity, ruleSets: [...]).
    • Added include to compose/reuse validators of the same entity type.
    • Added unless (the inverse of when); when and unless now compose.
    • Added normalize to sanitize a value before validation (e.g. trim/lowercase) without mutating the entity.
    • Added switchOn for polymorphic/branching validations based on discriminator values (e.g. enums, Strings, ints).
    • Added LucidValidator.inline factory constructor to build validators on the fly without subclassing.
    • Added rulesForField and rulesForFieldAsync to evaluate and inspect the status of all rules on a specific field (e.g. for password checklist widgets).
    • Added getExceptions and getExceptionsByKey to directly retrieve raw lists of validation exceptions.
    • Added use and useAsync builders to manually construct custom rules with full control over the created ValidationException.
    Open source →
  2. 1.3.1 19 Apr 2025
    Release notes

    v1.3.1

    What's Changed

    • Added nullable support for phone number validation

    Full Changelog: v1.3.0...v1.3.1

    Open source →
    Release notes
    • Added nullable support for phone number validation
    Open source →
    Release notes

    What's Changed

    • Added nullable support for phone number validation

    Full Changelog: v1.3.0...v1.3.1

    Open source →
  3. 1.3.0 14 Apr 2025
    Release notes

    v1.3.0

    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

    Open source →
    Release notes
    • Added support for list validation using setEach, allowing nested validators with index-aware error reporting.
    Open source →
  4. 1.2.7 14 Apr 2025
    Release notes

    What's Changed

    • Aded hasNoSequentialRepeatedCharacters and hasNoSequentialCharacters
    • Aded validPhoneWithCountryCodeBR and validPhoneBR

    New Contributors

    Full Changelog: v1.2.5...v1.2.7

    Open source →
    Release notes
    • Aded hasNoSequentialRepeatedCharacters and hasNoSequentialCharacters
    Open source →
  5. 1.2.5 09 Feb 2025
    Release notes

    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

    Open source →
    Release notes
    • Aded Exception serialization
    Open source →
  6. 1.2.4 23 Jan 2025
    Release notes
    • Fix overrideCallback in byField
    Open source →
  7. 1.2.3 23 Jan 2025
    Release notes
    • Added overrideCallback in byField
    Open source →
  8. 1.2.2 23 Jan 2025
    Release notes
    • Added validCPFOrCNPJ
    Open source →
  9. 1.2.1 23 Jan 2025
    Release notes
    • Added getExceptions and getExceptionsByKey
    Open source →
  10. 1.2.0 19 Dec 2024
    Release notes

    What's Changed

    • [DRAFT] feature: initial proposal of 'is not null' by @wellgenio in #3

    New Contributors

    Full Changelog: v1.1.0...v1.2.0

    Open source →
    Release notes
    • Added support nullable
    Open source →
  11. 1.1.0 08 Oct 2024
    Release notes
    • Added Label
    Open source →
  12. 1.0.1 29 Aug 2024
    Release notes
    • Added valid greaterThanOrEqualTo, greaterThan, lessThanOrEqualTo, lessThan, inclusiveBetween and exclusiveBetween
    Open source →
  13. 1.0.0 27 Aug 2024
    Release notes
    • Production release
    Open source →
  14. 0.0.7 25 Aug 2024
    Release notes
    • Added when and setValidator
    Open source →
  15. 0.0.6 25 Aug 2024

    Nothing published for this version

  16. 0.0.5 24 Aug 2024
    Release notes
    • Added must and mustWith
    Open source →
  17. 0.0.4 24 Aug 2024

    Nothing published for this version

  18. 0.0.3 24 Aug 2024
    Release notes
    • Added Cascade Mode
    Open source →
  19. 0.0.2 24 Aug 2024
    Release notes
    • Added valid CEP, CNPJ and CreditCard
    Open source →
  20. 0.0.1 24 Aug 2024

    Nothing published for this version

  21. 0.0.1+1 24 Aug 2024
    Release notes
    • Initial Release
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive