flutter-form-builder-ecosystem / flutter-form-builder-ecosystem/form_builder_phone_field

Phone Number should auto Validate according to selected country code

Open
#64 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Dart
Stars
11
Forks
25
PR merge metrics
No merged PRs in 30d

Description

Is there an existing issue for this?
  • I have searched the existing issues
Package/Plugin version

2.0.1

Platforms
  • Android
  • iOS
  • Linux
  • MacOS
  • Web
  • Windows
Flutter doctor

[√] Flutter (Channel stable, 3.19.2, on Microsoft Windows [Version 10.0.22621.3737], locale en-AE)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
X cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
X Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.36)
[√] Android Studio (version 2024.1)
[√] Connected device (4 available)
[√] Network resources

! Doctor found issues in 1 category.

Minimal code example

FormBuilderPhoneField(
name: 'phone_number',autovalidateMode: AutovalidateMode.always,
validator: FormBuilderValidators.compose([
FormBuilderValidators.required(
errorText: ''),
FormBuilderValidators.numeric(
errorText: ''),
]),
),

Current Behavior

It is not validating phone number depending on country code selected.

Expected Behavior

It should validating phone number depending on country code selected.

Steps To Reproduce

FormBuilderPhoneField(
name: 'phone_number',autovalidateMode: AutovalidateMode.always,
validator: FormBuilderValidators.compose([
FormBuilderValidators.required(
errorText: ''),
FormBuilderValidators.numeric(
errorText: ''),
]),
),

Aditional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the FormBuilderPhoneField implementation and trace how the selected country code and validator are handled. Reproduce the provided example on Android or iOS with valid and invalid numbers for different countries; done means validation changes appropriately when the selected country changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.