Skip to content

feat: Validator.compose and stricter URL, date, and int checks - #7

Merged
divyanshub024 merged 3 commits into
mainfrom
dv/1.3.0-compose-and-strict-validators
Sep 21, 2026
Merged

divyanshub024 merged 3 commits into
mainfrom
dv/1.3.0-compose-and-strict-validators

Conversation

@divyanshub024

@divyanshub024 divyanshub024 commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add Validator.compose so Flutter forms can combine required with other rules without ?? chaining; drop the circular barrel import in form_validator.dart.
  • Treat empty-host URLs (https://, http://.), calendar overflow (2023-13-01, 2023-02-29), and hex integer literals (0x10) as invalid.
  • Make the package pure Dart (no Flutter SDK constraint), switch CI to dart-lang/setup-dart, and cache hot-path regexes.

Test plan

  • dart analyze and dart test pass
  • Validator.compose([required(), email()]) rejects empty/null/whitespace and invalid emails, and accepts a real email
  • https://, http://., and http://foo fail isURL; http://localhost and https://example.com still pass
  • 2023-13-01 and 2023-02-29 fail isDate; 2024-02-29 and ISO timestamps still pass
  • 0x10 / 0X10 fail isInt; '01' and '123 ' still pass
  • Example form email field uses compose so an empty submit is rejected
  • pubspec.yaml has no flutter: environment key

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
divyanshub024 force-pushed the dv/1.3.0-compose-and-strict-validators branch from 8c3a8a0 to 80476f2 Compare September 21, 2026 11:16
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.
@divyanshub024
divyanshub024 merged commit 2a4a4d5 into main Sep 21, 2026
1 check passed
@divyanshub024
divyanshub024 deleted the dv/1.3.0-compose-and-strict-validators branch September 21, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant