Flutter TextField hidden by Keyboard, try many solution but not working

后端 未结 4 490
轮回少年
轮回少年 2020-12-12 04:12

When focussing on the TextField, the keyboard hides over the TextField. Below I attached a screenshot with code. Please guide me in fixing this issue.

signup

4条回答
  •  再見小時候
    2020-12-12 04:46

    Can you wrap the body of your Scaffold with SingleChildScrollView and wrap your Container with the ConstrainedBox

    Here is the output that I get https://prnt.sc/qozsvc

    Keyboard will still be on top of the textfields but by using SingleChildScrollView, screen will be scrollable so you can scroll down and see textfields again.

    This solution works for me.

    Scaffold(
      body: SingleChildScrollView(
        child: ConstrainedBox(
          constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height),
          child: Container(
            .
            .
            .
    

提交回复
热议问题