days static method

List<string> days([
  1. string? locale
])

Returns a list of strings representing the names of the days of the week.

The optional parameter locale can be used to specify the locale for formatting the day names. If no locale is provided, the default locale will be used.

Example:

List<String> days = days();
print(days); // [Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday]

Implementation

static List<string> days([string? locale]) => [for (var i = 1; i <= 7; i++) DateFormat.E(locale).format(DateTime(now.year, 1, i))];