country_entity.dart 585 B

123456789101112131415161718192021222324
  1. import 'package:fuwei/generated/json/base/json_field.dart';
  2. import 'package:fuwei/generated/json/country_entity.g.dart';
  3. import 'dart:convert';
  4. @JsonSerializable()
  5. class CountryEntity {
  6. late int id;
  7. @JSONField(name: "country_name")
  8. late String countryName;
  9. @JSONField(name: "country_img_url")
  10. late String countryImgUrl;
  11. CountryEntity();
  12. factory CountryEntity.fromJson(Map<String, dynamic> json) =>
  13. $CountryEntityFromJson(json);
  14. Map<String, dynamic> toJson() => $CountryEntityToJson(this);
  15. @override
  16. String toString() {
  17. return jsonEncode(this);
  18. }
  19. }