country_detail_entity.g.dart 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import 'package:fuwei/generated/json/base/json_convert_content.dart';
  2. import 'package:fuwei/data/country_detail_entity.dart';
  3. CountryDetailEntity $CountryDetailEntityFromJson(Map<String, dynamic> json) {
  4. final CountryDetailEntity countryDetailEntity = CountryDetailEntity();
  5. final int? id = jsonConvert.convert<int>(json['id']);
  6. if (id != null) {
  7. countryDetailEntity.id = id;
  8. }
  9. final String? countryName = jsonConvert.convert<String>(json['country_name']);
  10. if (countryName != null) {
  11. countryDetailEntity.countryName = countryName;
  12. }
  13. final String? countryImgUrl =
  14. jsonConvert.convert<String>(json['country_img_url']);
  15. if (countryImgUrl != null) {
  16. countryDetailEntity.countryImgUrl = countryImgUrl;
  17. }
  18. final String? countryContent =
  19. jsonConvert.convert<String>(json['country_content']);
  20. if (countryContent != null) {
  21. countryDetailEntity.countryContent = countryContent;
  22. }
  23. final List<CountryDetailCountryVisitVisaUrl>? countryVisitVisaUrl =
  24. jsonConvert.convertListNotNull<CountryDetailCountryVisitVisaUrl>(
  25. json['country_visit_visa_url']);
  26. if (countryVisitVisaUrl != null) {
  27. countryDetailEntity.countryVisitVisaUrl = countryVisitVisaUrl;
  28. }
  29. return countryDetailEntity;
  30. }
  31. Map<String, dynamic> $CountryDetailEntityToJson(CountryDetailEntity entity) {
  32. final Map<String, dynamic> data = <String, dynamic>{};
  33. data['id'] = entity.id;
  34. data['country_name'] = entity.countryName;
  35. data['country_img_url'] = entity.countryImgUrl;
  36. data['country_content'] = entity.countryContent;
  37. data['country_visit_visa_url'] =
  38. entity.countryVisitVisaUrl.map((v) => v.toJson()).toList();
  39. return data;
  40. }
  41. CountryDetailCountryVisitVisaUrl $CountryDetailCountryVisitVisaUrlFromJson(
  42. Map<String, dynamic> json) {
  43. final CountryDetailCountryVisitVisaUrl countryDetailCountryVisitVisaUrl =
  44. CountryDetailCountryVisitVisaUrl();
  45. final String? fileName = jsonConvert.convert<String>(json['file_name']);
  46. if (fileName != null) {
  47. countryDetailCountryVisitVisaUrl.fileName = fileName;
  48. }
  49. final String? fileUrl = jsonConvert.convert<String>(json['file_url']);
  50. if (fileUrl != null) {
  51. countryDetailCountryVisitVisaUrl.fileUrl = fileUrl;
  52. }
  53. return countryDetailCountryVisitVisaUrl;
  54. }
  55. Map<String, dynamic> $CountryDetailCountryVisitVisaUrlToJson(
  56. CountryDetailCountryVisitVisaUrl entity) {
  57. final Map<String, dynamic> data = <String, dynamic>{};
  58. data['file_name'] = entity.fileName;
  59. data['file_url'] = entity.fileUrl;
  60. return data;
  61. }