How to Detect virtual keyboard events in Flutter?

Posted by Jessica Taylor | Updated on

Want to Detect virtual keyboard events in Flutter? I had a similar problem and I solved it in this way. Try to get your cursor position index in the text via TextEditingController and with that index get last typed value. Imagine below example is in TextField’s onChanged function which gives you inserted text.

Something like this:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers