I am using a SingleChildScrollView. Its scrollDirection is set to Horizontal with >20 child widgets placed inside a Row Widget. I want to programmatically scroll to a position widget(i.e, 5th or 6th position) in the Row. Is there any way to do it programmatically ?
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: buttons,
),
)
The easiest way to doing this is using Scrollable.ensureVisible.
Please see the code below :