It’s a big world out there…explore!!!!
Amazed by the world of Flutter, I started exploring TextField (basics of any programming language).
There are 2 ways to retrieve the input text from TextField :
- using TextField events
- using TextEditingController
No need to worry, I have covered both ways in the program.:)
Point 1 :
Whenever, you type in the input box, onChange event of Text Field gets called. e.g Say you wrote Aseem, you can see the following logs :
On pressing the keyboard’s tick button, onSubmitted event of TextField gets called. Here, I have retrieved the input text(in this case Hello) and displayed as below :
Point 2 :
On click of the raisedButton (Click me), I have retrieved the text entered from the input box, using onPressed event .
Video demonstration :
Complete Source Code : https://github.com/AseemWangoo/flutter_programs/blob/master/TextField.dart