mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-22 19:40:10 +08:00
feat: live feedback (#2456)
This commit is contained in:
committed by
GitHub
parent
2d389424af
commit
3a5636ecee
@@ -1,3 +1,4 @@
|
||||
import 'package:PiliPlus/models_new/live/live_feed_index/feedback.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_feed_index/watched_show.dart';
|
||||
import 'package:PiliPlus/utils/parse_string.dart';
|
||||
|
||||
@@ -14,6 +15,7 @@ class CardLiveItem {
|
||||
int? areaV2Id;
|
||||
int? areaV2ParentId;
|
||||
WatchedShow? watchedShow;
|
||||
List<Feedback>? feedback;
|
||||
|
||||
CardLiveItem({
|
||||
this.roomid,
|
||||
@@ -27,6 +29,7 @@ class CardLiveItem {
|
||||
this.areaV2Id,
|
||||
this.areaV2ParentId,
|
||||
this.watchedShow,
|
||||
this.feedback,
|
||||
}) : _systemCover = nonNullOrEmptyString(systemCover);
|
||||
|
||||
factory CardLiveItem.fromJson(Map<String, dynamic> json) => CardLiveItem(
|
||||
@@ -43,5 +46,8 @@ class CardLiveItem {
|
||||
watchedShow: json['watched_show'] == null
|
||||
? null
|
||||
: WatchedShow.fromJson(json['watched_show'] as Map<String, dynamic>),
|
||||
feedback: (json['feedback'] as List?)
|
||||
?.map((x) => Feedback.fromJson(x))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
|
||||
47
lib/models_new/live/live_feed_index/feedback.dart
Normal file
47
lib/models_new/live/live_feed_index/feedback.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
class Feedback {
|
||||
Feedback({
|
||||
this.title,
|
||||
this.subtitle,
|
||||
this.type,
|
||||
this.reasons,
|
||||
});
|
||||
|
||||
final String? title;
|
||||
final String? subtitle;
|
||||
final String? type;
|
||||
final List<Reason>? reasons;
|
||||
|
||||
factory Feedback.fromJson(Map<String, dynamic> json) {
|
||||
return Feedback(
|
||||
title: json['title'],
|
||||
subtitle: json['subtitle'],
|
||||
type: json['type'],
|
||||
reasons: (json['reasons'] as List?)
|
||||
?.map((x) => Reason.fromJson(x))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Reason {
|
||||
Reason({
|
||||
this.id,
|
||||
this.name,
|
||||
this.idType,
|
||||
this.reasonId,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final String? name;
|
||||
final String? idType;
|
||||
final int? reasonId;
|
||||
|
||||
factory Reason.fromJson(Map<String, dynamic> json) {
|
||||
return Reason(
|
||||
id: json['id'],
|
||||
name: json['name'],
|
||||
idType: json['id_type'],
|
||||
reasonId: json['reason_id'],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user