show live rank

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-12-28 20:48:24 +08:00
parent a037d8e793
commit 2a52157c3f
24 changed files with 490 additions and 47 deletions

View File

@@ -0,0 +1,19 @@
import 'package:PiliPlus/models_new/live/live_contribution_rank/item.dart';
class LiveContributionRankData {
List<LiveContributionRankItem>? item;
LiveContributionRankData({
this.item,
});
factory LiveContributionRankData.fromJson(Map<String, dynamic> json) =>
LiveContributionRankData(
item: (json['item'] as List<dynamic>?)
?.map(
(e) =>
LiveContributionRankItem.fromJson(e as Map<String, dynamic>),
)
.toList(),
);
}

View File

@@ -0,0 +1,31 @@
import 'package:PiliPlus/models_new/live/live_contribution_rank/medal_info.dart';
class LiveContributionRankItem {
int? uid;
String? name;
String? face;
int? rank;
int? score;
MedalInfo? medalInfo;
LiveContributionRankItem({
this.uid,
this.name,
this.face,
this.rank,
this.score,
this.medalInfo,
});
factory LiveContributionRankItem.fromJson(Map<String, dynamic> json) =>
LiveContributionRankItem(
uid: json['uid'] as int?,
name: json['name'] as String?,
face: json['face'] as String?,
rank: json['rank'] as int?,
score: json['score'] as int?,
medalInfo: json['medal_info'] == null
? null
: MedalInfo.fromJson(json['medal_info'] as Map<String, dynamic>),
);
}

View File

@@ -0,0 +1,14 @@
class MedalInfo {
String? medalName;
int? level;
MedalInfo({
this.medalName,
this.level,
});
factory MedalInfo.fromJson(Map<String, dynamic> json) => MedalInfo(
medalName: json['medal_name'] as String?,
level: json['level'] as int?,
);
}