Set TextField Text Input type Password in Flutter using obscureText

obscureText parameter is used in TextField widget to automatically convert all the entered text into U+2022 BULLET characters. They look like bullet DOT inside Text Field widget. This parameter is mostly used to hide typed text inside Text Field like password typing. This would make the typing secure. obscureText cannot be set to null or empty you should have to pass Boolean true or false in it. So in this tutorial we would Set TextField Text Input type Password in Flutter using obscureText Android iOS example tutorial.

Contents in this project Set TextField Text Input type Password in Flutter using obscureText Android iOS Example:

1. Import material.dart package in your app’s main.dart file.

2. Call our main class MyApp using void main runApp() function.

3. Create our main class named as MyApp extends with State less widget.

4. Create Scaffold widget with Center widget in Widget build area.

5. Create a Container parent widget and Put the TextField widget inside it.

  • obscureText: true : Hiding the typed text in Text Input widget.

6. Complete source code for main.dart file:

Screenshots:

Set TextField Text Input type Password in Flutter using obscureText

Leave a Reply

Your email address will not be published. Required fields are marked *