I would like to have a widget that can be scrolled both horizontally and vertically at the same time. I would place widgets in them that are larger that the viewport. It can be Container of height and width larger than that of the Screen. For eg if image is larger that screen the i can scroll it to view top, left, bottom and right parts Thanks in Advance.
2 Answers
0
votes
Maybe a solution might be to put a listView inside another ListView and change its scrool direction ... For example:
ListView(
shrinkWrap: true,
primary: true,
children: <Widget>[
ListView(
shrinkWrap: true,
primary: false,
scrollDirection: Axis.horizontal,
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width*2,
height: MediaQuery.of(context).size.height*2,
),
],
)
],
),
Not tested, just trying to help...
0
votes
This sounds similar to: Multidirectional scroll in flutter
But maybe the following plugin might be what you want: https://pub.dev/packages/bidirectional_scroll_view
And if you want a deep dive, this is also being discussed in the gitrepo from Flutter: https://github.com/flutter/flutter/issues/20175
I am not sure why you would want this exactly, but it might not make sense having such a big image in a mobile context. That being said I can imagine it would happen in the context of, for example, a zoom into the photo.