Readded binding observer
This commit is contained in:
parent
d5344494d7
commit
4433f1ba44
@ -31,7 +31,7 @@ class App extends StatefulWidget {
|
||||
State<App> createState() => _AppState();
|
||||
}
|
||||
|
||||
class _AppState extends State<App> {
|
||||
class _AppState extends State<App> with WidgetsBindingObserver {
|
||||
late Timer refetchChats;
|
||||
late Timer updateTimings;
|
||||
|
||||
@ -47,6 +47,7 @@ class _AppState extends State<App> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||
Provider.of<BreakerProps>(context, listen: false).run();
|
||||
Provider.of<ChatListProps>(context, listen: false).run();
|
||||
@ -149,6 +150,7 @@ class _AppState extends State<App> {
|
||||
void dispose() {
|
||||
refetchChats.cancel();
|
||||
updateTimings.cancel();
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user