daysInMonth static method
Computes the number of days in the given month taking leap years into account.
Dates.daysInMonth(2019, 2); // 28
Dates.daysInMonth(2020, 2); // 29
Implementation
@useResult static int daysInMonth(int year, int month) => month == 2 ? (leapYear(year) ? 29 : 28) : _months[month - 1];