title: TextField TextController not working inside Stateful widget
body: <p>I have created a Stateful widget to show my Alert Dialog which contains a searchbar , however the search bar text doesn't update on typing and stays blank. I have set the controller of the textfield as TextEditingController() however its still not working.</p>
  
  <p>code</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'package:flutter_convertor/Data Models/Society.dart';
  
  class MyDialogContent extends StatefulWidget {
  
    @override
    _MyDialogContentState createState() =&gt; new _MyDialogContentState();
  }
  
  class _MyDialogContentState extends State&lt;MyDialogContent&gt; {
  
    @override
    void initState(){
  
      super.initState();
    }
  
    @override
    Widget build(BuildContext context) {
  
      //Search bar
  
      Container searchBar = Container(
        child: Padding(
          padding: const EdgeInsets.only(left: 0.0, right: 0.0),
          child: TextField(
            onChanged: (value) {
              filterSearchResults(value);
            },
            controller: TextEditingController(),
            decoration: InputDecoration(
                labelText: "Search",
                prefixIcon: Icon(Icons.search),
                border: OutlineInputBorder(
                    borderRadius: BorderRadius.all(Radius.circular(15.0)))),
          ),
        ),
      );
  
  
      AlertDialog dialog = AlertDialog(
        title: searchBar,
        content: Container(
     ....
        ),
      );
  
  
  
      return dialog;
    }
  }
  
  </code></pre>
  
  <p>The controller works in my main dart file. but not when i put in my Alert Dialog stateful Widget</p>