ValidationException class
Represents an error that occurs during validation.
ValidationException provides details about the validation error, including an optional key that identifies which field or property the error is associated with.
- Implemented types
Constructors
- ValidationException({required String message, required String code, required String entity, String key = '', int? index})
-
Constructs a ValidationException.
const
Properties
- code → String
-
An optional code that identifies the specific validation error.
final
- entity → String
-
The name of the entity (usually the class name) where the validation error occurred.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int?
-
The index of the item in a collection, if the validation error occurred within a list.
final
- key → String
-
An optional key that identifies the specific field or property related to the error.
final
- message → String
-
The error message describing what went wrong during validation.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{String? message, String? entity, String? key, String? code, int? index}) → ValidationException -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited