Menu

1 / 5

intl_phone_input: a Flutter phone field that formats, detects and validates

DEV Community: flutter·Abdeldjalil Chougui·6 days ago
#43WN5cTL
#devtoflutter#devto#dev#country#value
Long article (1448 words) — no AI summary yet.
Reading 0:00
15s threshold

A phone number field is in almost every sign-up form, and it is harder than it looks. Users type their number with a leading zero, or paste it from their contacts as +213 555 12 34 56 , or as 00213555123456 . Some type Arabic-Indic digits. The same dial code can belong to several countries: +1 covers the US, Canada, Puerto Rico and others. And "valid" depends on the country and on the type of number, because a landline is not what you want for an SMS code.

intl_phone_input is a phone number field for Flutter with a country picker. It formats the number as the user types, detects pasted international numbers, and validates against libphonenumber metadata. The README describes it as a maintained replacement for intl_phone_field .

What it does

A real form field. IntlPhoneInput wraps a TextFormField , so it works in a Form with validate() , save() , a controller , a focusNode and autofill ( AutofillHints.telephoneNumber ).

Formats as you type.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.