Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set property:scale will make 'transformer' not work. #158

Open
SixSheeppp opened this issue Nov 15, 2019 · 0 comments
Open

Set property:scale will make 'transformer' not work. #158

SixSheeppp opened this issue Nov 15, 2019 · 0 comments

Comments

@SixSheeppp
Copy link


 Swiper(
           loop: true,
           transformer:  BannerItemTransformer(),
           scale: 0.8,
           itemBuilder: (BuildContext context, int index) {
             return ImageView(
               url: (entity == null || entity.data == null) ? null : entity.data[index].img,
               width: screenWidth,
               height: ratio * screenWidth,
             );
           },
           itemCount: (entity == null || entity.data == null) ? 1 : entity.data.length,
           viewportFraction: 0.9,
           autoplay: !(entity == null || entity.data == null),
           autoplayDelay: 3000,
         )

When i set scale in Swipe ,the transformer will not work.

So i found these in source code.

  PageTransformer transformer = widget.transformer;
      if (widget.scale != null || widget.fade != null) {
        transformer =
            new ScaleAndFadeTransformer(scale: widget.scale, fade: widget.fade);
      }

I think docs or assets may make it clear?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant