style: 调整加号面板中更多操作选项的样式
This commit is contained in:
parent
aa87129838
commit
2c03ed7f1c
|
|
@ -83,8 +83,14 @@ class MorePanel extends StatefulWidget {
|
||||||
final ConvType conversationType;
|
final ConvType conversationType;
|
||||||
|
|
||||||
final MorePanelConfig? morePanelConfig;
|
final MorePanelConfig? morePanelConfig;
|
||||||
|
final ValueChanged<double>? 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);
|
: super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -750,8 +756,15 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
final TUITheme theme = value.theme;
|
final TUITheme theme = value.theme;
|
||||||
final TUIChatSeparateViewModel model = Provider.of<TUIChatSeparateViewModel>(context);
|
final TUIChatSeparateViewModel model = Provider.of<TUIChatSeparateViewModel>(context);
|
||||||
final screenWidth = MediaQuery.of(context).size.width;
|
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(
|
return Container(
|
||||||
height: 248,
|
height: panelHeight,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
// color: hexToColor("EBF0F6"),
|
// color: hexToColor("EBF0F6"),
|
||||||
border: Border(
|
border: Border(
|
||||||
|
|
@ -767,7 +780,7 @@ class _MorePanelState extends TIMUIKitState<MorePanel> {
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
spacing: (screenWidth - (23 * 2) - 64 * 4) / 3,
|
spacing: (screenWidth - (23 * 2) - 64 * 4) / 3,
|
||||||
runSpacing: 20,
|
runSpacing: 20,
|
||||||
children: itemList(model, theme)
|
children: items
|
||||||
.map((item) => InkWell(
|
.map((item) => InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (item.onTap != null) {
|
if (item.onTap != null) {
|
||||||
|
|
|
||||||
|
|
@ -154,6 +154,7 @@ class _TIMUIKitTextFieldLayoutNarrowState extends TIMUIKitState<TIMUIKitTextFiel
|
||||||
bool showKeyboard = false;
|
bool showKeyboard = false;
|
||||||
Function? setKeyboardHeight;
|
Function? setKeyboardHeight;
|
||||||
double? bottomPadding;
|
double? bottomPadding;
|
||||||
|
double? morePanelDynamicHeight;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
|
@ -264,7 +265,14 @@ class _TIMUIKitTextFieldLayoutNarrowState extends TIMUIKitState<TIMUIKitTextFiel
|
||||||
return MorePanel(
|
return MorePanel(
|
||||||
morePanelConfig: widget.morePanelConfig,
|
morePanelConfig: widget.morePanelConfig,
|
||||||
conversationID: widget.conversationID,
|
conversationID: widget.conversationID,
|
||||||
conversationType: widget.conversationType);
|
conversationType: widget.conversationType,
|
||||||
|
onPanelHeightChanged: (h) {
|
||||||
|
if (morePanelDynamicHeight != h) {
|
||||||
|
setState(() {
|
||||||
|
morePanelDynamicHeight = h;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return const SizedBox(height: 0);
|
return const SizedBox(height: 0);
|
||||||
|
|
@ -284,8 +292,11 @@ class _TIMUIKitTextFieldLayoutNarrowState extends TIMUIKitState<TIMUIKitTextFiel
|
||||||
}
|
}
|
||||||
final height = originHeight != 0 ? originHeight : currentKeyboardHeight;
|
final height = originHeight != 0 ? originHeight : currentKeyboardHeight;
|
||||||
return height;
|
return height;
|
||||||
} else if (showMore || showEmojiPanel) {
|
} else if (showEmojiPanel) {
|
||||||
return 248.0 + (bottomPadding ?? 0.0);
|
return 248.0 + (bottomPadding ?? 0.0);
|
||||||
|
} else if (showMore) {
|
||||||
|
final double inner = morePanelDynamicHeight ?? 120;
|
||||||
|
return inner + (bottomPadding ?? 0.0);
|
||||||
} else if (widget.textEditingController.text.length >= 46 && showKeyboard == false) {
|
} else if (widget.textEditingController.text.length >= 46 && showKeyboard == false) {
|
||||||
return 25 + (bottomPadding ?? 0.0);
|
return 25 + (bottomPadding ?? 0.0);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -302,6 +313,9 @@ class _TIMUIKitTextFieldLayoutNarrowState extends TIMUIKitState<TIMUIKitTextFiel
|
||||||
showKeyboard = false;
|
showKeyboard = false;
|
||||||
showEmojiPanel = false;
|
showEmojiPanel = false;
|
||||||
showSendSoundText = false;
|
showSendSoundText = false;
|
||||||
|
if (!showMore) {
|
||||||
|
morePanelDynamicHeight = 120;
|
||||||
|
}
|
||||||
showMore = !showMore;
|
showMore = !showMore;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue