fix sync
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
library;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../providers/sync_provider.dart';
|
||||
import '../widgets/shell_tab_scope.dart';
|
||||
import 'home_screen.dart';
|
||||
import 'look_ahead_screen.dart';
|
||||
@@ -24,6 +26,15 @@ class _MainShellState extends State<MainShell> {
|
||||
LookAheadScreen(),
|
||||
];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!mounted) return;
|
||||
context.read<SyncController>().syncIfBehindServer();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ShellTabScope(
|
||||
|
||||
Reference in New Issue
Block a user