I want to click on the button and jump to the next widget in my SingleChildScrollView
but I have to pass height in the controller and I have a text widget and I don't know what is the height of text because there came from the server.
so can anyone help me please how can I jump to the second container in my SingleChildScrollView
?
here is my button I want to press :
IconButton(
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
hoverColor: Colors.transparent,
padding: EdgeInsets.zero,
constraints: BoxConstraints(),
onPressed: () {
scrollController.animateTo(
500.0, // here
curve: Curves.easeInOut,
duration: Duration(milliseconds: 1800 ));
},
icon: SvgPicture.asset(
MyIcons.message3,
),
),
it's my controller :
ScrollController scrollController = ScrollController();
here is my code :
SingleChildScrollView(
controller: scrollController,
child: Column(
children: [
text(),
Container()
]));
I just want to jump to text and receive to the container when I click on the button.