Reputation: 439
I am trying to implement a scroll view within a scroll view. My main screen is scrolling downwards, but I would like my timetable to also scroll horizontally.
The issue comes when I try to have a static part on the left hand side of the screen which does not move (the days).
I ideally would like to have the timetable (green view) scroll underneath the days (yellow view).I currently have the red view in the same row as the green view (which are both in the scroll view together, however they are not scrolling at all.
I have included an image to help show the problem I am facing. The blue arrow on the left is for the entire screen scrolling, which works well, the blue arrow on the top shows that the red view scrolls, and the third blue arrow in the green view shows that the green view show scroll underneath the yellow view, with the yellow view stain stationary.
]1)
Thanks for any help you can provide.
Upvotes: 0
Views: 1423
Reputation: 46
it was all all written with Dartpad and i didnt run it so there might be some syntax errors but hopefully you'll get the idea.
Container(height: 400,
width: 300,
child: Flex(
axis : ScrollDirection.vertical,
children:[
Container(
backgroundColor: Colors.red,
width: 250,
height: 150
child: ListView(
scrollDirection: Axis.horizontal,
children : [
Text("Your horizontal scrolling text"),
])),
Container(
backgroundColor: Colors.green,
child: Row(
children:[
Container(
child: Column()),
Container(
width:150,
height:200
child: ListView(
scrollDirection: Axis.horizontal,
children:[
]]))]))
Upvotes: 1
Reputation: 2021
You can achieve your output by SingleChildScrollView and you have to specify scroll direction and physics stuff inside SingleChildScrollView. like
SingleChildScrollView(child:(),.... )
Upvotes: 0