1

When the keyboard appears, the Flutter widgets resize. How to prevent this without using

resizeToAvoidBottomInset : false,

if I make it false then I can't see the TextFormField because the keyboard been above it so waht to do? here is my code

    return Scaffold(
//      resizeToAvoidBottomInset : false,
      body: Center(
        child: Stack(
          children: <Widget>[
            SizedBox(
              height: MediaQuery.of(context).size.height,
              width: MediaQuery.of(context).size.width,
              child: Image.asset('images/back_ui4.png',fit: BoxFit.fill,),
            ),
            SingleChildScrollView(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  SizedBox(height: 0.7*MediaQuery.of(context).size.height,),
                  TextFormField()
                ],
              ),
            ),
          ],
        ),
      ),
    );

Husamuldeen
  • 439
  • 1
  • 8
  • 21

1 Answers1

0
return Scaffold(
      body: SingleChildScrollView(
        child : Center(
        child: Stack(
          children: <Widget>[
            SizedBox(
              height: MediaQuery.of(context).size.height,
              width: MediaQuery.of(context).size.width,
              child: Image.asset('images/back_ui4.png',fit: BoxFit.fill,),
            ),
            Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  SizedBox(height: 0.7*MediaQuery.of(context).size.height,),
                  TextFormField()
                ],
              ),
            ),
          ],
        ),
      ),
    );
Jaimil Patel
  • 1,301
  • 6
  • 13