title: How do I solve the 'Failed assertion: boolean expression must not be null' exception in Flutter
body: <p>I was working on a Flutter application and kept receiving this error String in the logcat. </p>
  
  <pre><code>Failed assertion: boolean expression must not be null
  </code></pre>
  
  <p>Here is the code in question:</p>
  
  <pre><code>@override
  Widget build(BuildContext context) {
      return Center(
          child: ListView(
              children: &lt;Widget&gt;[
                  TextField(
                      controller: controller,
                      decoration: InputDecoration(
                          hintText: "Type in something..."
                      ),
                  ),
                  RaisedButton(
                      child: Text("Submit"),
                      onPressed: () =&gt; addString(),
                  ),
                  Flex(
                      direction: Axis.vertical,
                      children: (list_two = null) ? [] :
                      list_two.map((String s) =&gt; Text(s)).toList() 
                  )
              ],
          ),
      );
  }
  </code></pre>
  
  <p>What is causing the problem?</p>