Skip to content

InteractiveViewer inside pageview doesn't allow scaling #68594

@mehtahardikr

Description

@mehtahardikr
PagerController controller=
        PageController(viewportFraction: 1, initialPage: 1);
TransformationController _transformationController = TransformationController();

var images=['https://asia.olympus-imaging.com/content/000107506.jpg'];

 PageView.builder(
              onPageChanged: (int page){
                 setState(() {
                   _transformationController.value = Matrix4.identity();
                 });

              },
                controller: controller,
                itemCount: images.length,
                itemBuilder: (BuildContext context, int index) {
                  return Center(
                    child :SizedBox(
                       height:  250,
                        child: Container(
                          width: double.infinity,
                          child: images[index]?.length !=0 ? InteractiveViewer(
                              panEnabled: false, // Set it to false to prevent panning.
                              boundaryMargin: EdgeInsets.all(10),
                              transformationController: _transformationController,
                              minScale: 0.5,
                              maxScale: 3.0,
                            child : Image.network(mages[index],fit: BoxFit.fill,
                              loadingBuilder:(BuildContext context, Widget child,ImageChunkEvent loadingProgress) {
                                if (loadingProgress == null) return child;
                                return Center(
                                  child: CircularProgressIndicator(
                                    value: loadingProgress.expectedTotalBytes != null ?
                                    loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes
                                        : null,
                                  ),
                                );
                              },
                            ),
                          ):Container(),
                        )
                    )
                      );
                },
              );

here is chunk of code.
and video is for reference here.
https://drive.google.com/file/d/1uZEl90cg3KALWHAx2DpAyUWt5kFqnxZK/view?usp=sharing

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectf: material designflutter/packages/flutter/material repository.found in release: 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions