opt reply

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-01-28 12:11:18 +08:00
parent 556bda0d68
commit 6f30d2e331

View File

@@ -78,7 +78,6 @@ class ReplyItemGrpc extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final isMobile = PlatformUtils.isMobile;
void showMore() => showModalBottomSheet( void showMore() => showModalBottomSheet(
context: context, context: context,
useSafeArea: true, useSafeArea: true,
@@ -101,63 +100,63 @@ class ReplyItemGrpc extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () => replyReply?.call(replyItem, null), onTap: () => replyReply?.call(replyItem, null),
onLongPress: showMore, onLongPress: showMore,
onSecondaryTap: isMobile ? null : showMore, onSecondaryTap: PlatformUtils.isMobile ? null : showMore,
child: _buildContent(context, theme), child: _buildContent(context, theme),
), ),
); );
} }
Widget _buildAuthorPanel(BuildContext context, ThemeData theme) => Padding( Widget _buildContent(BuildContext context, ThemeData theme) {
padding: const EdgeInsets.fromLTRB(12, 14, 8, 5), Widget child = Padding(
padding: const .fromLTRB(12, 14, 8, 5),
child: content(context, theme), child: content(context, theme),
); );
const double top = 8.0;
Widget _buildContent(BuildContext context, ThemeData theme) { const double right = 12.0;
return Column( const double height = 38.0;
crossAxisAlignment: CrossAxisAlignment.stretch, if (PendantAvatar.showDynDecorate && replyItem.member.hasGarbCardImage()) {
children: [ child = Stack(
if (PendantAvatar.showDynDecorate && clipBehavior: .none,
replyItem.member.hasGarbCardImage())
Stack(
clipBehavior: Clip.none,
children: [ children: [
child,
Positioned( Positioned(
top: 8, top: top,
right: 12, right: right,
child: Stack( height: height,
clipBehavior: Clip.none, child: CachedNetworkImage(
alignment: Alignment.centerRight, height: height,
children: [ memCacheHeight: height.cacheSize(context),
CachedNetworkImage(
height: 38,
memCacheHeight: 38.cacheSize(context),
imageUrl: ImageUtils.safeThumbnailUrl( imageUrl: ImageUtils.safeThumbnailUrl(
replyItem.member.garbCardImage, replyItem.member.garbCardImage,
), ),
placeholder: (_, _) => const SizedBox.shrink(), placeholder: (_, _) => const SizedBox.shrink(),
), ),
),
if (replyItem.member.hasGarbCardNumber()) if (replyItem.member.hasGarbCardNumber())
Text( Positioned(
top: top,
right: right,
height: height,
child: Center(
child: Text(
'NO.\n${replyItem.member.garbCardNumber}', 'NO.\n${replyItem.member.garbCardNumber}',
style: TextStyle( style: TextStyle(
fontSize: 8, fontSize: 8,
fontFamily: 'digital_id_num', fontFamily: 'digital_id_num',
color: color: replyItem.member.garbCardFanColor.startsWith('#')
replyItem.member.garbCardFanColor.startsWith('#') ? Utils.parseColor(replyItem.member.garbCardFanColor)
? Utils.parseColor(
replyItem.member.garbCardFanColor,
)
: null, : null,
), ),
), ),
],
), ),
), ),
_buildAuthorPanel(context, theme),
], ],
) );
else }
_buildAuthorPanel(context, theme), return Column(
crossAxisAlignment: .stretch,
children: [
child,
if (needDivider) if (needDivider)
Divider( Divider(
indent: 55, indent: 55,
@@ -169,25 +168,11 @@ class ReplyItemGrpc extends StatelessWidget {
); );
} }
Widget _buildAvatar() => PendantAvatar(
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, ThemeData theme) { Widget content(BuildContext context, ThemeData theme) {
final padding = EdgeInsets.only( final padding = EdgeInsets.only(left: replyLevel == 0 ? 6 : 45, right: 6);
left: replyLevel == 0 ? 6 : 45,
right: 6,
);
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: .min,
mainAxisSize: MainAxisSize.min, crossAxisAlignment: .start,
children: [ children: [
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
@@ -196,11 +181,20 @@ class ReplyItemGrpc extends StatelessWidget {
Get.toNamed('/member?mid=${replyItem.mid}'); Get.toNamed('/member?mid=${replyItem.mid}');
}, },
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: .min,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: .center,
spacing: 12, spacing: 12,
children: [ children: [
_buildAvatar(), PendantAvatar(
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,
),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,