Skip to content

Form Builder Validator URLs: Make url validator case insensitive #67

@mboyamike

Description

@mboyamike

Is there an existing issue for this?

  • I have searched the existing issues

Package/Plugin version

^9.0.0-dev.1

Platforms

  • Android
  • iOS
  • Linux
  • MacOS
  • Web
  • Windows

Flutter doctor

Flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
  [✓] Flutter (Channel stable, 3.13.8, on macOS 13.5 22G74 darwin-arm64, locale en-KE)
  [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
  [!] Xcode - develop for iOS and macOS (Xcode 15.0.1)
      ✗ Unable to get list of installed Simulator runtimes.
  [✓] Chrome - develop for the web
  [!] Android Studio (version unknown)
      ✗ Unable to determine Android Studio version.
  [✓] Android Studio (version 2022.1)
  [✓] VS Code (version 1.71.2)
  [✓] Connected device (2 available)
      ! Error: Browsing on the local area network for Mboya’s iPhone. Ensure the device is unlocked and attached with a cable or associated with
      the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
  [✓] Network resources

Minimal code example

Code sample
  /// Inside a formbuildertextfield
  validator: FormBuilderValidators.compose([
   FormBuilderValidators.url()
  ]),

Current Behavior

Upon entering a capital letter on the top level domain, the validator fails showing that the URL is invalid.
For example:
HTTPS://WWW.GOOGLE.COM - invalid link
https://www.google.com - valid link
https://WWW.GOOGLE.com - valid link
HTTPS://WWW.GOOGLE.COM - invalid link

Expected Behavior

I believe the URL should be case insensitive. Any part of it having a capital letter should not invalidate the URL
While this is my exact case I'm not sure if it's valid for everyone. If given the go-ahead I could modify the REGEX pattern to include capital letters for the top level domain.

Steps To Reproduce

  1. Create a formbuildertextfield
  2. add a formbuildervalidators.url as the textfield's validator
  3. Run the project and try to type a url with a capital letter for the top level domain e.g. https://google.Com instead of https://google.com

Aditional information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions