last_day_of_month function
Implementation
int last_day_of_month(DateTime month) {
var beginning_next_month = (month.month < 12)
? new DateTime(month.year, month.month + 1, 1)
: new DateTime(month.year + 1, 1, 1);
return beginning_next_month.subtract(new Duration(days: 1)).day;
}