PhoneFormField constructor

PhoneFormField({
  1. Key? key,
  2. PhoneController? controller,
  3. dynamic onChanged(
    1. PhoneNumber
    )?,
  4. FocusNode? focusNode,
  5. CountrySelectorNavigator countrySelectorNavigator = const CountrySelectorNavigator.page(),
  6. bool isCountrySelectionEnabled = true,
  7. bool isCountryButtonPersistent = true,
  8. CountryButtonStyle countryButtonStyle = const CountryButtonStyle(),
  9. FormFieldValidator<PhoneNumber>? validator,
  10. PhoneNumber? initialValue,
  11. FormFieldSetter<PhoneNumber>? onSaved,
  12. AutovalidateMode? autovalidateMode = AutovalidateMode.onUserInteraction,
  13. String? restorationId,
  14. bool enabled = true,
  15. InputDecoration decoration = const InputDecoration(),
  16. TextInputType keyboardType = TextInputType.phone,
  17. TextInputAction? textInputAction,
  18. TextStyle? style,
  19. StrutStyle? strutStyle,
  20. @Deprecated('Has no effect, Change text directionality instead') TextAlign? textAlign,
  21. TextAlignVertical? textAlignVertical,
  22. bool autofocus = false,
  23. String obscuringCharacter = '*',
  24. bool obscureText = false,
  25. bool autocorrect = true,
  26. SmartDashesType? smartDashesType,
  27. SmartQuotesType? smartQuotesType,
  28. bool enableSuggestions = true,
  29. Widget contextMenuBuilder(
    1. BuildContext,
    2. EditableTextState
    )?,
  30. bool? showCursor,
  31. dynamic onEditingComplete()?,
  32. dynamic onSubmitted(
    1. PhoneNumber
    )?,
  33. AppPrivateCommandCallback? onAppPrivateCommand,
  34. dynamic onTapOutside(
    1. PointerDownEvent
    )?,
  35. dynamic onTapUpOutside(
    1. PointerUpEvent
    )?,
  36. List<TextInputFormatter>? inputFormatters,
  37. double cursorWidth = 2.0,
  38. double? cursorHeight,
  39. Radius? cursorRadius,
  40. Color? cursorColor,
  41. BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
  42. BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
  43. Brightness? keyboardAppearance,
  44. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  45. bool enableInteractiveSelection = true,
  46. TextSelectionControls? selectionControls,
  47. MouseCursor? mouseCursor,
  48. ScrollPhysics? scrollPhysics,
  49. ScrollController? scrollController,
  50. Iterable<String>? autofillHints,
  51. bool enableIMEPersonalizedLearning = true,
  52. bool shouldLimitLengthByCountry = false,
  53. bool readOnly = false,
  54. bool canRequestFocus = true,
})

Implementation

PhoneFormField({
  super.key,
  this.controller,
  this.onChanged,
  this.focusNode,
  this.countrySelectorNavigator = const CountrySelectorNavigator.page(),
  this.isCountrySelectionEnabled = true,
  this.isCountryButtonPersistent = true,
  this.countryButtonStyle = const CountryButtonStyle(),
  // form field inputs
  super.validator,
  PhoneNumber? initialValue,
  super.onSaved,
  super.autovalidateMode = AutovalidateMode.onUserInteraction,
  super.restorationId,
  super.enabled = true,
  // textfield inputs
  this.decoration = const InputDecoration(),
  this.keyboardType = TextInputType.phone,
  this.textInputAction,
  this.style,
  this.strutStyle,
  @Deprecated('Has no effect, Change text directionality instead')
  this.textAlign,
  this.textAlignVertical,
  this.autofocus = false,
  this.obscuringCharacter = '*',
  this.obscureText = false,
  this.autocorrect = true,
  this.smartDashesType,
  this.smartQuotesType,
  this.enableSuggestions = true,
  this.contextMenuBuilder,
  this.showCursor,
  this.onEditingComplete,
  this.onSubmitted,
  this.onAppPrivateCommand,
  this.onTapOutside,
  this.onTapUpOutside,
  this.inputFormatters,
  this.cursorWidth = 2.0,
  this.cursorHeight,
  this.cursorRadius,
  this.cursorColor,
  this.selectionHeightStyle = ui.BoxHeightStyle.tight,
  this.selectionWidthStyle = ui.BoxWidthStyle.tight,
  this.keyboardAppearance,
  this.scrollPadding = const EdgeInsets.all(20.0),
  this.enableInteractiveSelection = true,
  this.selectionControls,
  this.mouseCursor,
  this.scrollPhysics,
  this.scrollController,
  this.autofillHints,
  this.enableIMEPersonalizedLearning = true,
  this.shouldLimitLengthByCountry = false,
  this.readOnly = false,
  this.canRequestFocus = true,
})  : assert(
        initialValue == null || controller == null,
        'One of initialValue or controller can be specified at a time',
      ),
      super(
        builder: (state) => (state as PhoneFormFieldState).builder(),
        initialValue: controller?.value ?? initialValue,
      );