best-flutter / transformer_page_view

PageTransformer for flutter
Other
521 stars 149 forks source link

overlapping transform #26

Open vjyanand opened 4 years ago

vjyanand commented 4 years ago

How do I avoid overlapping when swipe with transform as below?

class DeckTransformer extends PageTransformer {
  @override
  Widget transform(Widget item, TransformInfo info) {
    double position = info.position;
    if (position <= 0) {
      return item;    
    } else if (position <= 1) {
      return Transform.translate(
        offset: Offset(0, -info.height * position),
        child: item,
      );
    }
    return item;
  }
}
TransformerPageView(
   scrollDirection: Axis.horizontal, 
   transformer: DeckTransformer(),

Image of the issue

Sorry for posting help request in issue.