Bottom overloaded by 213 pixels in flutter

前端 未结 14 1051
面向向阳花
面向向阳花 2021-02-01 02:04

Hi I am trying to create login screen. It is working fine for me. When I open the keyboard then it is giving me an error Bottom overloaded by 213 pixels.

         


        
14条回答
  •  你的背包
    2021-02-01 02:31

    wrap with SingleChildScrollView Widget here's my code to solve this situation: it is best and easiest method

    SingleChildScrollView(
                  child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              Hero(
                tag: 'logo',
                            child: Container(
                  height: 200.0,
                  child: Image.asset('images/logo.png'),
                ),
              ),
              SizedBox(
                height: 48.0,
              ),
              TextField(
                onChanged: (value) {
                  //Do something with the user input.
                },
                decoration:  kTextFieldDecoration.copyWith(hintText: 'Enter username'),
              ),
              SizedBox(
                height: 8.0,
              ),
              TextField(
                onChanged: (value) {
                  //Do something with the user input.
                },
                decoration: kTextFieldDecoration.copyWith(hintText: 'Enter password'),
              ),
              SizedBox(
                height: 24.0,
              ),
    
               RoundedButton(
                colour: Colors.blueAccent,
                text: 'Register',
                onPressed: () {
                //later todo
                },
              ),
    
            ],
          ),
        ),
    

提交回复
热议问题