Skip to content
On this page

PhoneNumberInput

A phone number field with country selection and formatting.

PhoneNumberInput in FluttyUIPhoneNumberInput in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

PhoneNumberInput

const PhoneNumberInput({
  super.key,
  this.size,
  required this.controller,
  this.countryCode,
  this.initialCountryCode = 'US',
  this.countries,
  this.onChanged,
  this.onCountryChanged,
  this.onSubmitted,
  this.focusNode,
  this.placeholder,
  this.searchPlaceholder = 'Search country…',
  this.emptySearchText = 'No countries found',
  this.enabled = true,
  this.readOnly = false,
  this.isInvalid = false,
  this.autofocus = false,
  this.textInputAction = TextInputAction.next,
  this.backgroundColor,
  this.foregroundColor,
  this.placeholderColor,
  this.focusedBorderColor,
  this.borderRadius,
  this.height,
  this.fontSize,
  this.padding,
});
ParameterTypeRequiredDefault
keyKey?Nonull
sizeComponentSize?Nonull
controllerTextEditingControllerYes—
countryCodeString?Nonull
initialCountryCodeStringNo'US'
countriesList<PhoneCountry>?Nonull
onChangedValueChanged<PhoneNumberValue>?Nonull
onCountryChangedValueChanged<PhoneCountry>?Nonull
onSubmittedValueChanged<PhoneNumberValue>?Nonull
focusNodeFocusNode?Nonull
placeholderString?Nonull
searchPlaceholderStringNo'Search country…'
emptySearchTextStringNo'No countries found'
enabledboolNotrue
readOnlyboolNofalse
isInvalidboolNofalse
autofocusboolNofalse
textInputActionTextInputActionNoTextInputAction.next
backgroundColorColor?Nonull
foregroundColorColor?Nonull
placeholderColorColor?Nonull
focusedBorderColorColor?Nonull
borderRadiusdouble?Nonull
heightdouble?Nonull
fontSizedouble?Nonull
paddingEdgeInsetsGeometry?Nonull

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/forms/phone_number_input/phone_number_input.dart

This reference is generated from the PhoneNumberInput declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI