getYear method

int getYear()

Year from an ISO date. "2024-03-20" → 2024

Implementation

int getYear() => int.parse(substring(0, 4));