Requirement: Needs to have pinch zooming/panning in all directions and scrolling with fling support
Issue faced: To achieve this scenario tried wrapping listview.builder with interactiveviewer, but in this case, only x-axis i.e. horizontal zooming alone works, unable to zoom in the y direction. I suspect while zooming vertically, the Listview widget's gesture wins. The reason for using listView is having n number of widgets/children. So is there any workaround to achieve my requirement, kindly assist me in this, thanks in advance. I have attached the code below which I have tried.
Also kindly let me know is there any other widgets in Flutter to achieve my functionality.
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Container(
color: Colors.red,
child: InteractiveViewer(
child: ListView.builder(
itemCount: 30,
itemBuilder: (context, index) {
return Image.network(
'https://images.pexels.com/photos/213780/pexels-photo-213780.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',
);
},
),
),
),
);
}
}
Set constrained property value false