PhoneUtil constructor
const
PhoneUtil({
- Key? key,
- required ValueChanged<
PhoneNumber> onInputChanged, - ValueChanged<
bool> ? onInputValidated, - VoidCallback? onSubmit,
- ValueChanged<
String> ? onFieldSubmitted, - String? validator()?,
- ValueChanged<
PhoneNumber> ? onSaved, - Key? fieldKey,
- TextEditingController? textFieldController,
- TextInputAction? keyboardAction,
- TextInputType keyboardType = TextInputType.phone,
- PhoneNumber? initialValue,
- String? hintText = 'Phone number',
- String? errorMessage = 'Invalid phone number',
- double selectorButtonOnErrorPadding = 24,
- double spaceBetweenSelectorAndTextField = 12,
- int maxLength = 15,
- bool isEnabled = true,
- bool formatInput = true,
- bool autoFocus = false,
- bool autoFocusSearch = false,
- AutovalidateMode autoValidateMode = AutovalidateMode.disabled,
- bool ignoreBlank = false,
- bool countrySelectorScrollControlled = true,
- String? locale,
- TextStyle? textStyle,
- TextStyle? selectorTextStyle,
- InputBorder? inputBorder,
- InputDecoration? inputDecoration,
- InputDecoration? searchBoxDecoration,
- TextAlign textAlign = TextAlign.start,
- TextAlignVertical textAlignVertical = TextAlignVertical.center,
- EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
- FocusNode? focusNode,
- Color? cursorColor,
- Iterable<
String> ? autofillHints, - String? dialCodeInit,
- List<
String> ? countries, - double separatedWidth = 0,
- TextEditingController? controller,
- required CountryBox countryDecoration,
- PhoneInputSelectorType countryBoxType = PhoneInputSelectorType.BOTTOM_SHEET,
- TextStyle? countryTextStyle,
- double separateBetweenFlanAndCountryName = 12,
- ValueChanged<
Country> ? onChangedCountry,
Implementation
const PhoneUtil({
Key? key,
required this.onInputChanged,
this.onInputValidated,
this.onSubmit,
this.onFieldSubmitted,
this.validator,
this.onSaved,
this.fieldKey,
this.textFieldController,
this.keyboardAction,
this.keyboardType = TextInputType.phone,
this.initialValue,
this.hintText = 'Phone number',
this.errorMessage = 'Invalid phone number',
this.selectorButtonOnErrorPadding = 24,
this.spaceBetweenSelectorAndTextField = 12,
this.maxLength = 15,
this.isEnabled = true,
this.formatInput = true,
this.autoFocus = false,
this.autoFocusSearch = false,
this.autoValidateMode = AutovalidateMode.disabled,
this.ignoreBlank = false,
this.countrySelectorScrollControlled = true,
this.locale,
this.textStyle,
this.selectorTextStyle,
this.inputBorder,
this.inputDecoration,
this.searchBoxDecoration,
this.textAlign = TextAlign.start,
this.textAlignVertical = TextAlignVertical.center,
this.scrollPadding = const EdgeInsets.all(20.0),
this.focusNode,
this.cursorColor,
this.autofillHints,
this.dialCodeInit,
this.countries,
this.separatedWidth = 0,
this.controller,
required this.countryDecoration,
this.countryBoxType = PhoneInputSelectorType.BOTTOM_SHEET,
this.countryTextStyle,
this.separateBetweenFlanAndCountryName = 12,
this.onChangedCountry,
}) : super(key: key);