NyValidator class
Properties
hashCode
→ int
The hash code for this object.
no setter inherited
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
Methods
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString ()
→ String
A string representation of this object.
inherited
Static Methods
check ({required Map <String , String > rules , required Map <String , dynamic > data , Map <String , dynamic > messages = const {} , bool showAlert = true , Duration ? alertDuration , ToastNotificationStyleType alertStyle = ToastNotificationStyleType.warning , BuildContext ? context })
→ dynamic
NyValidator provides an easy way to validate data.
You can use this method like in the example below:
try {
NyValidator.check(rules: {
"email": "email|max:20",
"name": "min:10"
}, data: {
"email": _textEditingEmailController.text,
"name": _textEditingNameController.text
});
isSuccessful ({required Map <String , dynamic > rules , Map <String , dynamic > ? data , dynamic onFailure (ValidationException error )? })
→ bool
Check if validation is successful.