forked from eatvio/eatvio_app
24 lines
685 B
Dart
24 lines
685 B
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part 'diary_model.freezed.dart';
|
|
part 'diary_model.g.dart';
|
|
|
|
@freezed
|
|
class DiaryModel with _$DiaryModel {
|
|
const factory DiaryModel({
|
|
required int id,
|
|
required String state,
|
|
String? image,
|
|
required String description,
|
|
String? author_name,
|
|
String? author_avatar_path,
|
|
@JsonKey(name: "youtube_url") required String youtubeUrl,
|
|
@JsonKey(name: "created_at") required DateTime createdAt,
|
|
@JsonKey(name: "updated_at") required DateTime updatedAt,
|
|
required String title,
|
|
}) = _DiaryModel;
|
|
|
|
factory DiaryModel.fromJson(Map<String, Object?> json) =>
|
|
_$DiaryModelFromJson(json);
|
|
}
|