PhoneFieldConfig class
Configuration for CustomPhoneField
Constructors
-
PhoneFieldConfig({String? initialCountryCode, String defaultCountryCode = 'US', bool enableSearch = true, bool showFlag = true, bool showDialCode = true, bool showDropdownIcon = true, IconData dropdownIcon = Icons.arrow_drop_down, InputDecoration? searchDecoration, String dialogTitle = 'Select Country', String searchHintText = 'Search by name or dial code', EdgeInsetsGeometry selectorButtonPadding = const EdgeInsets.all(8), InputDecoration? decoration, TextStyle? dialCodeTextStyle, bool autofocus = false, bool obscureText = false, TextInputType keyboardType = TextInputType.phone, TextInputAction textInputAction = TextInputAction.done, AutovalidateMode autovalidateMode = AutovalidateMode.onUserInteraction, bool showErrorBorder = true, Color? cursorColor, int maxLines = 1, int minLines = 1, int? maxLength, bool enableInteractiveSelection = true, bool readOnly = false, List<
String> ? countryCodes, List<String> ? preferredCountries, int maxPhoneLength = 0, int minPhoneLength = 0, String emptyErrorMessage = 'Please enter phone number', String? successMessage, bool showSuccessIndicator = true, IconData successIcon = Icons.check_circle_outline_rounded, Color successColor = Colors.green, Color errorColor = Colors.red, bool showValidationOnEmpty = false, bool enablePatternValidation = true}) -
const
Properties
- autofocus → bool
-
Autofocus the input field
final
- autovalidateMode → AutovalidateMode
-
Auto validate mode
final
-
countryCodes
→ List<
String> ? -
Country filter (only show these countries)
final
- cursorColor → Color?
-
Cursor color
final
- decoration → InputDecoration?
-
Input decoration
final
- defaultCountryCode → String
-
Default country if initialCountryCode is null
final
- dialCodeTextStyle → TextStyle?
-
Text style for dial code
final
- dialogTitle → String
-
Dialog title
final
- dropdownIcon → IconData
-
Dropdown icon
final
- emptyErrorMessage → String
-
Empty field error message
final
- enableInteractiveSelection → bool
-
Enable interactive selection
final
- enablePatternValidation → bool
-
Enable pattern validation from country data
final
- enableSearch → bool
-
Enable search in country picker
final
- errorColor → Color
-
Error color
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialCountryCode → String?
-
Initial country code (e.g., "US", "IN")
final
- keyboardType → TextInputType
-
Keyboard type
final
- maxLength → int?
-
Max length
final
- maxLines → int
-
Maximum lines
final
- maxPhoneLength → int
-
Max phone number length (overrides country-specific max)
final
- minLines → int
-
Minimum lines
final
- minPhoneLength → int
-
Min phone number length (overrides country-specific min)
final
- obscureText → bool
-
Obscure text (for PIN-like inputs)
final
-
preferredCountries
→ List<
String> ? -
Preferred countries (show at top)
final
- readOnly → bool
-
Read only
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchDecoration → InputDecoration?
-
Search decoration
final
- searchHintText → String
-
Search hint text
final
- selectorButtonPadding → EdgeInsetsGeometry
-
Country selector button padding
final
- showDialCode → bool
-
Show country dial code
final
- showDropdownIcon → bool
-
Show dropdown icon
final
- showErrorBorder → bool
-
Show error border
final
- showFlag → bool
-
Show country flag
final
- showSuccessIndicator → bool
-
Show success indicator
final
- showValidationOnEmpty → bool
-
Show validation even when field is empty
final
- successColor → Color
-
Success color
final
- successIcon → IconData
-
Success icon
final
- successMessage → String?
-
Success message when valid
final
- textInputAction → TextInputAction
-
Text input action
final
Methods
-
copyWith(
{String? initialCountryCode, String? defaultCountryCode, bool? enableSearch, bool? showFlag, bool? showDialCode, bool? showDropdownIcon, IconData? dropdownIcon, InputDecoration? searchDecoration, String? dialogTitle, String? searchHintText, EdgeInsetsGeometry? selectorButtonPadding, InputDecoration? decoration, TextStyle? dialCodeTextStyle, bool? autofocus, bool? obscureText, TextInputType? keyboardType, TextInputAction? textInputAction, AutovalidateMode? autovalidateMode, bool? showErrorBorder, Color? cursorColor, int? maxLines, int? minLines, int? maxLength, bool? enableInteractiveSelection, bool? readOnly, List< String> ? countryCodes, List<String> ? preferredCountries}) → PhoneFieldConfig -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited