PhoneFormField constructor
PhoneFormField({
- Key? key,
- PhoneController? controller,
- dynamic onChanged()?,
- FocusNode? focusNode,
- bool isCountrySelectionEnabled = true,
- bool isCountryButtonPersistent = true,
- CountryButtonStyle countryButtonStyle = const CountryButtonStyle(),
- FormFieldValidator<
PhoneNumber> ? validator, - PhoneNumber? initialValue,
- FormFieldSetter<
PhoneNumber> ? onSaved, - AutovalidateMode? autovalidateMode = AutovalidateMode.onUserInteraction,
- String? restorationId,
- bool enabled = true,
- InputDecoration decoration = const InputDecoration(),
- TextInputType keyboardType = TextInputType.phone,
- TextInputAction? textInputAction,
- TextStyle? style,
- StrutStyle? strutStyle,
- @Deprecated('Has no effect, Change text directionality instead') TextAlign? textAlign,
- TextAlignVertical? textAlignVertical,
- bool autofocus = false,
- String obscuringCharacter = '*',
- bool obscureText = false,
- bool autocorrect = true,
- SmartDashesType? smartDashesType,
- SmartQuotesType? smartQuotesType,
- bool enableSuggestions = true,
- Widget contextMenuBuilder()?,
- bool? showCursor,
- dynamic onEditingComplete()?,
- dynamic onSubmitted()?,
- AppPrivateCommandCallback? onAppPrivateCommand,
- dynamic onTapOutside()?,
- List<
TextInputFormatter> ? inputFormatters, - double cursorWidth = 2.0,
- double? cursorHeight,
- Radius? cursorRadius,
- Color? cursorColor,
- BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
- BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
- Brightness? keyboardAppearance,
- EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
- bool enableInteractiveSelection = true,
- TextSelectionControls? selectionControls,
- MouseCursor? mouseCursor,
- ScrollPhysics? scrollPhysics,
- ScrollController? scrollController,
- Iterable<
String> ? autofillHints, - 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,
);