From 2c03ed7f1c8814faba7b7ea2ccea868d763be666 Mon Sep 17 00:00:00 2001 From: Zeew Date: Mon, 18 Aug 2025 10:19:56 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E8=B0=83=E6=95=B4=E5=8A=A0=E5=8F=B7?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E4=B8=AD=E6=9B=B4=E5=A4=9A=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E7=9A=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tim_uikit_more_panel.dart | 19 ++++++++++++++++--- .../tim_uikit_text_field_layout/narrow.dart | 18 ++++++++++++++++-- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_more_panel.dart b/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_more_panel.dart index b6d6f1e..3666bef 100644 --- a/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_more_panel.dart +++ b/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_more_panel.dart @@ -83,8 +83,14 @@ class MorePanel extends StatefulWidget { final ConvType conversationType; final MorePanelConfig? morePanelConfig; + final ValueChanged? onPanelHeightChanged; - const MorePanel({required this.conversationID, required this.conversationType, Key? key, this.morePanelConfig}) + const MorePanel( + {required this.conversationID, + required this.conversationType, + Key? key, + this.morePanelConfig, + this.onPanelHeightChanged}) : super(key: key); @override @@ -750,8 +756,15 @@ class _MorePanelState extends TIMUIKitState { final TUITheme theme = value.theme; final TUIChatSeparateViewModel model = Provider.of(context); final screenWidth = MediaQuery.of(context).size.width; + final items = itemList(model, theme); + final double panelHeight = items.length > 4 ? 248.0 : 120; + if (widget.onPanelHeightChanged != null) { + WidgetsBinding.instance.addPostFrameCallback((_) { + widget.onPanelHeightChanged?.call(panelHeight); + }); + } return Container( - height: 248, + height: panelHeight, decoration: BoxDecoration( // color: hexToColor("EBF0F6"), border: Border( @@ -767,7 +780,7 @@ class _MorePanelState extends TIMUIKitState { child: Wrap( spacing: (screenWidth - (23 * 2) - 64 * 4) / 3, runSpacing: 20, - children: itemList(model, theme) + children: items .map((item) => InkWell( onTap: () { if (item.onTap != null) { diff --git a/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart b/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart index 8f748be..a70baed 100644 --- a/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart +++ b/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart @@ -154,6 +154,7 @@ class _TIMUIKitTextFieldLayoutNarrowState extends TIMUIKitState= 46 && showKeyboard == false) { return 25 + (bottomPadding ?? 0.0); } else { @@ -302,6 +313,9 @@ class _TIMUIKitTextFieldLayoutNarrowState extends TIMUIKitState