Skip to content

Instantly share code, notes, and snippets.

@PrasathRavichandran
Created May 24, 2022 11:52
Show Gist options
  • Save PrasathRavichandran/facaa9433aa1108f4e75da32c9bf43b0 to your computer and use it in GitHub Desktop.
Save PrasathRavichandran/facaa9433aa1108f4e75da32c9bf43b0 to your computer and use it in GitHub Desktop.
....
Swiper(
itemCount: planetInfo.length,
itemWidth: MediaQuery.of(context).size.width,
itemHeight: MediaQuery.of(context).size.height,
layout: SwiperLayout.TINDER,
pagination: SwiperPagination(
builder: DotSwiperPaginationBuilder(
color: dotColor,
activeColor: Colors.white,
activeSize: 12,
space: 4)),
itemBuilder: (context, index) {
return InkWell(
onTap: () {
// Navigator
Navigator.push(
context,
PageRouteBuilder(
pageBuilder: (context, animation,
secondaryAnimation) =>
DetailsPage(
planetInfo: planetInfo[index])
)
);
},
child: Stack(
children: [
Column(
children: [
const SizedBox(
height: 100,
),
CustomCard(
name: planetInfo[index].name,
),
],
),
Padding(
padding: const EdgeInsets.only(left: 20),
// Hero animation
child: Hero(
tag: planetInfo[index].position,
child:
Image.asset(planetInfo[index].iconImage)),
)
],
),
);
},
),
.....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment