widget refresh enhancements

This commit is contained in:
2026-08-06 20:22:32 +02:00
parent 646e2c0451
commit ab23422a86
22 changed files with 1027 additions and 99 deletions
+16
View File
@@ -61,6 +61,20 @@ abstract class WidgetPeriod with _$WidgetPeriod {
_$WidgetPeriodFromJson(json);
}
/// Per-day metadata for the week payload, so native renderers can derive a
/// single day's view (including its holiday state) without a day payload.
@freezed
abstract class WidgetDayInfo with _$WidgetDayInfo {
const factory WidgetDayInfo({
required DateTime date,
@Default(false) bool isHoliday,
String? holidayName,
}) = _WidgetDayInfo;
factory WidgetDayInfo.fromJson(Map<String, Object?> json) =>
_$WidgetDayInfoFromJson(json);
}
@freezed
abstract class WidgetTimetableData with _$WidgetTimetableData {
const factory WidgetTimetableData({
@@ -73,6 +87,8 @@ abstract class WidgetTimetableData with _$WidgetTimetableData {
@Default(<WidgetPeriod>[]) List<WidgetPeriod> periods,
@Default(false) bool isHoliday,
String? holidayName,
/// Week payload only: one entry per day of the covered window.
@Default(<WidgetDayInfo>[]) List<WidgetDayInfo> days,
}) = _WidgetTimetableData;
factory WidgetTimetableData.fromJson(Map<String, Object?> json) =>