ugc_model.dart 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import 'package:equatable/equatable.dart';
  2. import 'package:json_annotation/json_annotation.dart';
  3. import 'ugc_author_model.dart';
  4. import 'ugc_tag_model.dart';
  5. part 'ugc_model.g.dart';
  6. @JsonSerializable()
  7. class UgcModel extends Equatable {
  8. factory UgcModel.fromJson(Map<String, dynamic> json) =>
  9. _$UgcModelFromJson(json);
  10. Map<String, dynamic> toJson(instance) => _$UgcModelToJson(this);
  11. @JsonKey(name: "id")
  12. final int id;
  13. @JsonKey(name: "title")
  14. final String title;
  15. @JsonKey(name: "description")
  16. final String description;
  17. @JsonKey(name: "category")
  18. final String category;
  19. @JsonKey(name: "cover")
  20. final String cover;
  21. @JsonKey(name: "coverBlurredBg")
  22. final String coverBlurredBg;
  23. @JsonKey(name: "playUrl")
  24. final String playUrl;
  25. @JsonKey(name: "duration")
  26. final int duration;
  27. @JsonKey(name: "syncTime")
  28. final String syncTime;
  29. @JsonKey(name: "author")
  30. final Author author;
  31. @JsonKey(name: "tags")
  32. final List<Tag> tags;
  33. UgcModel({
  34. this.id,
  35. this.title,
  36. this.description,
  37. this.category,
  38. this.cover,
  39. this.coverBlurredBg,
  40. this.playUrl,
  41. this.duration,
  42. this.syncTime,
  43. this.author,
  44. this.tags,
  45. });
  46. @override
  47. List<Object> get props => [
  48. id,
  49. title,
  50. description,
  51. category,
  52. cover,
  53. coverBlurredBg,
  54. playUrl,
  55. duration,
  56. syncTime,
  57. author,
  58. tags
  59. ];
  60. }