mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-25 21:05:52 +08:00
refa: avatar (not radical) (#731)
* refa: avatar (not radical) * update Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> --------- Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> Co-authored-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
committed by
GitHub
parent
4c0443ec28
commit
3d4bcbc082
@@ -1,6 +1,7 @@
|
||||
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/image_view.dart';
|
||||
import 'package:PiliPlus/common/widgets/report.dart';
|
||||
@@ -156,93 +157,16 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget lfAvtar(BuildContext context) {
|
||||
return Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
if (ModuleAuthorModel.showDynDecorate &&
|
||||
replyItem.member.hasGarbPendantImage()) ...[
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(2),
|
||||
child: NetworkImgLayer(
|
||||
src: replyItem.member.face,
|
||||
width: 30,
|
||||
height: 30,
|
||||
type: 'avatar',
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: -9,
|
||||
top: -9,
|
||||
child: IgnorePointer(
|
||||
child: CachedNetworkImage(
|
||||
width: 52,
|
||||
height: 52,
|
||||
imageUrl:
|
||||
Utils.thumbnailImgUrl(replyItem.member.garbPendantImage),
|
||||
),
|
||||
),
|
||||
),
|
||||
] else
|
||||
NetworkImgLayer(
|
||||
src: replyItem.member.face,
|
||||
width: 34,
|
||||
height: 34,
|
||||
type: 'avatar',
|
||||
),
|
||||
if (replyItem.member.vipStatus > 0)
|
||||
Positioned(
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
),
|
||||
child: Image.asset(
|
||||
'assets/images/big-vip.png',
|
||||
height: 14,
|
||||
semanticLabel: "大会员",
|
||||
),
|
||||
),
|
||||
),
|
||||
if (replyItem.member.officialVerifyType == 0)
|
||||
Positioned(
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.offline_bolt,
|
||||
color: Color(0xFFFFCC00),
|
||||
size: 14,
|
||||
semanticLabel: "认证个人",
|
||||
),
|
||||
),
|
||||
)
|
||||
else if (replyItem.member.officialVerifyType == 1)
|
||||
Positioned(
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.offline_bolt,
|
||||
color: Colors.lightBlueAccent,
|
||||
size: 14,
|
||||
semanticLabel: "认证机构",
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
Widget lfAvtar() => Avatar(
|
||||
avatar: replyItem.member.face,
|
||||
size: 34,
|
||||
badgeSize: 14,
|
||||
isVip: replyItem.member.vipStatus > 0,
|
||||
officialType: replyItem.member.officialVerifyType.toInt(),
|
||||
garbPendantImage: replyItem.member.hasGarbPendantImage()
|
||||
? replyItem.member.garbPendantImage
|
||||
: null,
|
||||
);
|
||||
|
||||
Widget content(BuildContext context) {
|
||||
return Column(
|
||||
@@ -259,7 +183,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
lfAvtar(context),
|
||||
lfAvtar(),
|
||||
const SizedBox(width: 12),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
Reference in New Issue
Block a user