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

Multiple problems with SliverList and Nullsafety #4

Open
SalahAdDin opened this issue Jun 5, 2021 · 0 comments
Open

Multiple problems with SliverList and Nullsafety #4

SalahAdDin opened this issue Jun 5, 2021 · 0 comments

Comments

@SalahAdDin
Copy link

Hello,

I'm testing this package in order to add a Instagram like multi image post:
image

Right now this is the result using pull_to_request and the following code as List item:

@override
  Widget build(BuildContext context) {
    final double swiperWidth = MediaQuery.of(context).size.width - 60;
    final double swiperHeight = swiperWidth * 3 / 4;
    return Column(
      mainAxisSize: MainAxisSize.min,
      children: <Widget>[
        // PostHeader(),
        GestureDetector(
            // TODO: do like on post
            onDoubleTap: () => null,
            child: SizedBox(
                height: swiperHeight,
                child: Swiper(
                  itemCount: post.gallery.length,
                  itemHeight: swiperHeight,
                  itemWidth: swiperWidth,
                  pagination: const SwiperPagination(),
                  /*pagination: SwiperPagination(
                    builder: SwiperCustomPagination(
                      builder:
                          (BuildContext context, SwiperPluginConfig? config) =>
                              const DotSwiperPaginationBuilder(
                        color: Colors.black12,
                        activeColor: Colors.black,
                      ).build(context, config),
                    ),
                  ),*/
                  itemBuilder: (_, int index) => CachedNetworkImage(
                    imageUrl: post.gallery[index].url,
                    fit: BoxFit.fill,
                    progressIndicatorBuilder:
                        (context, url, downloadProgress) => SizedBox(
                      height: 400.0,
                      child: Center(
                        child: CircularProgressIndicator(
                          value: downloadProgress.progress,
                        ),
                      ),
                    ),
                    errorWidget: (context, url, error) =>
                        const Icon(Icons.error),
                  ),
                ))
            ),
        // LikeButton(),
      ],
    );
  }

But it is not so easy when we try to use different Swiper layouts:
Layout Stack:
LayoutStack
Totally broken.

Layout Tinder:
LayoutTinder2
LayoutTinder1
It is very hard to swipe the images, though it is still possible, but very hard.

When we try to choose a widget, it also breaks the app:
BreaksAtChoosingWidget

Finally, if you don't wrap the Swiper, it will duplicate the indexes:
DuplicatedIndexSwiper

Right now, our current configuration is enought for use, but we think these problems would be annoying for other people.

Thank you very much.

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