fixed bug on leaving talk chat, spamming console

This commit is contained in:
2026-07-06 15:55:27 +02:00
parent 2b59f11ea5
commit 3be0113f93
@@ -114,7 +114,15 @@ class _ChatTextfieldState extends State<ChatTextfield> {
@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();