-
-
Save MarcinusX/1ad095b269011e24ff7241bf2b76aeb5 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
class _SlidingCardsViewState extends State<SlidingCardsView> { | |
PageController pageController; | |
@override | |
void initState() { | |
super.initState(); | |
pageController = PageController(viewportFraction: 0.8); | |
} | |
@override | |
void dispose() { | |
pageController.dispose(); | |
super.dispose(); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return SizedBox( | |
height: MediaQuery.of(context).size.height * 0.55, | |
child: PageView( | |
controller: pageController, | |
children: <Widget>[ | |
SlidingCard( | |
name: 'Shenzhen GLOBAL DESIGN AWARD 2018', | |
date: '4.20-30', | |
assetName: 'steve-johnson.jpeg', | |
), | |
SlidingCard( | |
name: 'Dawan District, Guangdong Hong Kong and Macao', | |
date: '4.28-31', | |
assetName: 'rodion-kutsaev.jpeg', | |
), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment