just_validation 0.3.0 copy "just_validation: ^0.3.0" to clipboard
just_validation: ^0.3.0 copied to clipboard

A simple and flexible validation library for Dart that provides validators for common use cases.

Changelog #

All notable changes to this project will be documented in this file.

0.3.0 - 2026-01-26 #

Added - Isolate Validation (Parallel Processing) #

  • Isolate validation support: Execute validations in separate isolates using Isolate.run
  • New methods for parallel validation:
    • validateIsolate(instance): Validate a single instance in an isolate
    • validateManyIsolate(instances): Validate multiple instances in an isolate (batch processing)
    • validateAsyncIsolate(instance): Async validation in an isolate
  • No dependencies required: Uses Dart SDK 2.19+ built-in Isolate.run
  • Universal support: Works in Flutter apps, backend Dart, CLI tools, and web
  • Performance optimized: Perfect for batch processing (1000+ objects) and computationally expensive validations
  • 11 new tests: Complete test coverage for isolate validation

Technical Details #

  • Requires Dart SDK 2.19 or higher
  • Zero additional dependencies (uses dart:isolate)
  • Overhead: ~5-10ms per isolate creation
  • Ideal for:
    • CSV/Excel import (1000+ records)
    • Background batch processing
    • Complex validations (50+ rules)
    • Flutter apps that cannot block UI
    • Backend data processing

0.2.0 - 2026-01-25 #

Added - Advanced Validators #

  • IP Address validation: IPv4, IPv6, or both formats
  • MAC Address validation: Supports colon, hyphen, and no-separator formats
  • GPS Coordinates validation: Latitude (-90 to 90) and Longitude (-180 to 180)
  • Credit Card validation: Luhn algorithm, 13-19 digits, supports spaces/hyphens
  • IBAN validation: Full Mod-97 algorithm, 52 countries supported
  • ISBN validation: ISBN-10 and ISBN-13 with checksum validation
  • UUID validation: Versions 1, 2, 3, 4, and 5
  • Postal Code validation: 129 countries worldwide organized by region
    • América del Norte (12): US, CA, MX, CR, PA, GT, SV, HN, NI, CU, DO, PR
    • América del Sur (10): BR, AR, CL, CO, PE, VE, EC, BO, PY, UY
    • Europa Occidental (18): GB, FR, DE, ES, IT, NL, BE, CH, AT, PT, IE, LU, MC, AD, SM, LI, VA, GI
    • Europa Nórdica (5): SE, NO, DK, FI, IS, FO, GL
    • Europa Oriental (25): PL, CZ, SK, HU, RO, BG, HR, SI, EE, LV, LT, UA, BY, MD, RS, BA, MK, AL, GR, CY, MT, ME, XK
    • Rusia y Asia Central (5): RU, KZ, AM, AZ, GE
    • Asia Oriental (6): JP, CN, KR, TW, HK, MO
    • Sudeste Asiático (10): TH, VN, MY, SG, ID, PH, MM, KH, LA, BN
    • Asia del Sur (7): IN, PK, BD, LK, NP, BT, MV
    • Oriente Medio (13): TR, IL, SA, AE, QA, KW, BH, OM, JO, LB, IQ, IR, PS
    • África (13): ZA, EG, MA, DZ, TN, LY, KE, NG, ET, GH, MR, MU, LC
    • Oceanía (5): AU, NZ, PG, FJ, VG

Added - Inline Validation Extensions #

  • All 8 advanced validators available as inline extensions
  • .validateIPv4, .validateIPv6, .validateMACAddress
  • .validateLatitude, .validateLongitude
  • .validateCreditCard, .validateIBAN, .validateISBN, .validateUUID

Added - Examples and Tests #

  • New example: advanced_validation_example.dart demonstrating all advanced validators
  • 39 new tests for advanced validators (Validator Pattern + Inline)
  • Total tests: 104 (all passing ✅)

Statistics #

  • Total validators: 28 (20 basic + 8 advanced)
  • Total tests: 104 (100% passing)
  • Total lines of code: ~2,762 lines
  • Code coverage: 100% on core functionality

0.1.0 #

Initial Release #

Core Features

  • ✅ Fluent API for building validation rules
  • ✅ Strong typing and null-safety support
  • ✅ Comprehensive built-in validators

String Validators

  • notEmpty() - Ensures string is not empty
  • notNull() - Ensures value is not null
  • length(min, max) - Validates string length range
  • minLength(length) - Validates minimum length
  • maxLength(length) - Validates maximum length
  • exactLength(length) - Validates exact length
  • emailAddress() - Validates email format
  • url() - Validates URL format
  • matches(regex) - Validates against regex pattern
  • alpha() - Validates alphabetic characters only
  • alphanumeric() - Validates alphanumeric characters only

Number Validators

  • greaterThan(value) - Value must be greater than specified
  • greaterThanOrEqual(value) - Value must be greater than or equal
  • lessThan(value) - Value must be less than specified
  • lessThanOrEqual(value) - Value must be less than or equal
  • inclusiveBetween(from, to) - Value must be within inclusive range
  • exclusiveBetween(from, to) - Value must be within exclusive range

Comparison Validators

  • equal(value) - Value must equal specified value
  • notEqual(value) - Value must not equal specified value
  • equalTo(property) - Value must equal another property
  • notEqualTo(property) - Value must not equal another property

Collection Validators

  • notEmpty() - Collection must not be empty
  • minLength(length) - Collection must have minimum items
  • maxLength(length) - Collection must have maximum items
  • exactLength(length) - Collection must have exact number of items

Custom Validators

  • must(predicate, message) - Custom synchronous validation
  • mustWith(predicate, message) - Custom validation with object context
  • mustAsync(predicate, message) - Custom asynchronous validation
  • mustAsyncWith(predicate, message) - Custom async validation with context

Advanced Features

  • Conditional validation with when() and unless()
  • Custom error messages with withMessage()
  • Cascade modes (continue or stop on first failure)
  • Nested object validation with ruleForEach()
  • Asynchronous validation support
  • Rich validation results with detailed error information

Documentation

  • Comprehensive README with examples
  • API documentation with dartdoc comments
  • Example applications demonstrating:
    • Basic validation
    • Complex nested validation
    • Asynchronous validation
    • Flutter integration

Testing

  • 47+ unit tests covering all validators
  • Integration tests for complex scenarios
  • 100% code coverage on core functionality
2
likes
160
points
124
downloads

Publisher

unverified uploader

Weekly Downloads

A simple and flexible validation library for Dart that provides validators for common use cases.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on just_validation