topic_hot_model.dart 1000 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import 'dart:core';
  2. /// @author: bo.zeng
  3. /// @email: cnhbwds@gmail.com
  4. /// @date: 2025 2025/4/9 16:00
  5. /// @description:
  6. class TopicHotModel {
  7. TopicHotModel({String? image, String? title, String? contentId}) {
  8. _image = image;
  9. _title = title;
  10. _contentId = contentId;
  11. }
  12. TopicHotModel.fromJson(Map<String, dynamic> json) {
  13. _image = json['image'];
  14. _title = json['title'];
  15. _contentId = json['contentId'];
  16. }
  17. String? _image;
  18. String? _title;
  19. String? _contentId;
  20. TopicHotModel copyWith({String? image, String? title, String? contentId}) =>
  21. TopicHotModel(
  22. image: image ?? _image,
  23. title: title ?? _title,
  24. contentId: contentId ?? _contentId,
  25. );
  26. String? get image => _image;
  27. String? get title => _title;
  28. String? get contentId => _contentId;
  29. Map<String, dynamic> toJson() {
  30. final map = <String, dynamic>{};
  31. map['image'] = _image;
  32. map['title'] = _title;
  33. map['contentId'] = _contentId;
  34. return map;
  35. }
  36. }