Skip to content

Instantly share code, notes, and snippets.

@slamdon
Created February 17, 2020 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slamdon/20e7de43a3e2971e04da4e2a7c6f794b to your computer and use it in GitHub Desktop.
Save slamdon/20e7de43a3e2971e04da4e2a7c6f794b to your computer and use it in GitHub Desktop.
HomePage
@override
Widget build(BuildContext context) {
return Center(
child: SizedBox.fromSize(
size: Size.fromHeight(550),
child: TripPageTransformer(
pageViewBuilder: (context, visibilityResolver) {
return PageView.builder(
controller: PageController(viewportFraction: 0.85),
itemCount: trips.length,
itemBuilder: (context, index) {
final trip = trips[index];
final pageVisibility =
visibilityResolver.resolvePageVisibility(index);
return TripPageItem(
trip: trip, tripPageVisibility: pageVisibility);
},
);
},
),
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment