Files
eatvio_app/lib/features/blog_post/models/blog_post_model.dart
2024-07-15 17:06:13 +03:00

23 lines
705 B
Dart

import 'package:freezed_annotation/freezed_annotation.dart';
part 'blog_post_model.freezed.dart';
part 'blog_post_model.g.dart';
@freezed
class BlogPostModel with _$BlogPostModel {
const factory BlogPostModel({
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,
}) = _BlogPostModel;
factory BlogPostModel.fromJson(Map<String, Object?> json) => _$BlogPostModelFromJson(json);
}