-
Notifications
You must be signed in to change notification settings - Fork 30.2k
InteractiveViewer inside pageview doesn't allow scaling #68594
Copy link
Copy link
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team