Flutter Images sliding next page

Viewed 521

I am new to flutter I am stuck I want images sliding images after ontap ! like our gallery app... but the thing is images slide from privious array...suppose 1st screen I have 10 images list I opened 6 image to next screen to show full screen and when I slide on that page I want after that image I want to see 7 no or 5 no images...hope u get my point

       body: Stack(
       children: <Widget>[
       Container(
        child:
        Center(
          child: Swiper(
            autoplay: false,
            itemBuilder: (BuildContext context, int index) {
              return new PhotoView(
                imageProvider: NetworkImage(widget.Backgroundimg,),
                minScale: PhotoViewComputedScale.contained * 0.8,
                maxScale: PhotoViewComputedScale.covered * 1.5,
              );

            },
            itemCount: 10,
            viewportFraction: 1,
            scale: 0.9,
          ),
        ),
      ),

here is my body I use json for image listing......After that sending images through widget please help me for sliding array thank you

1 Answers

I would recommend to use Carousel Slider as it will also provide many options and suitable for gallery app. https://pub.dev/packages/carousel_slider

add the below dependency in pubsec.yaml

carousel_slider: ^2.3.1

and see the given example in link.

use

initialPage: 5,

in carousel_slider parameter to show the initial Image

Related