Files
PiliPlus/lib/models/model_avatar.dart
bggRGjQaUbCoE e9dc154642 tweaks
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
2025-10-27 18:16:03 +08:00

54 lines
1.1 KiB
Dart

import 'package:PiliPlus/models/model_owner.dart';
class Avatar extends Owner {
Pendant? pendant;
BaseOfficialVerify? officialVerify;
Vip? vip;
Avatar.fromJson(Map<String, dynamic> json) : super.fromJson(json) {
if (json['pendant'] != null) pendant = Pendant.fromJson(json['pendant']);
if (json['official_verify'] != null) {
officialVerify = BaseOfficialVerify.fromJson(json['official_verify']);
}
if (json['vip'] != null) vip = Vip.fromJson(json['vip']);
}
}
class Pendant {
String? image;
Pendant.fromJson(Map<String, dynamic> json) {
image = json['image'];
}
}
class BaseOfficialVerify {
int? type;
String? desc;
BaseOfficialVerify.fromJson(Map<String, dynamic> json) {
type = json['type'];
desc = json['desc'];
}
}
class Vip {
int? type;
late int status;
Label? label;
Vip.fromJson(Map<String, dynamic> json) {
type = json['type'] ?? json['vipType'];
status = json['status'] ?? json['vipStatus'] ?? 0;
if (json['label'] != null) label = Label.fromJson(json['label']);
}
}
class Label {
String? text;
Label.fromJson(Map<String, dynamic> json) {
text = json['text'];
}
}