How to detect when a TextField is selected in Flutter?

前端 未结 5 2016
猫巷女王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 03:11

    There is another way if your textfield needs to be disabled for some purpose like mine. for that case, you can wrap your textField with InkWell like this,

    InkWell(
      onTap: () {
        print('clicked');
      },
      child: TextField(
        enabled: false,
      ),
    );
    

提交回复
热议问题