PhoneFieldConfig constructor
const
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,
Implementation
const PhoneFieldConfig({
this.initialCountryCode,
this.defaultCountryCode = 'US',
this.enableSearch = true,
this.showFlag = true,
this.showDialCode = true,
this.showDropdownIcon = true,
this.dropdownIcon = Icons.arrow_drop_down,
this.searchDecoration,
this.dialogTitle = 'Select Country',
this.searchHintText = 'Search by name or dial code',
this.selectorButtonPadding = const EdgeInsets.all(8),
this.decoration,
this.dialCodeTextStyle,
this.autofocus = false,
this.obscureText = false,
this.keyboardType = TextInputType.phone,
this.textInputAction = TextInputAction.done,
this.autovalidateMode = AutovalidateMode.onUserInteraction,
this.showErrorBorder = true,
this.cursorColor,
this.maxLines = 1,
this.minLines = 1,
this.maxLength,
this.enableInteractiveSelection = true,
this.readOnly = false,
this.countryCodes,
this.preferredCountries,
this.maxPhoneLength = 0,
this.minPhoneLength = 0,
this.emptyErrorMessage = 'Please enter phone number',
this.successMessage,
this.showSuccessIndicator = true,
this.successIcon = Icons.check_circle_outline_rounded,
this.successColor = Colors.green,
this.errorColor = Colors.red,
this.showValidationOnEmpty = false,
this.enablePatternValidation = true,
});