LitePhoneInputField class

Inheritance

Constructors

LitePhoneInputField.new({Key? key, required String name, LiteFormValueDeserializer? initialValueDeserializer, LitePhoneInputType phoneInputType = LitePhoneInputType.autodetectCode, Object? initialValue, List<Object>? phoneCountries, InputDecoration? decoration, bool readOnly = false, String? hintText, String? label, AutovalidateMode? autovalidateMode, Object? defaultCountry, FocusNode? focusNode, TextStyle? errorStyle, TextStyle? style, List<LiteValidator>? validators, LiteFormValueSerializer serializer = nonConvertingValueConvertor, double paddingTop = 0.0, double paddingBottom = 0.0, double paddingLeft = 0.0, double paddingRight = 0.0, TextCapitalization textCapitalization = TextCapitalization.none, StrutStyle? strutStyle, bool autofocus = false, TextDirection? textDirection, String? restorationId, String locale = 'en', TextAlignVertical? textAlignVertical, ValueChanged<Object?>? onChanged, DropSelectorSettings? countrySelectorSettings, MenuItemBuilder? menuItemBuilder, ValueChanged<String>? onFieldSubmitted, TextAlign textAlign = TextAlign.start, EdgeInsets? smoothErrorPadding = const EdgeInsets.only(top: 6.0), double leadingWidth = 100.0, bool useSmoothError = true, bool allowErrorTexts = true, bool allowEndlessPhone = false, DropSelectorType countrySelectorViewType = DropSelectorType.menu})

Properties

allowEndlessPhone bool
allowEndlessPhone sometimes you might want to allow users to enter more numbers than a phone mask allows (very rare but potentially possible cases) this will allow you to do so
final
allowErrorTexts bool
Pass false here if you don't want to display errors on invalid fields at all
final
autofocus bool
final
autovalidateMode AutovalidateMode?
final
countrySelectorSettings DropSelectorSettings?
final
countrySelectorViewType DropSelectorType
countrySelectorViewType specifies how the DropSelector sheet for the country code will look like. Makes sense only if phoneInputType is LitePhoneInputType.manualCode
final
decoration InputDecoration?
final
defaultCountry Object?
defaultCountry if you select phoneInputType = LitePhoneInputType.manualCode you can preset a default country for it. This field can accept a String or a CountryData object. If you decide to pass a String value it can be a ISO code for a country or a simple name. In case the country you provide is not found in the available list of countries it will use United States as a fallback option
final
errorStyle TextStyle?
final
focusNode FocusNode?
final
hashCode int
The hash code for this object.
no setterinherited
hintText String?
final
initialValue Object?
final
initialValueDeserializer LiteFormValueDeserializer?
Allows you to convert initial value to a proper data type or format before using it. E.g. you have a iso8601 format but you need to have a DateTime object to work with in a date picker. Use initialValueDeserializer to convert iso8601 value to a DateTime like so: initialValueDeserializer: (value) => DateTime.parse(value); and you will get a DateTime as an initial value. You can use any custom conversions you want
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label String?
final
leadingWidth double
leadingWidth the width of the drop selector for a country code it makes sense only if phoneInputType == LitePhoneInputType.manualCode
final
locale String
locale two-letter locale like "ru" or "en"
final
menuItemBuilder if you need a custom view for country codes in a drop selector you can use this builder
final
name String
final
onChanged ValueChanged<Object?>?
final
onFieldSubmitted ValueChanged<String>?
final
paddingBottom double
final
paddingLeft double
final
paddingRight double
final
paddingTop double
final
phoneCountries List<Object>?
phoneCountries you can pass a list of CountryData objects here or a list of String names. If you pass a list of Strings it will try to find countries by a provided names
final
phoneInputType LitePhoneInputType
final
readOnly bool
final
restorationId String?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serializer LiteFormValueSerializer
to an api endpoint. E.g. you have a Date Picker which returns a DateTime object but you need to send it to a backend in a iso8601 string format. Just pass the serializer like this: serializer: (value) => value.toIso8601String() And it will always store this date as a string in a form map which you can easily send wherever you need
final
smoothErrorPadding EdgeInsets?
makes sense only of useSmoothError is true
final
strutStyle StrutStyle?
final
style TextStyle?
final
textAlign TextAlign
final
textAlignVertical TextAlignVertical?
final
textCapitalization TextCapitalization
final
textDirection TextDirection?
final
useSmoothError bool
if true, this will use a smoothly animated error that uses AnimateSize to display, unlike the standard Flutter's input error
final
validators List<LiteValidator>?
final

Methods

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