AlbumValidator class final

Validator for album tag values.

This validator ensures that album values are not empty or whitespace-only.

Error keys:

  • empty: Value is empty or contains only whitespace

Example usage:

const validator = AlbumValidator();

final error = validator.validate('Abbey Road');  // null (valid)
final error2 = validator.validate('');           // {empty: {...}}
Inheritance

Constructors

AlbumValidator()
Creates a new album validator.
const

Properties

fieldName String
The field name for error messages.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

formatErrorMessage(Map<String, dynamic> error) String
Formats the error map into a human-readable error message.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validate(String? value) Map<String, dynamic>?
Validates the given value.
inherited
validateOrThrow(String value) String
Validates the value and throws an ArgumentError if invalid.
inherited

Operators

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

Static Methods

isValid(String? value) bool
Checks if a value is a valid album.