title: Flutter ternary conditional is null and not subtype of bool
body: <pre><code>Text(
    data?[&quot;success&quot;] != null ? &quot;Success&quot; : &quot;Failure&quot;,
    style: TextStyle(
      color: data?[&quot;success&quot;] ? Colors.green : Colors.red,
      fontSize: 15.0),
    )
  ),
  </code></pre>
  <blockquote>
  <p>_TypeError (type 'Null' is not a subtype of type 'bool')</p>
  </blockquote>
  <p>Sometimes <code>data[&quot;success&quot;]</code> has a response of <code>null</code> but it usually is <code>true</code> or <code>false</code> <code>boolean</code>.</p>
  <p>I'm using the spacexdata.com api for launches: <a href="https://docs.spacexdata.com/#bc65ba60-decf-4289-bb04-4ca9df01b9c1" rel="nofollow noreferrer">https://docs.spacexdata.com/#bc65ba60-decf-4289-bb04-4ca9df01b9c1</a> and it is not data I control.</p>
  <p>Hoping someone can help</p>