Added central user credentials management

This commit is contained in:
2023-06-11 18:18:37 +02:00
parent 04c244503e
commit 1521056217
22 changed files with 207 additions and 159 deletions

View File

@ -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();
}
}