Skip to content

Conversation

@lukas-pierce
Copy link

When code user provides autofillHints telephoneNumber iOS automatically suggests end user's phone from their contact card (Phone -> Contacts -> My Card)

TextFormField(
  autofillHints: const [
    AutofillHints.telephoneNumber,
  ],
  inputFormatters: [
    LibPhonenumberTextFormatter(
      country: libphonenumber.CountryManager().countries.firstWhere((c) => c.countryCode == 'AE')
    ),
  ],
  ...
)

In this case, the LibPhonenumberTextFormatter treats the prefix as part of the number and removes the ending. But it would be great if, when inserting, the country was automatically recognized and the appropriate mask was applied. You can see an example in this GIF

For these purposes I added dlibphonenumber package dependency. Which is a dart port of the google/libphonenumber original library

autofill-phone

@lukas-pierce lukas-pierce changed the title Ability to recognize country when inserting a number Ability to recognize country when inserting a phone number Apr 16, 2024
@acoutts
Copy link
Owner

acoutts commented Dec 6, 2025

hey can you please update this to the latest main so i can review it again?

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.

2 participants