fix: фикс клавы при открытии стикеров

This commit is contained in:
Jganenokk
2026-07-11 15:58:46 +07:00
parent b8dce4fd63
commit 4be18c0165
+3 -1
View File
@@ -211,6 +211,7 @@ class _ChatScreenState extends State<ChatScreen>
final FocusNode _messageFocusNode = FocusNode();
double _keyboardReserve = 0;
bool _keyboardWasOpen = false;
bool _keyboardBeforeStickers = false;
final ScrollController _scrollController = ScrollController();
bool _userDidScroll = false;
String? _pinnedMessageId;
@@ -5106,10 +5107,11 @@ class _ChatScreenState extends State<ChatScreen>
void _toggleStickerPanel() {
if (_stickers.showPanel.value) {
_stickers.hide();
_messageFocusNode.requestFocus();
if (_keyboardBeforeStickers) _messageFocusNode.requestFocus();
return;
}
final keyboard = MediaQuery.viewInsetsOf(context).bottom;
_keyboardBeforeStickers = keyboard > 120 || _messageFocusNode.hasFocus;
if (keyboard > 120) _stickers.panelHeight = keyboard;
FocusManager.instance.primaryFocus?.unfocus();
_stickers.showPanel.value = true;