How to make animation with screen width and height? I have this code in initState but I can't get height of the screen before initState. How to deal with this?
controller = AnimationController(
vsync: this,
duration: Duration(milliseconds: 1500),
);
Tween<double> _height = Tween(begin: 0.0, end: screenHeight);
animationHeight = _height.animate(controller)..addListener(() {
setState(() {});
})
..addStatusListener((status) {
if (status == AnimationStatus.completed) {
//controller.reset();
}
if(status == AnimationStatus.reverse){
setState(() {
});
}
});