copyWith method

FieldInfo copyWith({
  1. TextEditingController? controller,
  2. String? initialValue,
  3. bool? required,
  4. String? requiredString,
  5. IconData? prefixIcon,
  6. String? label,
  7. String? hint,
  8. String? innerLabel,
  9. TextInputType? inputType,
  10. bool? multiLine,
  11. bool? isObscure,
  12. VoidCallback? onTap,
  13. void onTapOutside(
    1. PointerDownEvent pointerDownEvent
    )?,
  14. bool? readOnly,
  15. IconData? suffixIcon,
  16. int? minLines,
  17. int? maxLines,
  18. FormFieldValidator<String>? validator,
  19. List<TextInputFormatter>? inputFormatters,
  20. void onChanged(
    1. String input
    )?,
})

This method creates a new instance with the specified attributes as the only difference between the previous instance and the new one

Implementation

FieldInfo copyWith({
  TextEditingController? controller,
  String? initialValue,
  bool? required,
  String? requiredString,
  IconData? prefixIcon,
  String? label,
  String? hint,
  String? innerLabel,
  TextInputType? inputType,
  bool? multiLine,
  bool? isObscure,
  VoidCallback? onTap,
  void Function(PointerDownEvent pointerDownEvent)? onTapOutside,
  bool? readOnly,
  IconData? suffixIcon,
  int? minLines,
  int? maxLines,
  FormFieldValidator<String>? validator,
  List<TextInputFormatter>? inputFormatters,
  void Function(String input)? onChanged,
}) =>
    FieldInfo(
      controller: controller ?? this.controller,
      required: required ?? this.required,
      requiredString: requiredString ?? this.requiredString,
      prefixIcon: prefixIcon ?? this.prefixIcon,
      label: label ?? this.label,
      innerLabel: innerLabel ?? this.innerLabel,
      hint: hint ?? this.hint,
      inputType: inputType ?? this.inputType,
      multiLine: multiLine ?? this.multiLine,
      onTap: onTap ?? this.onTap,
      onTapOutside: onTapOutside ?? this.onTapOutside,
      isObscure: isObscure ?? this.isObscure,
      readOnly: readOnly ?? this.readOnly,
      suffixIcon: suffixIcon ?? this.suffixIcon,
      minLines: minLines ?? this.minLines,
      maxLines: maxLines ?? this.maxLines,
      onChanged: onChanged ?? this.onChanged,
      validator: validator ?? this.validator,
      inputFormatters: inputFormatters ?? this.inputFormatters,
      initialValue: initialValue,
    );