It can be done in Java by
com.ibm.icu.util.Calendar.getInstance(Locale alocale).getFirstDayOfWeek()
Is there an equivalent way to get it in Dart?
This thing worked for me
DateTime today = DateTime.now();
_firstDayOfTheweek = today.subtract(new Duration(days: today.weekday));
With Flutter you can use just:
MaterialLocalizations.of(context).firstDayOfWeekIndex;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With