Want to scroll to bottom of SingleChildScrollView when TextField gets focus? Use addPostFrameCallback to listen after the widget was built.
1 2 3 4 5 6 7 8 9 10 11 | _onLayoutDone(_){ FocusScope.of(context).requestFocus(focusNode); } @override void initState() { //... your stuff WidgetsBinding.instance.addPostFrameCallback(_onLayoutDone); super.initState(); } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.