only call setState in message_selection_overlay if mounted
This commit is contained in:
parent
d5eee79f4c
commit
0b2c32904a
1 changed files with 2 additions and 1 deletions
|
|
@ -106,7 +106,8 @@ class MessageOverlayController extends State<MessageSelectionOverlay>
|
|||
void setState(VoidCallback fn) {
|
||||
if (SchedulerBinding.instance.schedulerPhase == SchedulerPhase.idle ||
|
||||
SchedulerBinding.instance.schedulerPhase ==
|
||||
SchedulerPhase.postFrameCallbacks) {
|
||||
SchedulerPhase.postFrameCallbacks &&
|
||||
mounted) {
|
||||
// It's safe to call setState immediately
|
||||
super.setState(fn);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue