@@ -44,7 +44,7 @@ class _State extends State<CalendarView> {
44
44
45
45
void _onDaySelected (DateTime selected, DateTime focused) {
46
46
HapticFeedback .selectionClick ();
47
- context.read <ModuleState >().selected = selected.floor ();
47
+ context.read <DashboardState >().selected = selected.floor ();
48
48
}
49
49
50
50
@override
@@ -108,10 +108,10 @@ class _State extends State<CalendarView> {
108
108
DashboardDatabase .CALENDAR_STARTING_SIZE ,
109
109
],
110
110
builder: (context, _) {
111
- DateTime firstDay = context.watch <ModuleState >().today.subtract (
111
+ DateTime firstDay = context.watch <DashboardState >().today.subtract (
112
112
Duration (days: DashboardDatabase .CALENDAR_DAYS_PAST .read ()),
113
113
);
114
- DateTime lastDay = context.watch <ModuleState >().today.add (
114
+ DateTime lastDay = context.watch <DashboardState >().today.add (
115
115
Duration (days: DashboardDatabase .CALENDAR_DAYS_FUTURE .read ()),
116
116
);
117
117
return SafeArea (
@@ -124,7 +124,7 @@ class _State extends State<CalendarView> {
124
124
),
125
125
rowHeight: 48.0 ,
126
126
rangeSelectionMode: RangeSelectionMode .disabled,
127
- focusedDay: context.watch <ModuleState >().selected,
127
+ focusedDay: context.watch <DashboardState >().selected,
128
128
firstDay: firstDay,
129
129
lastDay: lastDay,
130
130
//events: widget.events,
@@ -142,7 +142,8 @@ class _State extends State<CalendarView> {
142
142
startingDayOfWeek:
143
143
DashboardDatabase .CALENDAR_STARTING_DAY .read ().data,
144
144
selectedDayPredicate: (date) {
145
- return date.floor () == context.read <ModuleState >().selected;
145
+ return date.floor () ==
146
+ context.read <DashboardState >().selected;
146
147
},
147
148
calendarStyle: CalendarStyle (
148
149
markersMaxCount: 1 ,
@@ -170,7 +171,7 @@ class _State extends State<CalendarView> {
170
171
todayTextStyle: dayStyle,
171
172
),
172
173
onFormatChanged: (format) {
173
- context.read <ModuleState >().calendarFormat = format;
174
+ context.read <DashboardState >().calendarFormat = format;
174
175
},
175
176
daysOfWeekStyle: DaysOfWeekStyle (
176
177
weekendStyle: weekdayStyle,
@@ -180,7 +181,7 @@ class _State extends State<CalendarView> {
180
181
if (widget.events.isEmpty) return [];
181
182
return widget.events[date.floor ()] ?? [];
182
183
},
183
- calendarFormat: context.watch <ModuleState >().calendarFormat,
184
+ calendarFormat: context.watch <DashboardState >().calendarFormat,
184
185
availableCalendarFormats: const {
185
186
CalendarFormat .month: 'Month' ,
186
187
CalendarFormat .twoWeeks: '2 Weeks' ,
@@ -228,7 +229,7 @@ class _State extends State<CalendarView> {
228
229
}
229
230
230
231
Widget _calendarList () {
231
- final selected = context.read <ModuleState >().selected;
232
+ final selected = context.read <DashboardState >().selected;
232
233
final events = widget.events[selected.floor ()] ?? [];
233
234
if (events.isEmpty) {
234
235
return Expanded (
0 commit comments