x_validators 2.0.0
x_validators: ^2.0.0 copied to clipboard
Simple, composable, zero-dependency form and text validation for Dart and Flutter. Stack rules and plug straight into TextFormField.
[1.0.0]-[2-1-2024] initial version #
- initial version
[1.0.1]-[2-1-2024] initial version #
- fix readme
[1.0.2]-[8-1-2024] Update README #
- refactor:โป๏ธ ๐๏ธ Improve code readability
[1.0.3]-[8-1-2024] Update README #
- fix readme
[1.0.4]-[8-1-2024] Update README #
- refactor:โป๏ธ ๐๏ธ Improve code readability
- docs:๐ Update README
[1.0.5]-[11-1-2024] fix #
- refactor:โป๏ธ ๐๏ธ Improve code readability
- docs:๐ Update README
- fix: ๐ ๏ธ๐Fixed the Bug with v1.0.4
[1.0.6]-[11-1-2024] Update README #
- refactor:โป๏ธ ๐๏ธ Improve code readability
[1.0.7]-[11-1-2024] Update DOC #
- docs:๐ Update Doc
[1.0.8]-[21-04-2024] Update DOC #
- docs:๐ Update Doc (Support Palestine)
[1.1.0]-[01-06-2026] Exports, consistency & full test suite #
- fix: ๐ Export previously-unreachable rules (
IsIpAddress,IsSecureUrl,IsArabicChars,IsEnglishChars,IsNumbersOnly) - fix: ๐ Export the
XValidatorsLocalizationhook so custom error-message translation is usable by consumers - feat: โจ Add
constconstructors across all rules for cleaner, allocation-free usage - test: โ
Add a comprehensive unit-test suite covering every rule and the
xValidatororchestrator - docs:๐ Rewrite the README with accurate API tables, localization and custom-rule guides
- chore: ๐งน Resolve all
dart analyzeissues
[1.2.0]-[01-06-2026] Docs, full coverage & SDK bump #
- chore: โฌ๏ธ Raise the minimum Dart SDK to
^3.8.0 - docs: ๐ Add dartdoc across the public rule API (classes and validation functions) and fix several inaccurate/typo'd doc strings
- test: โ
Expand the suite to 100% line coverage (149 tests): quoted & IP-literal (IPv4/IPv6) email parsing, default-message (
toString) contracts, numericmin/maxraw-numpaths, andcontainsAnytrim/case flags - chore: โฌ๏ธ Bump the example app to
flutter_lints^6.0.0 - style: ๐จ Adopt the Dart "tall" formatting style
[1.3.0]-[01-06-2026] Message API, key cleanup, RegExp hoisting & IsOptional fix #
- feat: โจ Add a dedicated
defaultMessagegetter as the message API for rules; the base implementation delegates totoString(), so existing custom rules that overridetoString()keep working unchanged - fix: ๐
IsOptionalis now honored regardless of its position in the rule list โ optionality is resolved by an up-front scan, fixing the case where an empty value wrongly failed whenIsOptionalwas placed after another rule - fix: ๐ Normalize malformed/typo'd default-message keys to stable
validation.*keys (is_notportโis_not_port, hex-color, date-after, min/max length, url, facebook/instagram/youtube url, required); consumers using an inlineerror:or a registered translator are unaffected - perf: โก Hoist per-call
RegExps to top-levelfinalconstants (compiled once) across the phone, language, number, url and color rules, and collapse the hex-color check from two patterns into one - refactor: โป๏ธ Remove dead branches in
match,minValueandmaxValue - chore: ๐๏ธ Deprecate the no-op
ContainsAny.caseSensitivefield (currently ignored; it will be wired up as a constructor parameter in v2.0.0) - test: โ
Migrate the default-message contracts to
defaultMessage, add anIsOptionalposition-independence regression anddefaultMessagefallback-chain coverage (152 tests)
[2.0.0]-[01-06-2026] Breaking: behavior corrections & tightened rules #
This is a behavior-only major release. The public API shape is unchanged (same
rules, same xValidator signature); several rules were tightened to match their
names. See the Migrating to 2.0.0 guide in the README for adaptation steps.
- BREAKING fix: ๐
nullinput is now treated as an empty string instead of short-circuiting the validator to "valid", soIsRequiredcorrectly rejectsnull; addIsOptionalto let empty/nullpass - BREAKING fix: ๐
IsNumbernow accepts integers only (decimals, hex and scientific notation are rejected) โ use the newIsDecimalrule for fractional values - BREAKING feat: โจ Add
IsDecimalrule +isDecimalhelper (backed bydouble.tryParse, keyvalidation.must_be_double) for fractional-number validation - BREAKING fix: ๐
IsArabicCharsnow accepts Arabic-Indic digitsู -ูฉonly; the previous\p{N}token (no unicode flag) matched the literal charactersp{N}and no real digits - BREAKING fix: ๐
IsNumbersOnlyis now anchored (^[0-9]+$) and passes only when the whole input is digits, instead of passing whenever a digit appeared anywhere - BREAKING fix: ๐ Anchor
IsFacebookUrl,IsInstagramUrlandIsYoutubeUrlso domain-suffix spoofing (e.g.https://facebook.com.evil.com) is rejected - BREAKING fix: ๐
IsIpAddressnow uses a strict dotted-quad regex โ leading zeros (192.168.001.001) and surrounding/embedded whitespace are rejected - BREAKING fix: ๐ Wire up
ContainsAny.caseSensitiveas a real constructor parameter;errormoves from a positional to a named argument (ContainsAny(values, {caseSensitive = false, error})) - BREAKING fix: ๐ Give
IsArabicNumandIsHindiNumdistinct default-message keys (validation.must_be_arabic_num/validation.must_be_hindi_num) instead of the sharedvalidation.must_be_num - feat: โจ Broaden
IsUrlto accept hyphenated hosts, deep subdomains and long TLDs (https://my-site.co.uk,https://a.b.example.com,https://example.museum) - refactor: โป๏ธ Remove static mutable parser state from
EmailXValidator; eachvalidatecall now runs on a fresh single-use parser (public signature and behavior unchanged) - refactor: โป๏ธ Rename the typo'd
isInstgramUrlValidhelper toisInstagramUrlValid(old name kept as a@Deprecatedalias) and the filestext/is_not_empty.dartโtext/is_required.dartandurls/is_instgram_url.dartโurls/is_instagram_url.dart - docs: ๐ Add a "Migrating to 2.0.0" guide and update the API tables, localization resolution order and "Good to know" notes
- test: โ
Update and extend the suite for every behavior change (new
IsDecimaland strict-IP groups, flipped known-behavior cases)