From 3be0113f9349f05c1de0537e6024c3078821a716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20M=C3=BCller?= Date: Mon, 6 Jul 2026 15:55:27 +0200 Subject: [PATCH] fixed bug on leaving talk chat, spamming console --- lib/view/pages/talk/widgets/chat_textfield.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/view/pages/talk/widgets/chat_textfield.dart b/lib/view/pages/talk/widgets/chat_textfield.dart index 16ef6fc..1024159 100644 --- a/lib/view/pages/talk/widgets/chat_textfield.dart +++ b/lib/view/pages/talk/widgets/chat_textfield.dart @@ -114,7 +114,15 @@ class _ChatTextfieldState extends State { @override void dispose() { - downloadChipBottomObstruction.value = 0; + // Clear the published bar height only after this unmount completes. Setting + // the shared notifier synchronously here fires its listener (the download + // tray's AnimatedBuilder → setState) while the element tree is locked during + // teardown, throwing "setState() called when widget tree was locked". + // Running it at the end of the frame lets the reset land once the tree is + // writable again; a newly opened chat re-publishes its own height afterwards. + WidgetsBinding.instance.addPostFrameCallback( + (_) => downloadChipBottomObstruction.value = 0, + ); _sendController.dispose(); _focusNode.dispose(); super.dispose();