How to detect when a TextField is selected in Flutter?

前端 未结 5 2019
猫巷女王i
猫巷女王i 2020-12-13 02:24

I have a Flutter TextField which gets covered by the soft keyboard when the field is selected. I need to scroll the field up and out of the way when the keyboard is displaye

5条回答
  •  隐瞒了意图╮
    2020-12-13 02:50

    The easiest and simplest solution is to add the onTap method on TextField.

    TextField(
      onTap: () {
        print('Editing stated $widget');
      },
    )
    

提交回复
热议问题