widget refresh enhancements
This commit is contained in:
@@ -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) =>
|
||||
|
||||
Reference in New Issue
Block a user