copyWith method

Rule copyWith({
  1. String? name,
  2. bool? isRequired,
  3. bool? isEmail,
  4. bool? isUrl,
  5. bool? isPhone,
  6. bool? isIp,
  7. bool? isNumeric,
  8. bool? isNumericDecimal,
  9. bool? isAlphaSpace,
  10. bool? isAlphaNumeric,
  11. bool? isAlphaNumericSpace,
  12. RegExp? regex,
  13. int? length,
  14. int? minLength,
  15. int? maxLength,
  16. double? greaterThan,
  17. double? greaterThanEqualTo,
  18. double? lessThan,
  19. double? lessThanEqualTo,
  20. double? equalTo,
  21. double? notEqualTo,
  22. List<double>? equalToInList,
  23. List<double>? notEqualToInList,
  24. String? shouldMatch,
  25. String? shouldNotMatch,
  26. Validator? shouldPass,
  27. List<String>? inList,
  28. List<String>? notInList,
  29. String? customErrorText,
  30. Map<String, String>? customErrors,
  31. RuleOptions? options,
})

Implementation

Rule copyWith({
  String? name,
  bool? isRequired,
  bool? isEmail,
  bool? isUrl,
  bool? isPhone,
  bool? isIp,
  bool? isNumeric,
  bool? isNumericDecimal,
  bool? isAlphaSpace,
  bool? isAlphaNumeric,
  bool? isAlphaNumericSpace,
  RegExp? regex,
  int? length,
  int? minLength,
  int? maxLength,
  double? greaterThan,
  double? greaterThanEqualTo,
  double? lessThan,
  double? lessThanEqualTo,
  double? equalTo,
  double? notEqualTo,
  List<double>? equalToInList,
  List<double>? notEqualToInList,
  String? shouldMatch,
  String? shouldNotMatch,
  Validator? shouldPass,
  List<String>? inList,
  List<String>? notInList,
  String? customErrorText,
  Map<String, String>? customErrors,
  RuleOptions? options,
}) {
  return Rule(
    value,
    name: name ?? this.name,
    isRequired: isRequired ?? this.isRequired,
    isEmail: isEmail ?? this.isEmail,
    isUrl: isUrl ?? this.isUrl,
    isPhone: isPhone ?? this.isPhone,
    isIp: isIp ?? this.isIp,
    isNumeric: isNumeric ?? this.isNumeric,
    isNumericDecimal: isNumericDecimal ?? this.isNumericDecimal,
    isAlphaSpace: isAlphaSpace ?? this.isAlphaSpace,
    isAlphaNumeric: isAlphaNumeric ?? this.isAlphaNumeric,
    isAlphaNumericSpace: isAlphaNumericSpace ?? this.isAlphaNumericSpace,
    regex: regex ?? this.regex,
    length: length ?? this.length,
    minLength: minLength ?? this.minLength,
    maxLength: maxLength ?? this.maxLength,
    greaterThan: greaterThan ?? this.greaterThan,
    greaterThanEqualTo: greaterThanEqualTo ?? this.greaterThanEqualTo,
    lessThan: lessThan ?? this.lessThan,
    lessThanEqualTo: lessThanEqualTo ?? this.lessThanEqualTo,
    equalTo: equalTo ?? this.equalTo,
    notEqualTo: notEqualTo ?? this.notEqualTo,
    equalToInList: equalToInList ?? this.equalToInList,
    notEqualToInList: notEqualToInList ?? this.notEqualToInList,
    shouldMatch: shouldMatch ?? this.shouldMatch,
    shouldNotMatch: shouldNotMatch ?? this.shouldNotMatch,
    shouldPass: shouldPass ?? this.shouldPass,
    inList: inList ?? this.inList,
    notInList: notInList ?? this.notInList,
    customErrorText: customErrorText ?? this.customErrorText,
    customErrors: customErrors ?? this.customErrors,
    options: options ?? this.options,
  );
}