In below code ,I just add a image inside container, I used interactive viewer for pinch zooming
import 'package:flutter/material.dart';
void main()
{
runApp(MyApp());
}
class MyApp extends StatelessWidget {
static const String _title = 'Flutter Code Sample';
@override
Widget build(BuildContext context) {
return MaterialApp(
title: _title,
home: Scaffold(
appBar: AppBar(title: const Text(_title)),
body: Zoom(),
),
);
}
}
class Zoom extends StatefulWidget
{
@override
MyStatelessWidget createState()=> MyStatelessWidget();
}
/// This is the stateless widget that the main application instantiates.
class MyStatelessWidget extends State<Zoom> {
@override
Widget build(BuildContext context) {
return Container(height: 1500,
child: InteractiveViewer(
child:Container( child:Image.asset('assets/pdfpage.png',fit: BoxFit.fitWidth)),
)
);
}
}
In Maximum zoom level
In Minimum zoom level
need to zoom a container widget alone, I use ctrl+mousewheelscroll to zoom a image in flutter web, appbar and whole webpage are zoomed.