numOfWeeks method
Returns the number of ISO weeks in the specified year.
Implementation
int numOfWeeks(int targetYear) {
final DateTime dec28 = DateTime(targetYear, DateTime.december, 28);
final DateTime jan1 = DateTime(targetYear);
final int dayOfDec28 = dec28.difference(jan1).inDays + 1;
return ((dayOfDec28 - dec28.weekday + 10) / 7).floor();
}