UpdateInfo.dart 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. class UpdateInfo {
  2. bool needUpdate;
  3. LastVersion lastVersion;
  4. UpdateInfo({this.needUpdate, this.lastVersion});
  5. UpdateInfo.fromJson(Map<String, dynamic> json) {
  6. needUpdate = json['need_update'];
  7. lastVersion = json['last_version'] != null
  8. ? new LastVersion.fromJson(json['last_version'])
  9. : null;
  10. }
  11. Map<String, dynamic> toJson() {
  12. final Map<String, dynamic> data = new Map<String, dynamic>();
  13. data['need_update'] = this.needUpdate;
  14. if (this.lastVersion != null) {
  15. data['last_version'] = this.lastVersion.toJson();
  16. }
  17. return data;
  18. }
  19. }
  20. class LastVersion {
  21. int id;
  22. String version;
  23. String downloadUrl;
  24. String detail;
  25. int fileSize;
  26. String createdAt;
  27. LastVersion(
  28. {this.id,
  29. this.version,
  30. this.downloadUrl,
  31. this.detail,
  32. this.fileSize,
  33. this.createdAt});
  34. LastVersion.fromJson(Map<String, dynamic> json) {
  35. id = json['id'];
  36. version = json['version'];
  37. downloadUrl = json['download_url'];
  38. detail = json['detail'];
  39. fileSize = json['file_size'];
  40. createdAt = json['created_at'];
  41. }
  42. Map<String, dynamic> toJson() {
  43. final Map<String, dynamic> data = new Map<String, dynamic>();
  44. data['id'] = this.id;
  45. data['version'] = this.version;
  46. data['download_url'] = this.downloadUrl;
  47. data['detail'] = this.detail;
  48. data['file_size'] = this.fileSize;
  49. data['created_at'] = this.createdAt;
  50. return data;
  51. }
  52. }