Line data Source code
1 : import 'package:alh_calendar/models/calendar_day.dart'; 2 : import 'package:flutter/cupertino.dart'; 3 : 4 : /// Represents a week of the calendar. 5 : @immutable 6 : class CalendarWeek { 7 : /// Every week contains a list of 7 CalendarDay. 8 : final List<CalendarDay> days; 9 : 10 24 : const CalendarWeek({required this.days}) : assert(days.length == 7); 11 : 12 5 : @override 13 : bool operator ==(Object other) { 14 5 : return (other is CalendarWeek) && 15 25 : other.days[0] == this.days[0] && 16 25 : other.days[1] == this.days[1] && 17 25 : other.days[2] == this.days[2] && 18 25 : other.days[3] == this.days[3] && 19 25 : other.days[4] == this.days[4] && 20 25 : other.days[5] == this.days[5] && 21 25 : other.days[6] == this.days[6]; 22 : } 23 : 24 0 : @override 25 0 : int get hashCode => days.hashCode; 26 : }