import 'package:domain/generated/json/base/json_field.dart'; import 'package:domain/generated/json/latest_news_page_entity.g.dart'; import 'dart:convert'; export 'package:domain/generated/json/latest_news_page_entity.g.dart'; @JsonSerializable() class LatestNewsPageEntity { int count = 0; int page = 0; int limit = 0; @JSONField(name: "count_page") int countPage = 0; List? list = []; LatestNewsPageEntity(); factory LatestNewsPageEntity.fromJson(Map json) => $LatestNewsPageEntityFromJson(json); Map toJson() => $LatestNewsPageEntityToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class LatestNewsList { String? id; int type = 0; String? title; @JSONField(name: "cover_image") String? coverImage; String? content; @JSONField(name: "created_at") String? createdAt; LatestNewsList(); factory LatestNewsList.fromJson(Map json) => $LatestNewsListFromJson(json); Map toJson() => $LatestNewsListToJson(this); @override String toString() { return jsonEncode(this); } }