mirror of
https://github.com/Iconica-Development/flutter_chat.git
synced 2025-05-18 18:33:49 +02:00
fix: check if context.mounted before updating usestates in chat_detail_screen.dart
This commit is contained in:
parent
62f04e2d9b
commit
b0d379284d
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