title: how to turn disabled button into enabled button depending on conditions
body: <p>I'm new to flutter and I'm trying to make a button disabled as long as some text fields are empty, so i made 3 textcontrollers to act as a controller for the 3 text fields and i made a function to check the function is:</p>
  
  <pre><code>bool isEmpty(){
      setState(() {
            if(textEditingController.text!=" "&amp;&amp;textEditingController2.text!=" "&amp;&amp; textEditingController3.text!=" "){
              isButtonEnabled=true;
  
  
            }
          });
         return isButtonEnabled; 
    }
  </code></pre>
  
  <p>And the code for the text field is:</p>
  
  <pre><code>TextField(
                    onSubmitted:null,
  
                    controller: textEditingController3,
  
  
                  )
  </code></pre>
  
  <p>Then i write the code for the button as follows:
    Center(</p>
  
  <pre><code>  child: RaisedButton(
           child: Text("Button 1",style: TextStyle(color:Colors.white),),
            onPressed:isButtonEnabled?(){ print("enabled");}:null,
            color: Colors.red,
  
              ),
  </code></pre>
  
  <p>The problem is the button remains disabled even after i write in the text fields. Any idea?
  Thanks in advance.
  <strong>EDIT:</strong>
   thanks to @diegoveloper answer this worked, but what if i wanted to put intital value and i want the button to be enabled only if the text fields have values for the text fields as following :</p>
  
  <pre><code>@override
    void initState() {
      super.initState();
     textEditingController  = new TextEditingController(text: name);
        textEditingController2  = new TextEditingController(text: email);
           textEditingController3  = new TextEditingController(text: " place");
  
  
    }
  </code></pre>
  
  <p>Then i updated the isEmpty method to be:</p>
  
  <pre><code>bool isEmpty(){
      setState(() {
            if((textEditingController.text!=" ")&amp;&amp;(textEditingController2.text!=" ")&amp;&amp; (textEditingController3.text!=" ")&amp;&amp;(textEditingController!=null)&amp;&amp;(textEditingController2!=null)&amp;&amp;(textEditingController3!=null)){
              isButtonEnabled=true;
  
  
  
            }
            else{
                          isButtonEnabled=false;
  
            }
          });
         return isButtonEnabled; 
    }
  </code></pre>
  
  <p>The problem is despite of the intials values i gave to text fields the button is still disabled, also when i edit the 3 values of textfields the button is enabled, but if i deleted the text (in which i think it's meant by null) the button is still disabled.        </p>