Issue in interactive viewer zooming,when Interactive viewer is a child of Container


I am zoom a image inside interactive viewer , interactive viewer is a child of container ,set some height to container,after zoom a image, particular position in viewport ,i cant scroll and zoom a image

 class MyApp extends StatelessWidget {
  static const String _title = 'Flutter Code Sample';

  Widget build(BuildContext context) {
    return MaterialApp(
      title: _title,
      home: Scaffold(
        appBar: AppBar(title: const Text(_title)),
        body: Zoom(),
class Zoom extends StatefulWidget
  MyStatelessWidget createState()=> MyStatelessWidget();
/// This is the stateless widget that the main application instantiates.
class MyStatelessWidget extends State<Zoom> {

  Widget build(BuildContext context) {
    return Center(
child:Container(height: 300,
      child: InteractiveViewer(

       scaleEnabled: true,maxScale: 4.0,
        child: Center(
         child:Container( child:Image.asset('Assets/Java-001.jpg',fit: BoxFit.cover,alignment:,)),

How can i resolve this problem?


Try adding these arguments to the InteractiveViewer widget:

minScale: 0.1,
maxScale: 4.0,
boundaryMargin: const EdgeInsets.all(double.infinity),
constrained: false,

Answered By – Roslan Amir

Answer Checked By – Jay B. (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *