ValidationRule class

BASE ValidationRule class Define the required details in the constructor to extend and build your own validation rule.

Implementers

Constructors

ValidationRule({required String signature, String attribute = "", String title = "Invalid data", String description = "", String? textFieldMessage, Map<String, dynamic> info = const {}})

Properties

attribute String
getter/setter pair
description String
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
info Map<String, dynamic>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
signature String
getter/setter pair
textFieldMessage String?
getter/setter pair
title String
getter/setter pair

Methods

alert(dynamic context, {ToastNotificationStyleType style = ToastNotificationStyleType.WARNING, Duration? duration, Map<String, dynamic>? info}) → dynamic
The alert which will be displayed.
handle(Map<String, dynamic> info) bool
Handle the validation, the info variable will contain the following: info'rule' = Validation rule i.e "min". info'data' = Data the user has passed into the validation. info'message' = Overriding message to be displayed for validation (optional).
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