From 483f02c7d2b533dd6476bf8736eca26024ba7573 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Thu, 4 Jan 2024 00:08:42 +0800 Subject: [PATCH] =?UTF-8?q?mod:=20=E5=8A=A8=E6=80=81=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8A=95=E7=A8=BF=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dynamics/widgets/rich_node_panel.dart | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/lib/pages/dynamics/widgets/rich_node_panel.dart b/lib/pages/dynamics/widgets/rich_node_panel.dart index 8b7dcd69..8f744dd5 100644 --- a/lib/pages/dynamics/widgets/rich_node_panel.dart +++ b/lib/pages/dynamics/widgets/rich_node_panel.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart'; +import 'package:pilipala/http/search.dart'; // 富文本 InlineSpan richNode(item, context) { @@ -191,6 +193,39 @@ InlineSpan richNode(item, context) { ), ); } + // 投稿 + if (i.type == 'RICH_TEXT_NODE_TYPE_BV') { + spanChilds.add( + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: Icon( + Icons.play_circle_outline_outlined, + size: 16, + color: Theme.of(context).colorScheme.primary, + ), + ), + ); + spanChilds.add( + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: GestureDetector( + onTap: () async { + try { + int cid = await SearchHttp.ab2c(bvid: i.rid); + Get.toNamed('/video?bvid=${i.rid}&cid=$cid', + arguments: {'pic': null, 'heroTag': i.rid}); + } catch (err) { + SmartDialog.showToast(err.toString()); + } + }, + child: Text( + '${i.text} ', + style: authorStyle, + ), + ), + ), + ); + } } // if (contentType == 'major' && // item.modules.moduleDynamic.major.opus.pics.isNotEmpty) {