forked from eatvio/eatvio_app
23 lines
705 B
Dart
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);
|
|
}
|