mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: avatar model (#814)
This commit is contained in:
committed by
GitHub
parent
07d2b3b464
commit
cdeb843a84
@@ -6,16 +6,16 @@ import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class Avatar extends StatelessWidget {
|
||||
class PendantAvatar extends StatelessWidget {
|
||||
final _BadgeType _badgeType;
|
||||
final String avatar;
|
||||
final String? avatar;
|
||||
final double size;
|
||||
final double badgeSize;
|
||||
final String? garbPendantImage;
|
||||
final dynamic roomId;
|
||||
final VoidCallback? onTap;
|
||||
|
||||
const Avatar({
|
||||
const PendantAvatar({
|
||||
super.key,
|
||||
required this.avatar,
|
||||
this.size = 80,
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:PiliPlus/common/widgets/avatar.dart';
|
||||
import 'package:PiliPlus/common/widgets/pendant_avatar.dart';
|
||||
import 'package:PiliPlus/models/dynamics/article_content_model.dart';
|
||||
import 'package:PiliPlus/models/model_owner.dart';
|
||||
import 'package:PiliPlus/models/model_avatar.dart';
|
||||
|
||||
class DynamicsDataModel {
|
||||
bool? hasMore;
|
||||
@@ -218,7 +218,7 @@ class Basic {
|
||||
}
|
||||
|
||||
// 单个动态详情 - 作者信息
|
||||
class ModuleAuthorModel extends Owner {
|
||||
class ModuleAuthorModel extends Avatar {
|
||||
bool? following;
|
||||
String? jumpUrl;
|
||||
String? label;
|
||||
@@ -226,25 +226,21 @@ class ModuleAuthorModel extends Owner {
|
||||
String? pubTime;
|
||||
int? pubTs;
|
||||
String? type;
|
||||
Map? vip;
|
||||
Map? decorate;
|
||||
Map? pendant;
|
||||
|
||||
ModuleAuthorModel.fromJson(Map<String, dynamic> json) {
|
||||
face = json['face'];
|
||||
ModuleAuthorModel.fromJson(Map<String, dynamic> json) : super.fromJson(json) {
|
||||
if (json['official'] != null) {
|
||||
officialVerify ??= BaseOfficialVerify.fromJson(json['official']); // opus
|
||||
}
|
||||
following = json['following'];
|
||||
jumpUrl = json['jump_url'];
|
||||
label = json['label'];
|
||||
mid = json['mid'];
|
||||
name = json['name'];
|
||||
pubAction = json['pub_action'];
|
||||
pubTime = json['pub_time'];
|
||||
pubTs = json['pub_ts'] == 0 ? null : json['pub_ts'];
|
||||
type = json['type'];
|
||||
vip = json['vip'];
|
||||
if (Avatar.showDynDecorate) {
|
||||
if (PendantAvatar.showDynDecorate) {
|
||||
decorate = json['decorate'];
|
||||
pendant = json['pendant'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:PiliPlus/models/model_avatar.dart';
|
||||
|
||||
class MemberInfoModel {
|
||||
MemberInfoModel({
|
||||
this.mid,
|
||||
@@ -44,27 +46,6 @@ class MemberInfoModel {
|
||||
}
|
||||
}
|
||||
|
||||
class Vip {
|
||||
Vip({
|
||||
this.type,
|
||||
this.status,
|
||||
this.dueDate,
|
||||
this.label,
|
||||
});
|
||||
|
||||
int? type;
|
||||
int? status;
|
||||
int? dueDate;
|
||||
Map? label;
|
||||
|
||||
Vip.fromJson(Map<String, dynamic> json) {
|
||||
type = json['type'];
|
||||
status = json['status'];
|
||||
dueDate = json['due_date'];
|
||||
label = json['label'];
|
||||
}
|
||||
}
|
||||
|
||||
class LiveRoom {
|
||||
LiveRoom({
|
||||
this.roomStatus,
|
||||
|
||||
73
lib/models/model_avatar.dart
Normal file
73
lib/models/model_avatar.dart
Normal file
@@ -0,0 +1,73 @@
|
||||
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 {
|
||||
int? pid;
|
||||
String? name;
|
||||
String? image;
|
||||
|
||||
Pendant.fromJson(Map<String, dynamic> json) {
|
||||
pid = json['pid'];
|
||||
name = json['name'];
|
||||
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;
|
||||
int? dueDate;
|
||||
Label? label;
|
||||
|
||||
Vip.fromJson(Map<String, dynamic> json) {
|
||||
type = json['type'];
|
||||
status = json['status'] ?? 0;
|
||||
dueDate = json['due_date'];
|
||||
if (json['label'] != null) label = Label.fromJson(json['label']);
|
||||
}
|
||||
}
|
||||
|
||||
class Label {
|
||||
String? path;
|
||||
String? text;
|
||||
String? labelTheme;
|
||||
String? textColor;
|
||||
int? bgStyle;
|
||||
String? bgColor;
|
||||
String? borderColor;
|
||||
String? image;
|
||||
|
||||
Label.fromJson(Map<String, dynamic> json) {
|
||||
path = json['path'];
|
||||
text = json['text'];
|
||||
labelTheme = json['label_theme'];
|
||||
textColor = json['text_color'];
|
||||
bgStyle = json['bg_style'];
|
||||
bgColor = json['bg_color'];
|
||||
borderColor = json['border_color'];
|
||||
image = json['image'];
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,4 @@
|
||||
import 'package:PiliPlus/models/space/pr_info.dart';
|
||||
import 'package:PiliPlus/models/space/space_tag_bottom.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:PiliPlus/models/model_avatar.dart' hide Avatar;
|
||||
import 'package:PiliPlus/models/space/achieve.dart';
|
||||
import 'package:PiliPlus/models/space/avatar.dart';
|
||||
import 'package:PiliPlus/models/space/entrance.dart';
|
||||
@@ -11,10 +8,11 @@ import 'package:PiliPlus/models/space/likes.dart';
|
||||
import 'package:PiliPlus/models/space/nameplate.dart';
|
||||
import 'package:PiliPlus/models/space/nft_certificate.dart';
|
||||
import 'package:PiliPlus/models/space/official_verify.dart';
|
||||
import 'package:PiliPlus/models/space/pendant.dart';
|
||||
import 'package:PiliPlus/models/space/pr_info.dart';
|
||||
import 'package:PiliPlus/models/space/profession_verify.dart';
|
||||
import 'package:PiliPlus/models/space/relation.dart';
|
||||
import 'package:PiliPlus/models/space/vip.dart';
|
||||
import 'package:PiliPlus/models/space/space_tag_bottom.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'card.g.dart';
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'label.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Label {
|
||||
String? path;
|
||||
String? text;
|
||||
@JsonKey(name: 'label_theme')
|
||||
String? labelTheme;
|
||||
@JsonKey(name: 'text_color')
|
||||
String? textColor;
|
||||
@JsonKey(name: 'bg_style')
|
||||
int? bgStyle;
|
||||
@JsonKey(name: 'bg_color')
|
||||
String? bgColor;
|
||||
@JsonKey(name: 'border_color')
|
||||
String? borderColor;
|
||||
String? image;
|
||||
|
||||
Label({
|
||||
this.path,
|
||||
this.text,
|
||||
this.labelTheme,
|
||||
this.textColor,
|
||||
this.bgStyle,
|
||||
this.bgColor,
|
||||
this.borderColor,
|
||||
this.image,
|
||||
});
|
||||
|
||||
factory Label.fromJson(Map<String, dynamic> json) => _$LabelFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$LabelToJson(this);
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'label.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Label _$LabelFromJson(Map<String, dynamic> json) => Label(
|
||||
path: json['path'] as String?,
|
||||
text: json['text'] as String?,
|
||||
labelTheme: json['label_theme'] as String?,
|
||||
textColor: json['text_color'] as String?,
|
||||
bgStyle: (json['bg_style'] as num?)?.toInt(),
|
||||
bgColor: json['bg_color'] as String?,
|
||||
borderColor: json['border_color'] as String?,
|
||||
image: json['image'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$LabelToJson(Label instance) => <String, dynamic>{
|
||||
'path': instance.path,
|
||||
'text': instance.text,
|
||||
'label_theme': instance.labelTheme,
|
||||
'text_color': instance.textColor,
|
||||
'bg_style': instance.bgStyle,
|
||||
'bg_color': instance.bgColor,
|
||||
'border_color': instance.borderColor,
|
||||
'image': instance.image,
|
||||
};
|
||||
@@ -1,29 +1,15 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:PiliPlus/models/model_avatar.dart';
|
||||
|
||||
part 'official_verify.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class OfficialVerify {
|
||||
int? type;
|
||||
String? desc;
|
||||
class OfficialVerify extends BaseOfficialVerify {
|
||||
int? role;
|
||||
String? title;
|
||||
String? icon;
|
||||
@JsonKey(name: 'splice_title')
|
||||
String? spliceTitle;
|
||||
|
||||
OfficialVerify({
|
||||
this.type,
|
||||
this.desc,
|
||||
this.role,
|
||||
this.title,
|
||||
this.icon,
|
||||
this.spliceTitle,
|
||||
});
|
||||
|
||||
factory OfficialVerify.fromJson(Map<String, dynamic> json) {
|
||||
return _$OfficialVerifyFromJson(json);
|
||||
OfficialVerify.fromJson(Map<String, dynamic> json) : super.fromJson(json) {
|
||||
role = json['role'];
|
||||
title = json['title'];
|
||||
icon = json['icon'];
|
||||
spliceTitle = json['splice_title'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => _$OfficialVerifyToJson(this);
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'official_verify.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
OfficialVerify _$OfficialVerifyFromJson(Map<String, dynamic> json) =>
|
||||
OfficialVerify(
|
||||
type: (json['type'] as num?)?.toInt(),
|
||||
desc: json['desc'] as String?,
|
||||
role: (json['role'] as num?)?.toInt(),
|
||||
title: json['title'] as String?,
|
||||
icon: json['icon'] as String?,
|
||||
spliceTitle: json['splice_title'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$OfficialVerifyToJson(OfficialVerify instance) =>
|
||||
<String, dynamic>{
|
||||
'type': instance.type,
|
||||
'desc': instance.desc,
|
||||
'role': instance.role,
|
||||
'title': instance.title,
|
||||
'icon': instance.icon,
|
||||
'splice_title': instance.spliceTitle,
|
||||
};
|
||||
@@ -1,33 +0,0 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'pendant.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Pendant {
|
||||
int? pid;
|
||||
String? name;
|
||||
String? image;
|
||||
int? expire;
|
||||
@JsonKey(name: 'image_enhance')
|
||||
String? imageEnhance;
|
||||
@JsonKey(name: 'image_enhance_frame')
|
||||
String? imageEnhanceFrame;
|
||||
@JsonKey(name: 'n_pid')
|
||||
int? nPid;
|
||||
|
||||
Pendant({
|
||||
this.pid,
|
||||
this.name,
|
||||
this.image,
|
||||
this.expire,
|
||||
this.imageEnhance,
|
||||
this.imageEnhanceFrame,
|
||||
this.nPid,
|
||||
});
|
||||
|
||||
factory Pendant.fromJson(Map<String, dynamic> json) {
|
||||
return _$PendantFromJson(json);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => _$PendantToJson(this);
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'pendant.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Pendant _$PendantFromJson(Map<String, dynamic> json) => Pendant(
|
||||
pid: (json['pid'] as num?)?.toInt(),
|
||||
name: json['name'] as String?,
|
||||
image: json['image'] as String?,
|
||||
expire: (json['expire'] as num?)?.toInt(),
|
||||
imageEnhance: json['image_enhance'] as String?,
|
||||
imageEnhanceFrame: json['image_enhance_frame'] as String?,
|
||||
nPid: (json['n_pid'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PendantToJson(Pendant instance) => <String, dynamic>{
|
||||
'pid': instance.pid,
|
||||
'name': instance.name,
|
||||
'image': instance.image,
|
||||
'expire': instance.expire,
|
||||
'image_enhance': instance.imageEnhance,
|
||||
'image_enhance_frame': instance.imageEnhanceFrame,
|
||||
'n_pid': instance.nPid,
|
||||
};
|
||||
@@ -1,32 +0,0 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:PiliPlus/models/space/label.dart';
|
||||
|
||||
part 'vip.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Vip {
|
||||
int? vipType;
|
||||
int? vipDueDate;
|
||||
String? dueRemark;
|
||||
int? accessStatus;
|
||||
int? vipStatus;
|
||||
String? vipStatusWarn;
|
||||
int? themeType;
|
||||
Label? label;
|
||||
|
||||
Vip({
|
||||
this.vipType,
|
||||
this.vipDueDate,
|
||||
this.dueRemark,
|
||||
this.accessStatus,
|
||||
this.vipStatus,
|
||||
this.vipStatusWarn,
|
||||
this.themeType,
|
||||
this.label,
|
||||
});
|
||||
|
||||
factory Vip.fromJson(Map<String, dynamic> json) => _$VipFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$VipToJson(this);
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'vip.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Vip _$VipFromJson(Map<String, dynamic> json) => Vip(
|
||||
vipType: (json['vipType'] as num?)?.toInt(),
|
||||
vipDueDate: (json['vipDueDate'] as num?)?.toInt(),
|
||||
dueRemark: json['dueRemark'] as String?,
|
||||
accessStatus: (json['accessStatus'] as num?)?.toInt(),
|
||||
vipStatus: (json['vipStatus'] as num?)?.toInt(),
|
||||
vipStatusWarn: json['vipStatusWarn'] as String?,
|
||||
themeType: (json['themeType'] as num?)?.toInt(),
|
||||
label: json['label'] == null
|
||||
? null
|
||||
: Label.fromJson(json['label'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$VipToJson(Vip instance) => <String, dynamic>{
|
||||
'vipType': instance.vipType,
|
||||
'vipDueDate': instance.vipDueDate,
|
||||
'dueRemark': instance.dueRemark,
|
||||
'accessStatus': instance.accessStatus,
|
||||
'vipStatus': instance.vipStatus,
|
||||
'vipStatusWarn': instance.vipStatusWarn,
|
||||
'themeType': instance.themeType,
|
||||
'label': instance.label,
|
||||
};
|
||||
@@ -1,27 +1,12 @@
|
||||
import 'package:PiliPlus/models/model_owner.dart';
|
||||
import 'package:PiliPlus/models/model_avatar.dart';
|
||||
import 'package:PiliPlus/models/space_article/nameplate.dart';
|
||||
import 'package:PiliPlus/models/space_article/official_verify.dart';
|
||||
import 'package:PiliPlus/models/space_article/pendant.dart';
|
||||
import 'package:PiliPlus/models/space_article/vip.dart';
|
||||
|
||||
class Author extends Owner {
|
||||
Pendant? pendant;
|
||||
OfficialVerify? officialVerify;
|
||||
class Author extends Avatar {
|
||||
Nameplate? nameplate;
|
||||
Vip? vip;
|
||||
|
||||
Author.fromJson(Map<String, dynamic> json) {
|
||||
mid = json['mid'];
|
||||
name = json['name'] as String?;
|
||||
face = json['face'] as String?;
|
||||
pendant =
|
||||
json['pendant'] == null ? null : Pendant.fromJson(json['pendant']);
|
||||
officialVerify = json['official_verify'] == null
|
||||
? null
|
||||
: OfficialVerify.fromJson(json['official_verify']);
|
||||
Author.fromJson(Map<String, dynamic> json) : super.fromJson(json) {
|
||||
nameplate = json['nameplate'] == null
|
||||
? null
|
||||
: Nameplate.fromJson(json['nameplate']);
|
||||
vip = json['vip'] == null ? null : Vip.fromJson(json['vip']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'official_verify.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class OfficialVerify {
|
||||
int? type;
|
||||
String? desc;
|
||||
|
||||
OfficialVerify({this.type, this.desc});
|
||||
|
||||
factory OfficialVerify.fromJson(Map<String, dynamic> json) {
|
||||
return _$OfficialVerifyFromJson(json);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => _$OfficialVerifyToJson(this);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'official_verify.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
OfficialVerify _$OfficialVerifyFromJson(Map<String, dynamic> json) =>
|
||||
OfficialVerify(
|
||||
type: (json['type'] as num?)?.toInt(),
|
||||
desc: json['desc'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$OfficialVerifyToJson(OfficialVerify instance) =>
|
||||
<String, dynamic>{
|
||||
'type': instance.type,
|
||||
'desc': instance.desc,
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'pendant.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Pendant {
|
||||
int? pid;
|
||||
String? name;
|
||||
String? image;
|
||||
int? expire;
|
||||
|
||||
Pendant({this.pid, this.name, this.image, this.expire});
|
||||
|
||||
factory Pendant.fromJson(Map<String, dynamic> json) {
|
||||
return _$PendantFromJson(json);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => _$PendantToJson(this);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'pendant.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Pendant _$PendantFromJson(Map<String, dynamic> json) => Pendant(
|
||||
pid: (json['pid'] as num?)?.toInt(),
|
||||
name: json['name'] as String?,
|
||||
image: json['image'] as String?,
|
||||
expire: (json['expire'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PendantToJson(Pendant instance) => <String, dynamic>{
|
||||
'pid': instance.pid,
|
||||
'name': instance.name,
|
||||
'image': instance.image,
|
||||
'expire': instance.expire,
|
||||
};
|
||||
@@ -1,37 +0,0 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:PiliPlus/models/space_article/label.dart';
|
||||
|
||||
part 'vip.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Vip {
|
||||
int? type;
|
||||
int? status;
|
||||
@JsonKey(name: 'due_date')
|
||||
int? dueDate;
|
||||
@JsonKey(name: 'vip_pay_type')
|
||||
int? vipPayType;
|
||||
@JsonKey(name: 'theme_type')
|
||||
int? themeType;
|
||||
Label? label;
|
||||
@JsonKey(name: 'avatar_subscript')
|
||||
int? avatarSubscript;
|
||||
@JsonKey(name: 'nickname_color')
|
||||
String? nicknameColor;
|
||||
|
||||
Vip({
|
||||
this.type,
|
||||
this.status,
|
||||
this.dueDate,
|
||||
this.vipPayType,
|
||||
this.themeType,
|
||||
this.label,
|
||||
this.avatarSubscript,
|
||||
this.nicknameColor,
|
||||
});
|
||||
|
||||
factory Vip.fromJson(Map<String, dynamic> json) => _$VipFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$VipToJson(this);
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'vip.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Vip _$VipFromJson(Map<String, dynamic> json) => Vip(
|
||||
type: (json['type'] as num?)?.toInt(),
|
||||
status: (json['status'] as num?)?.toInt(),
|
||||
dueDate: (json['due_date'] as num?)?.toInt(),
|
||||
vipPayType: (json['vip_pay_type'] as num?)?.toInt(),
|
||||
themeType: (json['theme_type'] as num?)?.toInt(),
|
||||
label: json['label'] == null
|
||||
? null
|
||||
: Label.fromJson(json['label'] as Map<String, dynamic>),
|
||||
avatarSubscript: (json['avatar_subscript'] as num?)?.toInt(),
|
||||
nicknameColor: json['nickname_color'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$VipToJson(Vip instance) => <String, dynamic>{
|
||||
'type': instance.type,
|
||||
'status': instance.status,
|
||||
'due_date': instance.dueDate,
|
||||
'vip_pay_type': instance.vipPayType,
|
||||
'theme_type': instance.themeType,
|
||||
'label': instance.label,
|
||||
'avatar_subscript': instance.avatarSubscript,
|
||||
'nickname_color': instance.nicknameColor,
|
||||
};
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:PiliPlus/models/model_avatar.dart';
|
||||
|
||||
class ReplyMember {
|
||||
ReplyMember({
|
||||
this.mid,
|
||||
@@ -39,24 +41,6 @@ class ReplyMember {
|
||||
}
|
||||
}
|
||||
|
||||
class Pendant {
|
||||
Pendant({
|
||||
this.pid,
|
||||
this.name,
|
||||
this.image,
|
||||
});
|
||||
|
||||
int? pid;
|
||||
String? name;
|
||||
String? image;
|
||||
|
||||
Pendant.fromJson(Map<String, dynamic> json) {
|
||||
pid = json['pid'];
|
||||
name = json['name'];
|
||||
image = json['image'];
|
||||
}
|
||||
}
|
||||
|
||||
class UserSailing {
|
||||
UserSailing({this.pendant, this.cardbg});
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:PiliPlus/models/model_avatar.dart';
|
||||
|
||||
class VideoDetailResponse {
|
||||
int? code;
|
||||
String? message;
|
||||
@@ -308,21 +310,6 @@ class Staff {
|
||||
}
|
||||
}
|
||||
|
||||
class Vip {
|
||||
dynamic type;
|
||||
dynamic status;
|
||||
|
||||
Vip({
|
||||
this.type,
|
||||
this.status,
|
||||
});
|
||||
|
||||
Vip.fromJson(Map<String, dynamic> json) {
|
||||
type = json["type"];
|
||||
status = json["status"];
|
||||
}
|
||||
}
|
||||
|
||||
class HonorReply {
|
||||
List<Honor>? honor;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/dynamics/article_content_model.dart'
|
||||
show ArticleContentModel;
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:PiliPlus/models/model_owner.dart';
|
||||
import 'package:PiliPlus/models/model_avatar.dart';
|
||||
import 'package:PiliPlus/models/space_article/item.dart';
|
||||
import 'package:PiliPlus/pages/common/reply_controller.dart';
|
||||
import 'package:PiliPlus/pages/mine/controller.dart';
|
||||
@@ -224,7 +224,7 @@ class ArticleController extends ReplyController<MainListReply> {
|
||||
}
|
||||
|
||||
class Summary {
|
||||
Owner? author;
|
||||
Avatar? author;
|
||||
String? title;
|
||||
String? cover;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/common/widgets/avatar.dart';
|
||||
import 'package:PiliPlus/common/widgets/dialog/report.dart';
|
||||
import 'package:PiliPlus/common/widgets/pendant_avatar.dart';
|
||||
import 'package:PiliPlus/http/constants.dart';
|
||||
import 'package:PiliPlus/http/user.dart';
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
@@ -38,9 +38,9 @@ class AuthorPanel extends StatelessWidget {
|
||||
});
|
||||
|
||||
Widget _buildAvatar() {
|
||||
String? pendant = item.modules.moduleAuthor?.pendant?['image'];
|
||||
Widget avatar = Avatar(
|
||||
avatar: item.modules.moduleAuthor?.face ?? '',
|
||||
String? pendant = item.modules.moduleAuthor?.pendant?.image;
|
||||
Widget avatar = PendantAvatar(
|
||||
avatar: item.modules.moduleAuthor?.face,
|
||||
size: pendant.isNullOrEmpty ? 40 : 34,
|
||||
isVip: null, // item.modules.moduleAuthor!.vip['status'] > 0
|
||||
officialType: null, // 已被注释
|
||||
@@ -96,8 +96,8 @@ class AuthorPanel extends StatelessWidget {
|
||||
item.modules.moduleAuthor?.name ?? '',
|
||||
style: TextStyle(
|
||||
color: item.modules.moduleAuthor!.vip != null &&
|
||||
item.modules.moduleAuthor!.vip!['status'] > 0 &&
|
||||
item.modules.moduleAuthor!.vip!['type'] == 2
|
||||
item.modules.moduleAuthor!.vip!.status > 0 &&
|
||||
item.modules.moduleAuthor!.vip!.type == 2
|
||||
? context.vipColor
|
||||
: theme.colorScheme.onSurface,
|
||||
fontSize: theme.textTheme.titleSmall!.fontSize,
|
||||
|
||||
@@ -420,8 +420,8 @@ Widget forWard(
|
||||
item.modules.moduleAuthor!.name!,
|
||||
style: TextStyle(
|
||||
color: item.modules.moduleAuthor!.vip != null &&
|
||||
item.modules.moduleAuthor!.vip!['status'] > 0 &&
|
||||
item.modules.moduleAuthor!.vip!['type'] == 2
|
||||
item.modules.moduleAuthor!.vip!.status > 0 &&
|
||||
item.modules.moduleAuthor!.vip!.type == 2
|
||||
? context.vipColor
|
||||
: theme.colorScheme.onSurface,
|
||||
fontSize: theme.textTheme.titleMedium!.fontSize,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/avatar.dart';
|
||||
import 'package:PiliPlus/common/widgets/interactiveviewer_gallery/interactiveviewer_gallery.dart'
|
||||
show SourceModel;
|
||||
import 'package:PiliPlus/common/widgets/pendant_avatar.dart';
|
||||
import 'package:PiliPlus/models/space/card.dart';
|
||||
import 'package:PiliPlus/models/space/images.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
@@ -131,8 +131,7 @@ class UserInfoCard extends StatelessWidget {
|
||||
height: 1,
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: (card.vip?.vipStatus ?? -1) > 0 &&
|
||||
card.vip?.vipType == 2
|
||||
color: (card.vip?.status ?? -1) > 0 && card.vip?.type == 2
|
||||
? context.vipColor
|
||||
: null,
|
||||
),
|
||||
@@ -143,7 +142,7 @@ class UserInfoCard extends StatelessWidget {
|
||||
height: 11,
|
||||
semanticLabel: '等级${card.levelInfo?.currentLevel}',
|
||||
),
|
||||
if (card.vip?.vipStatus == 1)
|
||||
if (card.vip?.status == 1)
|
||||
Container(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
@@ -417,12 +416,12 @@ class UserInfoCard extends StatelessWidget {
|
||||
|
||||
Hero _buildAvatar(BuildContext context) => Hero(
|
||||
tag: card.face ?? '',
|
||||
child: Avatar(
|
||||
avatar: card.face ?? '',
|
||||
child: PendantAvatar(
|
||||
avatar: card.face,
|
||||
size: 80,
|
||||
badgeSize: 22,
|
||||
officialType: card.officialVerify?.type,
|
||||
isVip: (card.vip?.vipStatus ?? -1) > 0,
|
||||
isVip: (card.vip?.status ?? -1) > 0,
|
||||
garbPendantImage: card.pendant!.image!,
|
||||
roomId: live is Map && live['liveStatus'] == 1 ? live['roomid'] : null,
|
||||
onTap: () => context
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:PiliPlus/common/widgets/avatar.dart';
|
||||
import 'package:PiliPlus/common/widgets/pendant_avatar.dart';
|
||||
import 'package:PiliPlus/models/search/result.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -28,8 +28,8 @@ class SearchUserItem extends StatelessWidget {
|
||||
child: Row(
|
||||
children: [
|
||||
const SizedBox(width: 15),
|
||||
Avatar(
|
||||
avatar: item.upic ?? '',
|
||||
PendantAvatar(
|
||||
avatar: item.upic,
|
||||
size: 42,
|
||||
isVip: false,
|
||||
officialType: item.officialVerify?['type'],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/common/widgets/avatar.dart';
|
||||
import 'package:PiliPlus/common/widgets/pendant_avatar.dart';
|
||||
import 'package:PiliPlus/common/widgets/refresh_indicator.dart'
|
||||
show kDragContainerExtentPercentage, displacement;
|
||||
import 'package:PiliPlus/http/reply.dart';
|
||||
@@ -2035,7 +2035,7 @@ List<SettingsModel> get extraSettings => [
|
||||
leading: Icon(MdiIcons.stickerCircleOutline),
|
||||
setKey: SettingBoxKey.showDynDecorate,
|
||||
defaultVal: true,
|
||||
onChanged: (value) => Avatar.showDynDecorate = value,
|
||||
onChanged: (value) => PendantAvatar.showDynDecorate = value,
|
||||
),
|
||||
SettingsModel(
|
||||
settingsType: SettingsType.sw1tch,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/avatar.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
import 'package:PiliPlus/common/widgets/pendant_avatar.dart';
|
||||
import 'package:PiliPlus/common/widgets/self_sized_horizontal_list.dart';
|
||||
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
||||
import 'package:PiliPlus/models/video_detail_res.dart';
|
||||
@@ -296,10 +296,9 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Obx(() => Avatar(
|
||||
Obx(() => PendantAvatar(
|
||||
avatar: videoIntroController
|
||||
.userStat['card']?['face'] ??
|
||||
'',
|
||||
.userStat['card']?['face'],
|
||||
size: 35,
|
||||
badgeSize: 14,
|
||||
isVip: (videoIntroController
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/avatar.dart';
|
||||
import 'package:PiliPlus/common/widgets/badge.dart';
|
||||
import 'package:PiliPlus/common/widgets/dialog/report.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/image_view.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
import 'package:PiliPlus/common/widgets/pendant_avatar.dart';
|
||||
import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
||||
show ReplyInfo, ReplyControl, Content;
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
@@ -110,7 +110,8 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
Widget _buildContent(BuildContext context, ThemeData theme) {
|
||||
return Column(
|
||||
children: [
|
||||
if (Avatar.showDynDecorate && replyItem.member.hasGarbCardImage())
|
||||
if (PendantAvatar.showDynDecorate &&
|
||||
replyItem.member.hasGarbCardImage())
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
@@ -163,7 +164,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget lfAvtar() => Avatar(
|
||||
Widget lfAvtar() => PendantAvatar(
|
||||
avatar: replyItem.member.face,
|
||||
size: 34,
|
||||
badgeSize: 14,
|
||||
|
||||
Reference in New Issue
Block a user