From a29fe6aa9ca85736610b5301d22b6d5fc24db015 Mon Sep 17 00:00:00 2001 From: lollipopkit <10864310+lollipopkit@users.noreply.github.com> Date: Thu, 6 Jun 2024 18:15:57 +0800 Subject: [PATCH] opt.: chat view --- lib/view/page/home/chat.dart | 31 +++++++++++++++---------------- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/lib/view/page/home/chat.dart b/lib/view/page/home/chat.dart index 23e0dde..d36318b 100644 --- a/lib/view/page/home/chat.dart +++ b/lib/view/page/home/chat.dart @@ -137,9 +137,9 @@ class _ChatPageState extends State<_ChatPage> onLongPress: () { final funcs = _buildChatItemFuncs(chatItems, chatItem); context.showRoundDialog( + contentPadding: const EdgeInsets.all(11), child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row( + child: Column( mainAxisSize: MainAxisSize.min, children: funcs, ), @@ -184,6 +184,12 @@ class _ChatPageState extends State<_ChatPage> 'code': CodeElementBuilder(onCopy: _onCopy), 'latex': LatexElementBuilder(), }, + styleSheet: MarkdownStyleSheet.fromTheme(Theme.of(context)).copyWith( + codeblockDecoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.circular(7), + ), + ), extensionSet: MarkdownUtils.extensionSet, onTapLink: MarkdownUtils.onLinkTap, shrinkWrap: false, @@ -256,20 +262,13 @@ class _ChatPageState extends State<_ChatPage> context.pop(); onTap(); }, - child: SizedBox( - width: 77, - height: 77, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - UIs.height7, - Icon(icon, size: 20), - UIs.height7, - Text(text), - ], - ), - ), + child: Row( + children: [ + Icon(icon, size: 20), + const SizedBox(width: 27), + Text(text, style: const TextStyle(fontSize: 16.5)), + ], + ).paddingSymmetric(horizontal: 23, vertical: 15), ); } diff --git a/pubspec.lock b/pubspec.lock index d93ea7f..fa8a5ea 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -423,8 +423,8 @@ packages: dependency: "direct main" description: path: "." - ref: "v1.0.34" - resolved-ref: f6acb6530649e4bb080496368d192dc92687ec85 + ref: "v1.0.35" + resolved-ref: c3ae00b1ce84484d43d35a71e2ed2f3bd8d4c3bb url: "https://github.com/lppcg/fl_lib" source: git version: "0.0.1" diff --git a/pubspec.yaml b/pubspec.yaml index 8a9ec9f..1a88c0e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -29,7 +29,7 @@ dependencies: fl_lib: git: url: https://github.com/lppcg/fl_lib - ref: v1.0.34 + ref: v1.0.35 # path: ../fl_lib extended_image: ^8.2.1 app_links: ^6.1.1