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

hide side image if have 1 item only? #282

Open
eggyot opened this issue Oct 19, 2021 · 0 comments
Open

hide side image if have 1 item only? #282

eggyot opened this issue Oct 19, 2021 · 0 comments

Comments

@eggyot
Copy link

eggyot commented Oct 19, 2021

how to hide side image if I only have 1 item? if not hide, so it's like have 3 item

I already try change to viewportFraction: 1 but it's change width to full width, I wan't change size width, only hide side image

see my image
https://i.stack.imgur.com/JiEHG.png

this my code

Swiper(
                                autoplay: true,
                                itemBuilder: (BuildContext context,
                                    int index) {
                                  return InkWell(
                                    child: Card(
                                        margin: new EdgeInsets.only(
                                            bottom: 30
                                        ),
                                        shape: RoundedRectangleBorder(
                                            borderRadius: BorderRadius
                                                .circular(20)
                                        ),
                                        child: (
                                            ClipRRect(
                                                child: (
                                                    CachedNetworkImage(
                                                      imageUrl: dataPromo[index].bannerPath,
                                                        fit: BoxFit.fill,
                                                    )
                                                )
                                            )
                                        )
                                    ),
                                  );
                                },
                                itemCount: dataPromo.length,
                                viewportFraction: 0.8,
                                scale: 0.9,
                              ),
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