Added central user credentials management
This commit is contained in:
@ -22,14 +22,16 @@ class App extends StatefulWidget {
|
||||
class _AppState extends State<App> {
|
||||
int currentPage = 0;
|
||||
late Timer refetchChats;
|
||||
late Timer updateTimings;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
Timer.periodic(const Duration(seconds: 30), (Timer t) => setState((){}));
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||
Provider.of<ChatListProps>(context, listen: false).run();
|
||||
});
|
||||
|
||||
updateTimings = Timer.periodic(const Duration(seconds: 30), (Timer t) => setState((){}));
|
||||
|
||||
refetchChats = Timer.periodic(const Duration(minutes: 1), (timer) {
|
||||
if(!context.mounted) return;
|
||||
Provider.of<ChatListProps>(context, listen: false).run();
|
||||
@ -107,6 +109,7 @@ class _AppState extends State<App> {
|
||||
@override
|
||||
void dispose() {
|
||||
refetchChats.cancel();
|
||||
updateTimings.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user