31 lines
809 B
Dart
31 lines
809 B
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
part 'holidays_state.freezed.dart';
|
|
part 'holidays_state.g.dart';
|
|
|
|
@freezed
|
|
class HolidaysState with _$HolidaysState {
|
|
const factory HolidaysState({
|
|
required bool showPastHolidays,
|
|
required bool showDisclaimer,
|
|
required List<Holiday> holidays,
|
|
}) = _HolidaysState;
|
|
|
|
factory HolidaysState.fromJson(Map<String, Object?> json) => _$HolidaysStateFromJson(json);
|
|
}
|
|
|
|
@freezed
|
|
class Holiday with _$Holiday {
|
|
const factory Holiday({
|
|
required String start,
|
|
required String end,
|
|
required int year,
|
|
required String stateCode,
|
|
required String name,
|
|
required String slug,
|
|
}) = _Holiday;
|
|
|
|
factory Holiday.fromJson(Map<String, Object?> json) => _$HolidayFromJson(json);
|
|
}
|