This commit is contained in:
efrilm
2025-10-24 23:23:58 +07:00
parent 79e109cfe4
commit 7bcf54c555
3 changed files with 9 additions and 7 deletions
+7 -5
View File
@@ -21,8 +21,10 @@ class SyncPage extends StatefulWidget implements AutoRouteWrapper {
State<SyncPage> createState() => _SyncPageState();
@override
Widget wrappedRoute(BuildContext context) =>
BlocProvider(create: (context) => getIt<SyncBloc>(), child: this);
Widget wrappedRoute(BuildContext context) => BlocProvider(
create: (context) => getIt<SyncBloc>()..add(SyncEvent.startSync()),
child: this,
);
}
class _SyncPageState extends State<SyncPage> with TickerProviderStateMixin {
@@ -63,9 +65,9 @@ class _SyncPageState extends State<SyncPage> with TickerProviderStateMixin {
_animationController.animateTo(1.0);
// Tunggu sebentar lalu pindah ke dashboard
// Future.delayed(const Duration(seconds: 2), () {
// context.pushReplacement(DashboardPage());
// });
Future.delayed(const Duration(seconds: 2), () {
context.router.replace(MainRoute());
});
}
// Kalau error
else if (state.errorMessage != null) {