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();