PhoneUtil constructor

const PhoneUtil({
  1. Key? key,
  2. required ValueChanged<PhoneNumber> onInputChanged,
  3. ValueChanged<bool>? onInputValidated,
  4. VoidCallback? onSubmit,
  5. ValueChanged<String>? onFieldSubmitted,
  6. String? validator(
    1. String?
    )?,
  7. ValueChanged<PhoneNumber>? onSaved,
  8. Key? fieldKey,
  9. TextEditingController? textFieldController,
  10. TextInputAction? keyboardAction,
  11. TextInputType keyboardType = TextInputType.phone,
  12. PhoneNumber? initialValue,
  13. String? hintText = 'Phone number',
  14. String? errorMessage = 'Invalid phone number',
  15. double selectorButtonOnErrorPadding = 24,
  16. double spaceBetweenSelectorAndTextField = 12,
  17. int maxLength = 15,
  18. bool isEnabled = true,
  19. bool formatInput = true,
  20. bool autoFocus = false,
  21. bool autoFocusSearch = false,
  22. AutovalidateMode autoValidateMode = AutovalidateMode.disabled,
  23. bool ignoreBlank = false,
  24. bool countrySelectorScrollControlled = true,
  25. String? locale,
  26. TextStyle? textStyle,
  27. TextStyle? selectorTextStyle,
  28. InputBorder? inputBorder,
  29. InputDecoration? inputDecoration,
  30. InputDecoration? searchBoxDecoration,
  31. TextAlign textAlign = TextAlign.start,
  32. TextAlignVertical textAlignVertical = TextAlignVertical.center,
  33. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  34. FocusNode? focusNode,
  35. Color? cursorColor,
  36. Iterable<String>? autofillHints,
  37. String? dialCodeInit,
  38. List<String>? countries,
  39. double separatedWidth = 0,
  40. TextEditingController? controller,
  41. required CountryBox countryDecoration,
  42. PhoneInputSelectorType countryBoxType = PhoneInputSelectorType.BOTTOM_SHEET,
  43. TextStyle? countryTextStyle,
  44. double separateBetweenFlanAndCountryName = 12,
  45. 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);