lastSevenDays property

List<DateRange> get lastSevenDays

Implementation

List<DateRange> get lastSevenDays {
  final start = thisDayFirstSecond;
  final end = thisDayLastSecond;
  final today = DateRange(thisDayFirstSecond, thisDayLastSecond);
  final yesterday = DateRange(
      start.subtract(Duration(days: 1)), end.subtract(Duration(days: 1)));
  final twoDaysAgo = DateRange(
      start.subtract(Duration(days: 2)), end.subtract(Duration(days: 2)));
  final threeDaysAgo = DateRange(
      start.subtract(Duration(days: 3)), end.subtract(Duration(days: 3)));
  final fourDaysAgo = DateRange(
      start.subtract(Duration(days: 4)), end.subtract(Duration(days: 4)));
  final fiveDaysAgo = DateRange(
      start.subtract(Duration(days: 5)), end.subtract(Duration(days: 5)));
  final sixDaysAgo = DateRange(
      start.subtract(Duration(days: 6)), end.subtract(Duration(days: 6)));

  return [
    today,
    yesterday,
    twoDaysAgo,
    threeDaysAgo,
    fourDaysAgo,
    fiveDaysAgo,
    sixDaysAgo
  ];
}