to put it simply:
is there a way to have multiple sccrollable widgets (say, SingleSchildScrollView
) together in sync?
i just want 2 scrollables that can scroll the other as i scroll one.
this way i can use Stack
to put them on top of each other and the one behind can scroll following the front one.
or maybe put them in another set of Column
or Row
so that they are separate, but still scrolls by just scrolling either one.
i tried using controller
but it does not seems to be doing what i think it is.
Try the code below for example, the "RIGHT" will be in front of the "LEFT" and if i try to scroll them, only the RIGHT will move. so how do i move them both together at the same time??
please dont tell me to put the stack inside a ListView
, that is not what i need.
class _MyHomePageState extends State<MyHomePage> {
final ScrollController _mycontroller = new ScrollController();
@override
Widget build(BuildContext context) {
body:
Container(
height: 100,
child:
Stack( children: <Widget>[
SingleChildScrollView(
controller: _mycontroller,
child: Column( children: <Widget>[
Text('LEFT '),
Text('LEFT '),
Text('LEFT '),
Text('LEFT '),
Text('LEFT '),
Text('LEFT '),
],)
),
SingleChildScrollView(
controller: _mycontroller,
child: Column(children: <Widget>[
Text(' RIGHT'),
Text(' RIGHT'),
Text(' RIGHT'),
Text(' RIGHT'),
Text(' RIGHT'),
Text(' RIGHT'),
],)
),
])
)
}}
i believe this question has been asked before in multiple forums before but nobody has put a conclusion or solution to this at all. (see here)