How to detect when a TextField is selected in Flutter?

前端 未结 5 2015
猫巷女王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:49

    Simply use onTap function of TextField.

    TextField(
      onTap: () {
        // Your code.
      },
    );
    

提交回复
热议问题