forked from eatvio/eatvio_app
feat(diary): New models for calendar and autocomplete fix
This commit is contained in:
21
lib/features/calendar/models/calendar_model.dart
Normal file
21
lib/features/calendar/models/calendar_model.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'calendar_model.freezed.dart';
|
||||
part 'calendar_model.g.dart';
|
||||
|
||||
@freezed
|
||||
class CalendarModel with _$CalendarModel {
|
||||
const factory CalendarModel({
|
||||
required int id,
|
||||
required String state,
|
||||
required String image,
|
||||
required String description,
|
||||
@JsonKey(name: "youtube_url") required String youtubeUrl,
|
||||
@JsonKey(name: "created_at") required DateTime createdAt,
|
||||
@JsonKey(name: "updated_at") required DateTime updatedAt,
|
||||
required String title,
|
||||
}) = _CalendarModel;
|
||||
|
||||
factory CalendarModel.fromJson(Map<String, Object?> json) =>
|
||||
_$CalendarModelFromJson(json);
|
||||
}
|
||||
Reference in New Issue
Block a user