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. List<TextInputFormatter>? inputFormatters,
  36. double cursorWidth = 2.0,
  37. double? cursorHeight,
  38. Radius? cursorRadius,
  39. Color? cursorColor,
  40. BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
  41. BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
  42. Brightness? keyboardAppearance,
  43. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  44. bool enableInteractiveSelection = true,
  45. TextSelectionControls? selectionControls,
  46. MouseCursor? mouseCursor,
  47. ScrollPhysics? scrollPhysics,
  48. ScrollController? scrollController,
  49. Iterable<String>? autofillHints,
  50. bool enableIMEPersonalizedLearning = 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.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,
})  : 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,
      );