How to clear TextField Entered Text automatically in Flutter

0 votes

Hi Guys,

I have created a TextField in Flutter App. But when I write something to this field, it will not clear data automatically. How can I clear the data from the TextField?

Sep 10, 2020 in Others by akhtar
• 38,240 points
17,484 views
did you find any solution? :(
Hi,

Try the below-given solution. It will work.

1 answer to this question.

0 votes

Hi@akhtar,

You can control the TextField in your Flutter App. The TextField widget of Flutter has an inbuilt method TextEditingController.clear() which is used to clear or empty the typed text inside the Text Input widget. The clear() method would empty the entered string text and set its default value is empty.

var msgController = TextEditingController();
TextField(
   controller: msgController,
)
answered Sep 10, 2020 by MD
• 95,340 points

Related Questions In Others

0 votes
1 answer

How to give space between two Textfield in Flutter?

Hi@akhtar, There is various way to give space ...READ MORE

answered Sep 8, 2020 in Others by MD
• 95,340 points
1,304 views
0 votes
1 answer

How to add a send button inside TextField in Flutter?

Hi@akhtar, You can use decoration inside your TextField. ...READ MORE

answered Sep 10, 2020 in Others by MD
• 95,340 points
10,993 views
0 votes
1 answer

How to make rounded TextField in flutter?

Hi@akhtar, You can use decoration inside your TextField. This has ...READ MORE

answered Sep 10, 2020 in Others by MD
• 95,340 points
1,813 views
0 votes
1 answer

How to check the connected device name in Flutter?

Hi@akhtar, Flutter has its command own command to ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,340 points
2,820 views
0 votes
1 answer

What is the future of flutter?

Hi@MD, Flutter is a rather new cross-platform framework ...READ MORE

answered Jul 17, 2020 in Others by akhtar
• 38,240 points
333 views
0 votes
1 answer

What is Flutter?

Hi@akhtar, Flutter is an app SDK for building ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,340 points
467 views
0 votes
1 answer

How to install Flutter in Windows system?

Hi@akhtar, You can follow the below-given steps to ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,340 points
799 views
0 votes
1 answer

How to retrieve the value of a text field in Flutter App?

Hi@akhtar, In your TextField, you can call one ...READ MORE

answered Sep 3, 2020 in Others by MD
• 95,340 points
665 views
0 votes
1 answer

How to add Icon to the TextField in Flutter App?

Hi@akhtar, You can add any Icon to your ...READ MORE

answered Sep 3, 2020 in Others by MD
• 95,340 points
2,600 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP