skip to Main Content

I’m using a Container with a fixed height of 478 pixels that contains a TextField. When the keyboard is opened, I get a “Bottom overflowed by 359 pixels” error. Here is my code:

Container(
  height: 478,
  child:  ListView.builder(
                                physics: AlwaysScrollableScrollPhysics(),
                                scrollDirection: Axis.vertical,
                                shrinkWrap: true,
                                padding: EdgeInsets.all(0),
                                itemCount: list.length,
                           TextField(controller:notesController,),
)

Whenever I tried to use keyboard i’m getting “Bottom overflowed by 359 pixels”,

I have used resizeToAvoidBottomInset: false, but this doesn’t worked.

How can I fix this issue?

2

Answers


  1. SingleChildScrollView(
                    child: Container(
                      height: 478,
                      child: TextField(controller:notesController,),
                    ),
                  )
    

    Wrap it with SingleChildScrollView

    Login or Signup to reply.
  2. You can add Padding to your container like this

    Padding(
        padding: EdgeInsets.only(
        bottom: MediaQuery.of(context).viewInsets.bottom,
      ),
        child: Container(
           height: 478,
           child: TextField(controller:notesController,),
          ),
    )
    

    And set isScrollControlled property to true in your showModalBottomSheet function.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search