Day constructor
Day(
- int value
Creates a Day instance.
Throws ArgumentError if the value is not between 1 and 31.
Implementation
Day(this.value) {
if (value < 1 || value > 31) {
throw ArgumentError(
'Invalid day number: $value. Must be between 1 and 31.');
}
}