Create a function to print the latest value.

Listen to the controller for changes.

Create a TextEditingController

Create a TextEditingController:

Note:
  Remember to dispose of the TextEditingController when it’s no
  longer needed. This ensures that you discard any resources used
  by the object.

Connect the TextEditingController to a text field

Supply the TextEditingController to either a TextField
or a TextFormField. Once you wire these two classes together,
you can begin listening for changes to the text field.

Create a function to print the latest value

You need a function to run every time the text changes.
Create a method in the _MyCustomFormState class that prints
out the current value of the text field.

Listen to the controller for changes