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(
padding: const EdgeInsets.fromLTRB(12, 14, 8, 5),
child: content(context, theme),
);
Widget _buildContent(BuildContext context, ThemeData theme) { Widget _buildContent(BuildContext context, ThemeData theme) {
return Column( Widget child = Padding(
crossAxisAlignment: CrossAxisAlignment.stretch, padding: const .fromLTRB(12, 14, 8, 5),
children: [ child: content(context, theme),
if (PendantAvatar.showDynDecorate && );
replyItem.member.hasGarbCardImage()) const double top = 8.0;
Stack( const double right = 12.0;
clipBehavior: Clip.none, const double height = 38.0;
children: [ if (PendantAvatar.showDynDecorate && replyItem.member.hasGarbCardImage()) {
Positioned( child = Stack(
top: 8, clipBehavior: .none,
right: 12, children: [
child: Stack( child,
clipBehavior: Clip.none, Positioned(
alignment: Alignment.centerRight, top: top,
children: [ right: right,
CachedNetworkImage( height: height,
height: 38, child: CachedNetworkImage(
memCacheHeight: 38.cacheSize(context), height: height,
imageUrl: ImageUtils.safeThumbnailUrl( memCacheHeight: height.cacheSize(context),
replyItem.member.garbCardImage, imageUrl: ImageUtils.safeThumbnailUrl(
), replyItem.member.garbCardImage,
placeholder: (_, _) => const SizedBox.shrink(), ),
), placeholder: (_, _) => const SizedBox.shrink(),
if (replyItem.member.hasGarbCardNumber()) ),
Text( ),
'NO.\n${replyItem.member.garbCardNumber}', if (replyItem.member.hasGarbCardNumber())
style: TextStyle( Positioned(
fontSize: 8, top: top,
fontFamily: 'digital_id_num', right: right,
color: height: height,
replyItem.member.garbCardFanColor.startsWith('#') child: Center(
? Utils.parseColor( child: Text(
replyItem.member.garbCardFanColor, 'NO.\n${replyItem.member.garbCardNumber}',
) style: TextStyle(
: null, fontSize: 8,
), fontFamily: 'digital_id_num',
), color: replyItem.member.garbCardFanColor.startsWith('#')
], ? Utils.parseColor(replyItem.member.garbCardFanColor)
: 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,