BankPhoneInputField class
Phone number entry with an in-field country / dial-code selector.
The leading affordance shows the selected country's flag and dial code
and opens BankCountryPicker.show. The national number formats live
with simple 3-3-4 grouping; onChanged always emits a normalized
E.164 string (+<dialcode><national digits>). Hosts needing
carrier-grade per-country validation can layer their own
inputFormatters upstream: this widget deliberately avoids a
libphonenumber dependency.
Digits display through the ambient NumeralStyle while the emitted value is always ASCII.
BankPhoneInputField(
label: 'Mobile number',
onChanged: (e164, country) => setState(() => _phone = e164),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- BankPhoneInputField
Constructors
-
BankPhoneInputField({required void onChanged(String e164, BankCountry country), Key? key, BankCountry? initialCountry, String? initialNumber, String? label, String? hint, String? helper, String? errorText, bool enabled = true, List<
String> ? preferredCountryIsoCodes, FocusNode? focusNode, TextStyle? dialCodeStyle, IconData? dropdownIcon, String searchHint = 'Search by name, code, or dial code', String recentLabel = 'Recent', String emptyLabel = 'No countries found'}) -
const
Properties
- dialCodeStyle → TextStyle?
-
Merged over the computed dial-code style in the leading affordance
(default: BankTokens.bodyLarge coloured per the enabled state).
final
- dropdownIcon → IconData?
-
Overrides Icons.arrow_drop_down as the country affordance glyph.
final
- emptyLabel → String
-
Message shown when the country search matches nothing.
final
- enabled → bool
-
final
- errorText → String?
-
Non-null shows the danger error state, matching BankTextField.
final
- focusNode → FocusNode?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- helper → String?
-
final
- hint → String?
-
final
- initialCountry → BankCountry?
-
Preselected country. Defaults to the first entry of
BankCountry.all when null.
final
- initialNumber → String?
-
Initial national number (digits only or pre-grouped: separators
are stripped).
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String?
-
final
- onChanged → void Function(String e164, BankCountry country)
-
Emits the normalized E.164 value and the selected country on every
edit or country change. The E.164 string is empty while the national
number is empty.
final
-
preferredCountryIsoCodes
→ List<
String> ? -
ISO codes surfaced in the picker's recent section.
final
- recentLabel → String
-
Header label of the country sheet's recently-selected section.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchHint → String
-
Hint for the country sheet's search field.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< BankPhoneInputField> -
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