mayr_validator 1.0.0
mayr_validator: ^1.0.0 copied to clipboard
A powerful yet elegant validation library for Dart and Flutter, inspired by Laravel's validator syntax and philosophy.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.0 - 2025-10-10 #
Added #
- π Initial release of MayrValidations
- β
Core
MayrValidationCoresingleton for global configuration - β
Fluent
MayrValidatorclass for chainable validation - β
Extension method
mayrValidator()on String - β
Comprehensive validation rules inspired by Laravel:
- Boolean validators:
accepted(),boolean(),declined() - String validators:
required(),min(),max(),email(),url(),alpha(),alphaNum(),alphaDash(),ascii(),lowercase(),uppercase(),regex(),notRegex(),startsWith(),endsWith(),doesntStartWith(),doesntEndWith(),uuid(),ulid(),ipAddress(),macAddress(),hexColor(),json(),inList(),notIn(),same(),different() - Number validators:
numeric(),integer(),decimal(),between(),gt(),gte(),lt(),lte(),digits(),digitsBetween(),multipleOf() - Array validators:
array(),contains(),doesntContain(),distinct() - Date validators:
date(),after(),afterOrEqual(),before(),beforeOrEqual(),dateEquals() - Utility validators:
nullable(),requiredIf(),requiredUnless()
- Boolean validators:
- β
Custom rule registration with
registerRule() - β
Validation group registration with
registerGroup() - β Environment-aware error handling (dev vs prod)
- β Global configuration for messages and defaults
- β
Message template support with placeholders (
{min},{max}, etc.) - β Debounce support for validation execution
- β Comprehensive test suite with 71+ tests
- β Pure Dart and Flutter examples
- β Full documentation with dartdoc comments
Features #
- π§© Fluent API - Chain validation rules like Laravel
- βοΈ Global Configuration - Define global defaults and messages
- π Reusable Groups - Register and reuse complex validation patterns
- π§± Custom Validators - Extend with your own validation logic
- β‘ Debounce Support - Control when validations run
- π§ββοΈ Standalone or Flutter-ready - Works in pure Dart and Flutter