-
-
Save TechieBlossom/28f071879bc9fd4f88aed47f9c14166b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
Widget build(BuildContext context) { | |
//1 | |
return AnimatedBuilder( | |
//2 | |
animation: pageController, | |
builder: (context, child) { | |
//3 | |
double value = 1; | |
//4 | |
if (pageController.position.haveDimensions) { | |
value = pageController.page - index; | |
value = (1 - (value.abs() * 0.1)).clamp(0.0, 1.0); | |
return Align( | |
alignment: Alignment.topCenter, | |
child: Container( | |
//5 | |
height: Curves.easeIn.transform(value) * ScreenUtil.screenHeight * 0.35, | |
width: Sizes.dimen_230.w, | |
child: child, | |
), | |
); | |
} else { | |
print('else'); | |
return Align( | |
alignment: Alignment.topCenter, | |
child: Container( | |
height: | |
Curves.easeIn.transform(index == 0 ? value : value * 0.5) * | |
ScreenUtil.screenHeight * 0.35, | |
width: Sizes.dimen_230.w, | |
child: child, | |
), | |
); | |
} | |
}, | |
child: MovieCardWidget( | |
movieId: movieId, | |
posterPath: posterPath, | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment