0

I want to make a vertical image viewer.

But when the Image is bigger than the screen, top&bottom of the image are hidden.

enter image description here

So I made Pageview and put ListView in PageView.

Now I can scroll down until the end of the ListView but can't scroll PageView.

I want to make 'complete' scrollview in the flutter.

How can I make scroll view in flutter?

PageView(
                    scrollDirection: Axis.vertical,
                    pageSnapping: false,
                    onPageChanged: (index) {
                      setState(() {
                        _currentSlider = index;
                      });
                    },
                    children: file.getImages
                        .map((e) => Center(
                              child: ListView(
                                physics: ClampingScrollPhysics(),
                                children: [
                                  Image.memory(
                                    e,
                                    fit: BoxFit.fitWidth,
                                  )
                                ],
                              ),
                            ))
                        .toList(),
                  )
이상진
  • 673
  • 1
  • 6
  • 13

1 Answers1

0

try adding a SingleChildScrollView() like so:

PageView(
      scrollDirection: Axis.vertical,
      pageSnapping: false,
      onPageChanged: (index) {
        setState(() {
          _currentSlider = index;
        });
      },
      children: file.getImages
          .map((e) => Center(
            child: SingleChildScrollView(
              child: ListView(
                physics: ClampingScrollPhysics(),
                children: [
                  Image.memory(
                    e,
                    fit: BoxFit.fitWidth,
                  )
                ],
              ),
            ),
      ))
          .toList(),
    )
flutter_bee
  • 150
  • 9