WorldPickerPhoneNumberField class

A widget that allows users to input and validate phone numbers.

It uses the PhoneNumber model to represent the phone number and its associated country ISO code.

Inheritance

Constructors

WorldPickerPhoneNumberField.new({Key? key, TextEditingController? controller, required dynamic onPhoneNumberChanged(PhoneNumber), PhoneNumber? initialValue, WorldPickerOptions options = const WorldPickerOptions(), bool showDialCode = false, String defaultCountryIsoCode = 'US', double? size = 32.0, InputDecoration decoration = const InputDecoration(), TextInputType keyboardType = TextInputType.phone, TextInputAction? textInputAction, TextStyle? style, StrutStyle? strutStyle, TextAlignVertical? textAlignVertical, bool autofocus = false, String obscuringCharacter = '•', bool obscureText = false, bool autocorrect = false, SmartDashesType? smartDashesType, SmartQuotesType? smartQuotesType, bool enableSuggestions = true, Widget contextMenuBuilder(BuildContext, EditableTextState)?, bool? showCursor, dynamic onEditingComplete()?, dynamic onSubmitted(PhoneNumber)?, AppPrivateCommandCallback? onAppPrivateCommand, dynamic onTapOutside(PointerDownEvent)?, double cursorWidth = 2.0, double? cursorHeight, Radius? cursorRadius, Color? cursorColor, Brightness? keyboardAppearance, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), bool enableInteractiveSelection = true, TextSelectionControls? selectionControls, MouseCursor? mouseCursor, ScrollPhysics? scrollPhysics, ScrollController? scrollController, Iterable<String>? autofillHints, bool enableIMEPersonalizedLearning = true, List<TextInputFormatter>? inputFormatters})

Properties

autocorrect bool
final
autofillHints Iterable<String>?
final
autofocus bool
final
contextMenuBuilder Widget Function(BuildContext, EditableTextState)?
final
controller TextEditingController?
The controller for managing the text input.
final
cursorColor Color?
final
cursorHeight double?
final
cursorRadius Radius?
final
cursorWidth double
final
decoration InputDecoration
final
defaultCountryIsoCode String
The default country ISO code to use when no country is selected. Defaults to "US".
final
enableIMEPersonalizedLearning bool
final
enableInteractiveSelection bool
final
enableSuggestions bool
final
hashCode int
The hash code for this object.
no setterinherited
initialValue PhoneNumber?
Initial value for the phone number field.
final
inputFormatters List<TextInputFormatter>?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardAppearance Brightness?
final
keyboardType TextInputType
final
mouseCursor MouseCursor?
final
obscureText bool
final
obscuringCharacter String
final
onAppPrivateCommand AppPrivateCommandCallback?
final
onEditingComplete → dynamic Function()?
final
onPhoneNumberChanged → dynamic Function(PhoneNumber)
Callback that is triggered when the phone number changes.
final
onSubmitted → dynamic Function(PhoneNumber)?
final
onTapOutside → dynamic Function(PointerDownEvent)?
final
options WorldPickerOptions
Configuration options for customizing the country picker dialog.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollController ScrollController?
final
scrollPadding EdgeInsets
final
scrollPhysics ScrollPhysics?
final
selectionControls TextSelectionControls?
final
showCursor bool?
final
showDialCode bool
Whether to display the international dial code (e.g., "+1"). Defaults to false.
final
size double?
The size of the flag icon. Defaults to 32.0.
final
smartDashesType SmartDashesType?
final
smartQuotesType SmartQuotesType?
final
strutStyle StrutStyle?
final
style TextStyle?
final
textAlignVertical TextAlignVertical?
final
textInputAction TextInputAction?
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<WorldPickerPhoneNumberField>
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