dayOfTheWeekIndex method
Returns the index of the day of the week
With the given firstDay
as the first day of the week
Implementation
int dayOfTheWeekIndex({Weekday firstDay = Weekday.monday}) {
final firstDayIndex = firstDay.index;
final index = weekday - 1;
return (index - firstDayIndex + 7) % 7;
}