copyWith method

FieldModel copyWith({
  1. String? labelText,
  2. String? hintText,
  3. String? errorMsg,
  4. bool? obscureText,
  5. int? errorMaxLines,
  6. IconData? suffixIcon,
  7. VoidCallback? onTapSuffixIcon,
  8. IconData? prefixIcon,
  9. VoidCallback? onTapPrefixIcon,
  10. ValueChanged<String>? onChanged,
  11. FormFieldValidator<String>? validator,
  12. FormFieldSetter<String>? onSaved,
  13. ValueChanged<String>? onSubmitted,
  14. VoidCallback? onFieldSubmitted,
  15. VoidCallback? onEditingComplete,
  16. FocusNode? focusNode,
  17. FocusNode? nextFocus,
  18. TextEditingController? controller,
  19. TextInputType? keyboardType,
  20. TextInputAction? textInputAction,
  21. int? maxLines,
  22. int? maxTexts,
  23. double? radius,
  24. bool? filled,
  25. Color? fillColor,
  26. bool? isUnderLine,
  27. InputBorder? border,
  28. Color? bgColor,
})

Implementation

FieldModel copyWith({
  String? labelText,
  String? hintText,
  String? errorMsg,
  bool? obscureText,
  int? errorMaxLines,
  IconData? suffixIcon,
  VoidCallback? onTapSuffixIcon,
  IconData? prefixIcon,
  VoidCallback? onTapPrefixIcon,
  ValueChanged<String>? onChanged,
  FormFieldValidator<String>? validator,
  FormFieldSetter<String>? onSaved,
  ValueChanged<String>? onSubmitted,
  VoidCallback? onFieldSubmitted,
  VoidCallback? onEditingComplete,
  FocusNode? focusNode,
  FocusNode? nextFocus,
  TextEditingController? controller,
  TextInputType? keyboardType,
  TextInputAction? textInputAction,
  int? maxLines,
  int? maxTexts,
  double? radius,
  bool? filled,
  Color? fillColor,
  bool? isUnderLine,
  InputBorder? border,
  Color? bgColor,
}) {
  return FieldModel(
    labelText: labelText ?? this.labelText,
    hintText: hintText ?? this.hintText,
    errorMsg: errorMsg ?? this.errorMsg,
    obscureText: obscureText ?? this.obscureText,
    errorMaxLines: errorMaxLines ?? this.errorMaxLines,
    suffixIcon: suffixIcon ?? this.suffixIcon,
    onTapSuffixIcon: onTapSuffixIcon ?? this.onTapSuffixIcon,
    prefixIcon: prefixIcon ?? this.prefixIcon,
    onTapPrefixIcon: onTapPrefixIcon ?? this.onTapPrefixIcon,
    onChanged: onChanged ?? this.onChanged,
    validator: validator ?? this.validator,
    onSaved: onSaved ?? this.onSaved,
    onSubmitted: onSubmitted ?? this.onSubmitted,
    onFieldSubmitted: onFieldSubmitted ?? this.onFieldSubmitted,
    onEditingComplete: onEditingComplete ?? this.onEditingComplete,
    focusNode: focusNode ?? this.focusNode,
    nextFocus: nextFocus ?? this.nextFocus,
    controller: controller ?? this.controller,
    keyboardType: keyboardType ?? this.keyboardType,
    textInputAction: textInputAction ?? this.textInputAction,
    maxLines: maxLines ?? this.maxLines,
    maxTexts: maxTexts ?? this.maxTexts,
    radius: radius ?? this.radius,
    filled: filled ?? this.filled,
    fillColor: fillColor ?? this.fillColor,
    isUnderLine: isUnderLine ?? this.isUnderLine,
    border: border ?? this.border,
    bgColor: bgColor ?? this.bgColor,
  );
}