Skip to content

fix(authenticator): enforce required validation for empty phone number field - #7296

Open
VarshithaPamisetty wants to merge 1 commit into
mainfrom
fix/authenticator-phone-field-required-validation
Open

fix(authenticator): enforce required validation for empty phone number field#7296
VarshithaPamisetty wants to merge 1 commit into
mainfrom
fix/authenticator-phone-field-required-validation

Conversation

@VarshithaPamisetty

@VarshithaPamisetty VarshithaPamisetty commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Description

A required phone number field (SignUpFormField.phoneNumber(required: true)) still accepted an empty value. formatPhoneNumber prepended the dial code to empty input ("" -> "+1"), so the value looked non-empty, passed validation, and the form submitted a bogus dial-code-only number instead of showing the required error. This leaves empty input untouched so the required/empty check runs.

Screenshots

Before After
before after

Before: an empty required phone number passed validation and reached the SignUp call. After: it is blocked client-side with "Phone Number field must not be blank."

Testing

  • Added a widget test: a required phone field submitted empty now shows "Phone Number field must not be blank." (fails without the change).
  • authenticator suite green: sign_up_form_test, form_field_controller_test, and 284 golden UI tests pass; dart analyze and dart format clean.
  • Verified in the example app: empty required phone is now blocked client-side instead of reaching the SignUp call.

Fixes #4079

@VarshithaPamisetty VarshithaPamisetty self-assigned this Aug 19, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.12%. Comparing base (a6ec724) to head (7bc4551).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7296      +/-   ##
==========================================
+ Coverage   40.98%   41.12%   +0.14%     
==========================================
  Files         121      121              
  Lines        8273     8274       +1     
  Branches     3598     3599       +1     
==========================================
+ Hits         3391     3403      +12     
+ Misses       4882     4871      -11     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@VarshithaPamisetty
VarshithaPamisetty marked this pull request as ready for review August 19, 2026 14:25
@VarshithaPamisetty
VarshithaPamisetty requested a review from a team as a code owner August 19, 2026 14:25
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.

Flutter: Custom Phone Number Form Field accepts empty value still after setting required argument as true

2 participants