years property

num? get years

Implementation

num? get years =>
    isDuration && isYears(unit) ? num.parse(value.asUcumDecimal()) : null;