IntlPhoneField class

Inheritance

Constructors

IntlPhoneField({Key? key, String? initialCountryCode, String languageCode = 'en', bool disableAutoFillHints = false, bool obscureText = false, TextAlign textAlign = TextAlign.left, TextAlignVertical? textAlignVertical, VoidCallback? onTap, bool readOnly = false, String? initialValue, TextInputType keyboardType = TextInputType.phone, TextEditingController? controller, FocusNode? focusNode, InputDecoration decoration = const InputDecoration(), TextStyle? style, TextStyle? dropdownTextStyle, void onSubmitted(String)?, FutureOr<String?> validator(PhoneNumber?)?, ValueChanged<PhoneNumber>? onChanged, List<Country>? countries, ValueChanged<Country>? onCountryChanged, FormFieldSetter<PhoneNumber>? onSaved, bool showDropdownIcon = true, BoxDecoration dropdownDecoration = const BoxDecoration(), List<TextInputFormatter>? inputFormatters, bool enabled = true, Brightness? keyboardAppearance, @Deprecated('Use searchFieldInputDecoration of PickerDialogStyle instead') String searchText = 'Search country', IconPosition dropdownIconPosition = IconPosition.leading, Icon dropdownIcon = const Icon(Icons.arrow_drop_down), bool autofocus = false, TextInputAction? textInputAction, AutovalidateMode? autovalidateMode = AutovalidateMode.onUserInteraction, bool showCountryFlag = true, Color? cursorColor, bool disableLengthCheck = false, EdgeInsetsGeometry flagsButtonPadding = EdgeInsets.zero, String? invalidNumberMessage = 'Invalid Mobile Number', double? cursorHeight, Radius? cursorRadius = Radius.zero, double cursorWidth = 2.0, bool? showCursor = true, PickerDialogStyle? pickerDialogStyle, EdgeInsets flagsButtonMargin = EdgeInsets.zero})
const

Properties

autofocus → bool
Whether this text field should focus itself if nothing else is already focused.
final
autovalidateMode → AutovalidateMode?
Autovalidate mode for text form field.
final
controller → TextEditingController?
Controls the text being edited.
final
countries → List<Country>?
List of Country to display see countries.dart for format
final
cursorColor → Color?
The color of the cursor.
final
cursorHeight → double?
How tall the cursor will be.
final
cursorRadius → Radius?
How rounded the corners of the cursor should be.
final
cursorWidth → double
How thick the cursor will be.
final
decoration → InputDecoration
The decoration to show around the text field.
final
disableAutoFillHints → bool
final
disableLengthCheck → bool
Disable view Min/Max Length check
final
final
Icon of the drop down button.
final
Position of an icon leading, trailing
final
The style use for the country dial code.
final
enabled → bool
If false the widget is "disabled": it ignores taps, the TextFormField's decoration is rendered in grey, decoration's InputDecoration.counterText is set to "", and the drop down icon is hidden no matter showDropdownIcon value.
final
flagsButtonMargin → EdgeInsets
The margin of the country selector button.
final
flagsButtonPadding → EdgeInsetsGeometry
The padding of the Flags Button.
final
focusNode → FocusNode?
Defines the keyboard focus for this widget.
final
hashCode → int
The hash code for this object.
no setterinherited
initialCountryCode → String?
2 letter ISO Code or country dial code.
final
initialValue → String?
Initial Value for the field. This property can be used to pre-fill the field.
final
inputFormatters → List<TextInputFormatter>?
Optional input validation and formatting overrides.
final
invalidNumberMessage → String?
Message to be displayed on autoValidate error
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardAppearance → Brightness?
The appearance of the keyboard.
final
keyboardType → TextInputType
The type of keyboard to use for editing the text.
final
languageCode → String
final
obscureText → bool
Whether to hide the text being edited (e.g., for passwords).
final
onChanged → ValueChanged<PhoneNumber>?
Called when the user initiates a change to the TextField's value: when they have inserted or deleted text.
final
onCountryChanged → ValueChanged<Country>?
final
onSaved → FormFieldSetter<PhoneNumber>?
final
onSubmitted → void Function(String)?
Called when the user indicates that they are done editing the text in the field.
final
onTap → VoidCallback?
final
pickerDialogStyle → PickerDialogStyle?
Optional set of styles to allow for customizing the country search & pick dialog
final
readOnly → bool
Whether the text can be changed.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
searchText → String
The text that describes the search input field.
final
showCountryFlag → bool
Whether to show or hide country flag.
final
showCursor → bool?
Whether to show cursor.
final
showDropdownIcon → bool
Won't work if enabled is set to false.
final
style → TextStyle?
The style to use for the text being edited.
final
textAlign → TextAlign
How the text should be aligned horizontally.
final
textAlignVertical → TextAlignVertical?
How the text should be aligned vertically.
final
textInputAction → TextInputAction?
The type of action button to use for the keyboard.
final
validator → FutureOr<String?> Function(PhoneNumber?)?
An optional method that validates an input. Returns an error string to display if the input is invalid, or null otherwise.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _IntlPhoneFieldState
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited