title: Grab the textfield data from another stateful widget class
body: <p>I am trying to view the textfield data from another class by accessing the state class's method. I want to get the textfield value in another class when i click a button. </p>
  
  <p>I tried calling the method which should return a string but i don't get any value when i try to access it from the other class.</p>
  
  <pre><code>class TitleWidget extends StatefulWidget{
    final IncidentComponent data;
    String titleVal;
    TitleWidget(this.data);
    @override
    TitleWidgetState createState() =&gt; TitleWidgetState();
  }
  
  class TitleWidgetState extends State&lt;TitleWidget&gt;{
  
    final titleController = TextEditingController();
  
    titleTextValue() {
      print("title text field: ${titleController.text}");
      return titleController.text;
    }
  
    @override
    void initState() {
      super.initState();
      titleController.addListener(titleTextValue);
    }
  
    @override
    Widget build(BuildContext context) {
      return  TextField(
        controller: titleController);
  
    }
  }
  </code></pre>
  
  <p>I tried to access the above method to get the string in another class.</p>
  
  <pre><code>FloatingActionButton.extended(
     label: Text("Complete Report",
     onPressed: () { print('title is ' + TitleWidgetState().titleTextValue()); }
  )
  </code></pre>
  
  <p>I was expecting the textfield value when ever i press the FAB button from the other class. But i get nothing from the other class method.
  But the titleTextValue() method's print statement prints the right value of the textfield.</p>