Field.phoneNumber constructor

Field.phoneNumber(
  1. String key, {
  2. String? label,
  3. String? value,
  4. FormValidator? validator,
  5. bool autofocus = false,
  6. String? dummyData,
  7. Widget? header,
  8. Widget? footer,
  9. TextStyle? titleStyle,
  10. bool? hidden = false,
  11. bool? readOnly,
  12. FieldStyleTextField? style,
  13. dynamic onChanged(
    1. dynamic value
    )?,
})

Field.phoneNumber is a constructor that helps in managing phoneNumber fields

Implementation

Field.phoneNumber(
  this.key, {
  this.label,
  String? value,
  this.validator,
  this.autofocus = false,
  this.dummyData,
  this.header,
  this.footer,
  this.titleStyle,
  this.hidden = false,
  this.readOnly,
  FieldStyleTextField? style,
  Function(dynamic value)? onChanged,
}) : _value = value,
     this.style = (style ?? FieldStyleTextField()) {
  this.style = (this.style as FieldStyleTextField).copyWith(
    keyboardType: TextInputType.phone,
    inputFormatters: [PhoneInputFormatter()],
    // onChanged: onChanged,
  );

  setOnChanged(onChanged);
  widget = NyFormTextField.fromField(this);
}