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

后端 未结 4 1565
青春惊慌失措
青春惊慌失措 2020-12-12 04:33

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:37

    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(
            .
            .
            .
    

提交回复
热议问题