didvan-app/lib/models/home_page_content/result.dart

28 lines
668 B
Dart

class MainPageResultType {
final int id;
final String title;
final String image;
final String link;
final String createdAt;
final String type;
MainPageResultType({
required this.id,
required this.title,
required this.image,
required this.link,
required this.createdAt,
required this.type,
});
factory MainPageResultType.fromJson(Map<String, dynamic> json) =>
MainPageResultType(
id: json['id'],
title: json['title'],
image: json['image'] ?? 'https://wallpapercave.com/fwp/wp12977378.jpg',
link: json['link'],
createdAt: json['createdAt'],
type: json['type'],
);
}