country_entity.dart 567 B

1234567891011121314151617181920212223
  1. import 'package:hengyi/generated/json/base/json_field.dart';
  2. import 'package:hengyi/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) => $CountryEntityFromJson(json);
  13. Map<String, dynamic> toJson() => $CountryEntityToJson(this);
  14. @override
  15. String toString() {
  16. return jsonEncode(this);
  17. }
  18. }