Browse Source

update

develop
sina 5 hours ago
parent
commit
f10f7c71ae
  1. BIN
      assets/images/splash_logo.png
  2. 52
      lib/features/splash/presentation/ui/splash_page.dart

BIN
assets/images/splash_logo.png

After

Width: 518  |  Height: 518  |  Size: 180 KiB

52
lib/features/splash/presentation/ui/splash_page.dart

@ -15,15 +15,37 @@ class SplashPage extends StatefulWidget {
State<SplashPage> createState() => _SplashPageState(); State<SplashPage> createState() => _SplashPageState();
} }
class _SplashPageState extends State<SplashPage> {
class _SplashPageState extends State<SplashPage> with SingleTickerProviderStateMixin{
late AnimationController _controller;
late Animation<double> _translateY;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_controller = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 900),
);
_translateY = Tween<double>(begin: 40, end: 0).animate(
CurvedAnimation(
parent: _controller,
curve: Curves.easeOutBack, // gives that slight bounce
),
);
_controller.forward();
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
context.read<SplashBloc>().goToHomePage(context); context.read<SplashBloc>().goToHomePage(context);
}); });
} }
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -50,13 +72,29 @@ class _SplashPageState extends State<SplashPage> {
), ),
), ),
), ),
child: Stack(
alignment: Alignment.center,
children: [
Positioned.fill(child: _image()),
_loading(context),
],
child: Center(
child: AnimatedBuilder(
animation: _translateY,
builder: (context, child) {
return Transform.translate(
offset: Offset(0, _translateY.value),
child: child,
);
},
child: Image.asset(
'assets/images/splash_logo.png',
height: 245,
width: 245,
),
),
), ),
// Stack(
// alignment: Alignment.center,
// children: [
// Positioned.fill(child: _image()),
// _loading(context),
// ],
// ),
), ),
); );
} }

Loading…
Cancel
Save