mirror of
https://github.com/Iconica-Development/flutter_chat.git
synced 2025-05-19 02:43:50 +02:00
fix: check if context.mounted before updating usestates in chat_detail_screen.dart
This commit is contained in:
parent
7b3ddc5118
commit
dd70e7344e
1 changed files with 4 additions and 1 deletions
|
@ -278,6 +278,7 @@ class _ChatBody extends HookWidget {
|
||||||
]);
|
]);
|
||||||
} finally {
|
} finally {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
|
if (!context.mounted) return;
|
||||||
if (!scrollController.hasClients) {
|
if (!scrollController.hasClients) {
|
||||||
isLoadingOlder.value = false;
|
isLoadingOlder.value = false;
|
||||||
return;
|
return;
|
||||||
|
@ -307,7 +308,9 @@ class _ChatBody extends HookWidget {
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
} finally {
|
} finally {
|
||||||
isLoadingNewer.value = false;
|
if (context.mounted) {
|
||||||
|
isLoadingNewer.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue