2025-10-23 22:16:53 +07:00
|
|
|
import 'package:auto_route/auto_route.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
2025-10-24 01:16:50 +07:00
|
|
|
import '../../components/assets/assets.gen.dart';
|
|
|
|
|
import '../../router/app_router.gr.dart';
|
|
|
|
|
|
2025-10-23 22:16:53 +07:00
|
|
|
@RoutePage()
|
|
|
|
|
class SplashPage extends StatefulWidget {
|
|
|
|
|
const SplashPage({super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
State<SplashPage> createState() => _SplashPageState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _SplashPageState extends State<SplashPage> {
|
2025-10-24 01:16:50 +07:00
|
|
|
_startDelay() => Future.delayed(const Duration(seconds: 2), _goNext);
|
|
|
|
|
|
|
|
|
|
_goNext() => context.router.replace(const LoginRoute());
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
_startDelay();
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-23 22:16:53 +07:00
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2025-10-24 01:16:50 +07:00
|
|
|
return Scaffold(
|
|
|
|
|
body: Center(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(20),
|
|
|
|
|
child: Assets.images.logo.image(
|
|
|
|
|
width: 100,
|
|
|
|
|
height: 100,
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
2025-10-23 22:16:53 +07:00
|
|
|
}
|
|
|
|
|
}
|