Skip to main content

Posts

Showing posts with the label Flutter TextField

What is FocusNode in Flutter

What is FocusNode As per the name FocusNode so our basic idea is focusing on something but what? So, the answer is When a textField is selected and accepting input from a user at that time it is focused for that we have to tap on the textField but you do not need to do tapping without tapping you need to do focus on another TextField in that requirement you can use the FocusNode().  How to use the FocusNode with the example:- We are taking an example to Focus on the password text field on pressed of the floating Button Let's start with the following steps: 1. Create a FocusNode. we are starting with the create a FocusNode variable for the text field.  Note: you need to call dispose of the method of the FocusNode when you have finished using it and not further needed. This ensures that you discard any resources used by the object. 2. Pass the FocusNode to a TextField. In this, we have to pass the FocusNode in the specific text field which we are passing in the text fi...

Flutter TextField with Examples

Introduction to TextField TextField in Flutter is the most commonly used text input widget that allows users to collect inputs from the keyboard into an app. We can use the TextField widget in building forms, sending messages, creating search experiences, and many more. By default, Flutter decorated the TextField with an underline. We can also add several attributes with TextField, such as label, icon, inline hint text, and error text using an InputDecoration as the decoration. If we want to remove the decoration properties entirely, it is required to set the decoration to null. 1. decoration It is used to show the decoration around TextField.The most common attributes in decoration are as follows: border : It is used to create a default rounded rectangle border around TextField. labelText : It shows the label text on the selection of TextField. hintText : It shows the hint text inside TextField when there is no text entered.   TextField(             ...