Skip to main content

Dive Into Designing Flutter TextField

  

Dive Into Designing Flutter TextField

autofocus: Sets focus on TextField by default (i.e. as screen loads that contain TextField() in it, the keyboard opens up itself)

Changing Keyboard Type: Allows you to customize the keyboard.
Types are:
    1. TextInputType.text  (Normal Complete keyboard)
    2TextInputType.number  (for unsigned numerical information without a decimal point)
    3. TextInputType.phone  (for telephone numbers)
    4. TextInputType.name  (or a person's name)
    5. TextInputType.datetime  (for date and time information)
  6. TextInputType.text  (Normal Complete keyboard)
    7. TextInputType.emailAddress  (for email addresses)
    8. TextInputType.multiline  (for multiline textual information, accepts newlines when enter                                key is pressed. This is the input type used for all multiline                                 text fields)
    9. TextInputType.streetAddress  (for postal mailing addresses)
   10. TextInputType.url  (for URLs, requests keyboard with ready access to the "/" & "." keys)
   11. TextInputType.visiblePassword  (for passwords that are visible to user. Requests a keyboard with ready access to both letters and numbers)

Hide Text (Obscuring Text): Allows you to hide/obscure the text entered by user.
                                            
Example:
TextField(
    autofocus: true, 
    keyboardType: TextInputType.text,
    obscureText: true,  
)
For queries or any other help related to flutter or dart feel free to ask in the comments😊

Comments