NyValidator class

Constructors

NyValidator()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

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}) bool
Check if validation is successful.