IntlPhoneField class

Inheritance

Constructors

IntlPhoneField({String? initialCountryCode, bool obscureText = false, TextAlign textAlign = TextAlign.left, TextAlignVertical? textAlignVertical, VoidCallback? onTap, bool readOnly = false, String? initialValue, TextInputType keyboardType = TextInputType.phone, bool autovalidate = true, TextEditingController? controller, FocusNode? focusNode, InputDecoration decoration = const InputDecoration(), TextStyle? style, TextStyle? dropdownTextStyle, void onSubmitted(String)?, FutureOr<String?> validator(String?)?, ValueChanged<PhoneNumber>? onChanged, List<String>? countries, ValueChanged<PhoneNumber>? onCountryChanged, FormFieldSetter<PhoneNumber>? onSaved, bool showDropdownIcon = true, BoxDecoration dropdownDecoration = const BoxDecoration(), List<TextInputFormatter>? inputFormatters, bool enabled = true, Brightness keyboardAppearance = Brightness.light, String searchText = 'Search by Country Name', IconPosition iconPosition = IconPosition.leading, Icon dropDownIcon = const Icon(Icons.arrow_drop_down), bool autofocus = false, TextInputAction? textInputAction, AutovalidateMode? autovalidateMode = AutovalidateMode.onUserInteraction, bool showCountryFlag = true, bool dialCodeSearch = true, Color? cursorColor, bool disableLengthCheck = false, EdgeInsetsGeometry flagsButtonPadding = const EdgeInsets.symmetric(vertical: 8), String? invalidNumberMessage})

Properties

autofocus bool
Whether this text field should focus itself if nothing else is already focused.
final
autovalidate bool
final
autovalidateMode AutovalidateMode?
Autovalidate mode for text form field
final
controller TextEditingController?
Controls the text being edited.
final
countries List<String>?
List of 2 Letter ISO Codes of countries to show. Defaults to showing the inbuilt list of all countries.
final
cursorColor Color?
final
decoration InputDecoration
The decoration to show around the text field.
final
dialCodeSearch bool
final
disableLengthCheck bool
Disable view Min/Max Length check
final
final
Icon of the drop down button.
final
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
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
iconPosition IconPosition
Position of an icon leading, trailing
final
initialCountryCode String?
2 Letter ISO 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
obscureText bool
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<PhoneNumber>?
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
readOnly bool
Whether the text can be changed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchText String
Placeholder Text to Display in Searchbar for searching countries
final
showCountryFlag bool
Whether to show or hide country flag.
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
final
textAlignVertical TextAlignVertical?
final
textInputAction TextInputAction?
final
validator → (FutureOr<String?> Function(String?)?)
For validator to work, turn autoValidateMode to AutoValidateMode.onUserInteraction
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}) 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