I’m not good at animation but want to add animation which is like , there are 4 alphabets letters "B", "C" , "D" and "E" which should animate from their 4 axis towards to the center and make a logo at center then when animation get complete, social buttons should animtate from the bottom that’s all I want to implements.
I’m going to add screens which make my concept more clear, what I’m trying to say :
First view
second view
Code for simple for showing Splash image
class SplashScreen extends StatefulWidget {
const SplashScreen({Key? key}) : super(key: key);
@override
State<StatefulWidget> createState() {
return _SplashScreenState();
}
}
class _SplashScreenState extends State<SplashScreen> {
Timer? timer;
@override
void initState() {
super.initState();
navigatePage();
}
void navigatePage() async {
timer = Timer(const Duration(seconds: 2), () async {
isLoggedIn
? Navigator.pushReplacementNamed(context, "home")
: Navigator.pushReplacementNamed(context, "login");
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xffF7F8F8),
body: Image.asset(
'assets/images/splash.png',
fit: BoxFit.cover,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
));
}
@override
void dispose() {
timer?.cancel();
super.dispose();
}
}
2
Answers
You can play with
AnimatedPositioned
andAnimatedRotation
:I created the animation simply using
Hero
, focused on the animation is BETWEEN PAGES.Please refer to the example for not wearing fancy colours or designs.
How to test
SplashScreen
to your app.LoginPage
with animation.SpalshScreen
.I did my best but I am pretty sure there must be a better solution.
I hope you get some hints from my code though.