title: How to use Future<bool> in if statement condition?
body: <p>In Flutter, am using "url_launcher" package which uses <code>Future&lt;bool&gt;</code> to check if the app can launch other apps.  Within my code I have phone numbers listed, and I want to place an Icon for WhatsApp only if it is installed on the user's device.</p>
  
  <pre><code>bool hasWhatsApp() {
      var whatsExists;
      canLaunch('https://api.whatsapp.com/').then((val) =&gt; whatsExists = val);
      return whatsExists;
    }
  </code></pre>
  
  <p>am using this function to check inside an if statement to show the icon on the screen or not, however, it keeps returning 'null'.  </p>
  
  <pre><code>if (phoneNumber.substring(0, 1) != '2' &amp;&amp; hasWhatsApp())
                      IconButton(
                        icon: Image.asset('assets/icons/whatsapp.png'),
                        iconSize: Theme.of(context).iconTheme.size,
                        onPressed: () async {
                            await launch(whatsUrl);
                        },
                      ),
  </code></pre>
  
  <p>how can I fix this please?</p>