From 52175b0b69957efb43f1d4972c796c45e7c925be Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Mon, 10 Feb 2025 16:22:23 +0800 Subject: [PATCH] mod: show reply gif emote Closes #212 Signed-off-by: bggRGjQaUbCoE --- lib/pages/video/detail/reply/widgets/reply_item.dart | 5 ++++- lib/pages/video/detail/reply/widgets/reply_item_grpc.dart | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index e9142c6e..515aa97e 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -731,10 +731,13 @@ class ReplyItem extends StatelessWidget { if (content.emote.containsKey(matchStr)) { // 处理表情 final int size = content.emote[matchStr]['meta']['size']; + String imgUrl = content.emote[matchStr]['webp_url'] ?? + content.emote[matchStr]['gif_url'] ?? + content.emote[matchStr]['url']; spanChildren.add(WidgetSpan( child: ExcludeSemantics( child: NetworkImgLayer( - src: content.emote[matchStr]['url'], + src: imgUrl, type: 'emote', width: size * 20, height: size * 20, diff --git a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart index 224c7579..b4cfe549 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart @@ -775,7 +775,9 @@ class ReplyItemGrpc extends StatelessWidget { spanChildren.add(WidgetSpan( child: ExcludeSemantics( child: NetworkImgLayer( - src: content.emote[matchStr]!.url, + src: content.emote[matchStr]?.hasGifUrl() == true + ? content.emote[matchStr]?.gifUrl + : content.emote[matchStr]?.url, type: 'emote', width: size * 20, height: size * 20,