Soft keyboard hides TextFormField inside the InteractiveViewer

64 Views Asked by At

I am having a text form field at the bottom of the screen. I wrap this text form field inside a Interactive Viewer. When the text form field is focused, the soft keyboard rises and hides the text form field.

  @override
  Widget build(BuildContext context) {
    return InteractiveViewer(
      child: Stack(
        children: <Widget>[
          Positioned(
            left: 0,
            top: 700,
            right: 0,
            bottom: 0,
            child: TextFormField(),
          ),
        ],
      ),
    );
  }

I have tried resizeToAvoidBottomInset: true. How to move the text form field to the top of the soft keyboard so that it stays visisble? And I don't want to wrap the InteractiveViewer in a SingleChildScrollView.

1

There are 1 best solutions below

2
John Weidner On

Try not specifying the top: 700. Just have bottom: 0 if you want the TextFormField pinned to the bottom of the available space.