Keyboard not being detected. MediaQuery.of(context).viewInsets.bottom always returns 0.0

后端 未结 3 537
感动是毒
感动是毒 2021-02-09 03:45

I have a scaffold with a TextField inside. The keyboard always covers this field when it previously would move the field above the keyboard. This is happening on all the pages i

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-09 04:11

    I've had this issue recently. Do you have fullscreen set to true? If fullscreen is enabled, MediaQuery.viewInsets.bottom will return 0.0. Since you mentioned the problem only occurs in android, It's possible you set the fullscreen property in the native android files. Check styles.xml

        false
    

    Other way to remove fullscreen from the app is SystemChrome.setEnabledSystemUIOverlays([]) in flutter page.

    One more thing you might want to check is resizeToAvoidBottomPadding: to false in Scaffold.

    The issue has been raised in Flutter issues as well: https://github.com/flutter/flutter/issues/25050

提交回复
热议问题