feat: dyn reaction

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-06-19 21:23:54 +08:00
parent 16b38d1d3b
commit c4dd07ab0f
16 changed files with 710 additions and 198 deletions

View File

@@ -0,0 +1,20 @@
import 'package:PiliPlus/models_new/dynamic/dyn_reaction/item.dart';
class DynReactionData {
bool? hasMore;
List<DynReactionItem>? items;
String? offset;
int total;
DynReactionData({this.hasMore, this.items, this.offset, required this.total});
factory DynReactionData.fromJson(Map<String, dynamic> json) =>
DynReactionData(
hasMore: json['has_more'] as bool?,
items: (json['items'] as List<dynamic>?)
?.map((e) => DynReactionItem.fromJson(e as Map<String, dynamic>))
.toList(),
offset: json['offset'] as String?,
total: json['total'] as int? ?? 0,
);
}

View File

@@ -0,0 +1,21 @@
class DynReactionItem {
String? action;
String? face;
String? mid;
String? name;
DynReactionItem({
this.action,
this.face,
this.mid,
this.name,
});
factory DynReactionItem.fromJson(Map<String, dynamic> json) =>
DynReactionItem(
action: json['action'] as String?,
face: json['face'] as String?,
mid: json['mid'] as String?,
name: json['name'] as String?,
);
}