Skip to content

Instantly share code, notes, and snippets.

@MarcinusX MarcinusX/sliding_cards.dart Secret
Created Apr 25, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.