copyWith method
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,
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,
);
}