Added holidays viewer
This commit is contained in:
38
lib/api/holidays/getHolidaysResponse.dart
Normal file
38
lib/api/holidays/getHolidaysResponse.dart
Normal file
@ -0,0 +1,38 @@
|
||||
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import '../apiResponse.dart';
|
||||
|
||||
part 'getHolidaysResponse.g.dart';
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GetHolidaysResponse extends ApiResponse {
|
||||
List<GetHolidaysResponseObject> data;
|
||||
|
||||
GetHolidaysResponse(this.data);
|
||||
|
||||
factory GetHolidaysResponse.fromJson(Map<String, dynamic> json) => _$GetHolidaysResponseFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$GetHolidaysResponseToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class GetHolidaysResponseObject {
|
||||
String start;
|
||||
String end;
|
||||
int year;
|
||||
String stateCode;
|
||||
String name;
|
||||
String slug;
|
||||
|
||||
GetHolidaysResponseObject({
|
||||
required this.start,
|
||||
required this.end,
|
||||
required this.year,
|
||||
required this.stateCode,
|
||||
required this.name,
|
||||
required this.slug
|
||||
});
|
||||
|
||||
factory GetHolidaysResponseObject.fromJson(Map<String, dynamic> json) => _$GetHolidaysResponseObjectFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$GetHolidaysResponseObjectToJson(this);
|
||||
}
|
Reference in New Issue
Block a user