Rule class

Rule Class: This is the basic building block, everything starts here. Refer https://github.com/ganeshrvel/pub-rules/blob/master/README.md#1-rule-basic-rule for usage details

Constructors

Rule(String? value, {required String name, Map<String, String>? customErrors, String? customErrorText, bool isEmail = false, bool isPhone = false, bool isIp = false, bool isUrl = false, bool isRequired = false, bool isNumeric = false, bool isNumericDecimal = false, bool isAlphaSpace = false, bool isAlphaNumeric = false, bool isAlphaNumericSpace = false, 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, List<String>? inList, List<String>? notInList, String? shouldMatch, String? shouldNotMatch, Validator? shouldPass, RuleOptions? options})

Properties

customErrors Map<String, String>?
final
customErrorText String?
final
equalTo double?
final
equalToInList List<double>?
final
error String?
outputs the error text (string)
no setter
greaterThan double?
final
greaterThanEqualTo double?
final
hasError bool
outputs true if there is a validation error else false
no setter
hashCode int
The hash code for this object.
no setterinherited
inList List<String>?
final
isAlphaNumeric bool
final
isAlphaNumericSpace bool
final
isAlphaSpace bool
final
isEmail bool
final
isIp bool
final
isNumeric bool
final
isNumericDecimal bool
getter/setter pair
isPhone bool
final
isRequired bool
final
isUrl bool
final
length int?
final
lessThan double?
final
lessThanEqualTo double?
final
maxLength int?
final
minLength int?
final
name String
final
notEqualTo double?
final
notEqualToInList List<double>?
final
notInList List<String>?
final
options RuleOptions?
getter/setter pair
regex RegExp?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldMatch String?
final
shouldNotMatch String?
final
shouldPass Validator?
final
value String?
getter/setter pair

Methods

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}) Rule
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited