feat: Validator.compose and stricter URL, date, and int checks - #7
Merged
Merged
Conversation
Empty-host URLs, overflow calendar dates, and hex integer literals were accepted as valid. Compose lets forms combine required with other rules without ?? chaining, and the package no longer requires the Flutter SDK.
divyanshub024
force-pushed
the
dv/1.3.0-compose-and-strict-validators
branch
from
September 21, 2026 11:16
8c3a8a0 to
80476f2
Compare
dart pub get also resolves example/, which needs the Flutter SDK. The package job is Dart-only, so skip that extra resolution.
dart analyze at the repo root still walked into example/ without a Flutter SDK. Exclude that tree and analyze only lib and test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validator.composeso Flutter forms can combinerequiredwith other rules without??chaining; drop the circular barrel import inform_validator.dart.https://,http://.), calendar overflow (2023-13-01,2023-02-29), and hex integer literals (0x10) as invalid.dart-lang/setup-dart, and cache hot-path regexes.Test plan
dart analyzeanddart testpassValidator.compose([required(), email()])rejects empty/null/whitespace and invalid emails, and accepts a real emailhttps://,http://., andhttp://foofailisURL;http://localhostandhttps://example.comstill pass2023-13-01and2023-02-29failisDate;2024-02-29and ISO timestamps still pass0x10/0X10failisInt;'01'and'123 'still passpubspec.yamlhas noflutter:environment key