Shortcut Keyboard For TextField Widget — Stack Secrets
In this post, we will add a shortcut keyboard for TextField
widget in Flutter app.
Introduction
Let’s say you have a user input field where users type in certain data. If user has to type a certain word or character frequently, you might want to provide a shortcut to such texts.
For an example, users might have to frequently type in numbers such as 100, 200, 500 etc. on a TextField
. In this post, we will learn to create a shortcut keyboard just for that purpose.
We are going to add this feature on our Expense Manager app continuing from previous post. At the end of this post, we will have achieved the following:
- Create a shortcut keyboard for
TextField
widget in flutter. - Set shortcut keyboard visible only when the
TextField
is set in focus. - Positioned the shortcut keyboard on top of the device keyboard.
- Update the
TextField
's value based upon the shortcut key pressed. - Set the cursor position of
TextField
programmatically.
View complete post here: Shortcut Keyboard For TextField Widget
Learn More About Working With TextField Widget
Originally published at http://stacksecrets.com on July 27, 2019.