fixed bug on leaving talk chat, spamming console
This commit is contained in:
@@ -114,7 +114,15 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
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();
|
_sendController.dispose();
|
||||||
_focusNode.dispose();
|
_focusNode.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
|
|||||||
Reference in New Issue
Block a user