0

If I press the textfield, I hope the comment box will come up on the keyboard. It works in an emulator, but it doesn't come up if i use an android device.

this I want and It works in an emulator enter image description here

this is in android device, The comment box is hiding behind keyboard.

enter image description here

I already tried the method of MediaQuery.of(context).viewInsets.bottom and resizeToAvoidBottomInset: true.

But it didn't work. I don't know why it works on emulators and not on devices.

This is my code, please help me.

SafeArea(
          child: Scaffold(
            resizeToAvoidBottomInset: false,
            body: RefreshIndicator(
              onRefresh: () {},
              child: Stack(
                children: [
                  _content(),
                  Positioned(
                      bottom: MediaQuery.of(context).viewInsets.bottom,
                      child: _commentBox()),
                  WaitingStreamBuilder(_waitingController),
                ],
              ),
            ),
          )),
aimyon
  • 63
  • 3
  • Check [this](https://stackoverflow.com/questions/50736571/when-i-select-a-textfield-the-keyboard-moves-over-it) out, pretty sure it's the same issue – Martin Nov 11 '21 at 02:43
  • Use SingleChildScrollView() as parent. – Rakesh Saini Nov 11 '21 at 04:14
  • I've tried this when you use a stack widget the position if the textfield may change . So, It's better to use a 'List view' or 'SingleChildScrollView' – Saffron-codes Nov 11 '21 at 05:07

0 Answers0