Search code examples
fluttermobileflutter-dependencies

how we use mobile keyboard key event in flutter?


  • I can use key Event when use click the phone keyboard enter key and go to next Edit Text and next to another submit button.

  • I am trying to get the user phone keyboard key click event but I don't know what is method use for this event in flutter. Problem I can use the input type method for keyboard as numeric but I can not get the key event.


Solution

  • if you set some basic functions on keyboard button so you can try this method

    change event by TextInputAction

    • TextInputAction.done
    • TextInputAction.search
    • TextInputAction.continueAction
    • TextInputAction.emergencyCall

    and more.........

    TextFormField(
    
          maxLines: 1,
          autovalidateMode: AutovalidateMode.always,
          textInputAction: TextInputAction.done,
         
        ),