curWeekdayAsString top-level property Null safety

String curWeekdayAsString

Returns current day of the week as a text String.

Implementation

String get curWeekdayAsString {
  var days = <int, String>{
    1: 'Monday',
    2: 'Tuesday',
    3: 'Wednesday',
    4: 'Thursday',
    5: 'Friday',
    6: 'Saturday',
    7: 'Sunday'
  };
  var now = DateTime.now();
  return days[now.weekday]!;
}