Year constructor

Year(
  1. int value
)

Creates a Year instance.

Throws ArgumentError if the value is less than 1 (i.e., BCE years are not supported by default).

Implementation

Year(this.value) {
  if (value < 1) {
    throw ArgumentError(
        'Invalid year number: $value. Must be 1 or greater (AD/CE).');
  }
}