Flutter TextFormField hidden by keyboard

后端 未结 7 1483
暖寄归人
暖寄归人 2020-11-29 03:22

NOTE: Im using Navigator.of(context).push to push ModalRoute,

Hi I have page with ModalRoute with TextFormField in the bod

相关标签:
7条回答
  • 2020-11-29 04:11

    What worked for me was combining the docs with tips over here. It uses, LayoutBuilder, SingleChildScrollView, Padding (with bottom hack) and finally, ConstrainedBox (to use Expanded). By combining these It works with Expanded widgets inside Columns.

    The docs (from where LayoutBuilder comes): https://api.flutter.dev/flutter/widgets/SingleChildScrollView-class.html

    Structure

     return Scaffold(
          resizeToAvoidBottomInset: false,
          resizeToAvoidBottomPadding: false,`
    
    body: SafeArea(
            child: Container(
              child: LayoutBuilder(builder:
                  (BuildContext context, BoxConstraints viewportConstraints) {
                return SingleChildScrollView(
                  reverse: true,
                  child: Padding(
                    padding: EdgeInsets.only(bottom: bottom),
                    child: ConstrainedBox(
                      constraints: BoxConstraints(
                          minHeight: viewportConstraints.maxHeight,
                          maxHeight: viewportConstraints.maxHeight),
                      child: Column(
    
    0 讨论(0)
提交回复
热议问题