wip: bloc for holidays
This commit is contained in:
30
lib/state/app/modules/holidays/bloc/holidays_state.dart
Normal file
30
lib/state/app/modules/holidays/bloc/holidays_state.dart
Normal file
@ -0,0 +1,30 @@
|
||||
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);
|
||||
}
|
Reference in New Issue
Block a user