year property

Duration get year

Converts this number to a Duration in years.

Fractional values are truncated with toInt(). Example: 2.year -> Duration(days: 730) for news cache TTL.

Implementation

Duration get year => Duration(days: toInt() * 365);