BpmValidator class final
Validator for BPM (beats per minute) tag values.
This validator ensures that BPM values are within the valid range of 1-999 (inclusive), representing realistic musical tempos from very slow ballads to extremely fast electronic music.
Error keys:
outOfRange: Value is outside the valid range (1-999)
Example usage:
const validator = BpmValidator();
final error = validator.validate(120); // null (valid)
final error2 = validator.validate(0); // {outOfRange: {...}}
final error3 = validator.validate(1000); // {outOfRange: {...}}
- Inheritance
-
- Object
- TagValidator<
int> - BpmValidator
Constructors
- BpmValidator()
-
Creates a new BPM validator.
const
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
-
formatErrorMessage(
Map< String, dynamic> error) → String -
Formats the error map into a human-readable error message.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validate(
int? value) → Map< String, dynamic> ? -
Validates the given value.
override
-
validateOrThrow(
int value) → int -
Validates the value and throws an ArgumentError if invalid.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited