Answers for "flutter textformfield value"

1

flutter textformfield value

1. Create a TextEditingController
final myController = TextEditingController();
  
2. Supply the TextEditingController to a TextField
TextField(
  controller: myController,
);
// or textformfield
TextFormField(
  controller: myController,
);
 
3. Display the current value of the text field
print("Value from TextFiled or TextFormField: ${myController.text}");
Posted by: Guest on October-30-2021
3

textfield set value flutter

/// You can use a [TextFormField] instead of [TextField]
/// and use the [initialValue] property. for example:

TextFormField(initialValue: "I am smart")
Posted by: Guest on September-23-2020

Code answers related to "flutter textformfield value"

Browse Popular Code Answers by Language