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

后端 未结 3 542
感动是毒
感动是毒 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:01

    When the keyboard opens, MediaQuery.of(context).viewInsets.bottom changes to reflect the new bottom (which is now at the top of the keyboard).

    However, the Android app may be in fullscreen:

    
    
        
        #FFFF00
    
    

    When this is the case, viewInsets.bottom will always be 0.0, even when the keyboard is open,

提交回复
热议问题