title: Flutter open whatsapp with text message
body: <p>I want to open whatsapp from my Flutter application and send a specific text string. I'll select who I send it to when I'm in whatsapp.</p>
  <p>After making some research I came up with this:</p>
  <pre class="lang-js prettyprint-override"><code>_launchWhatsapp() async {
    const url = &quot;https://wa.me/?text=Hey buddy, try this super cool new app!&quot;;
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw 'Could not launch $url';
    }
  }
  </code></pre>
  <p>Which works ok ish, however there are two problems:</p>
  <ol>
  <li>As soon as I make the text string into multi words it fails. So if I change it to:</li>
  </ol>
  <pre class="lang-js prettyprint-override"><code>_launchWhatsapp() async {
     const url = &quot;https://wa.me/?text=Hey buddy, try this super cool new app!&quot;;
     if (await canLaunch(url)) {
       await launch(url);
     } else {
     throw 'Could not launch $url';
    }
  }
  </code></pre>
  <p>Then the Could not launch $url is thrown.</p>
  <ol start="2">
  <li>I have whatsapp already installed on my phone, but it doesn't go directly to the app, instead it gives me a webpage first and the option to open the app.</li>
  </ol>
  <p>Here is the webpage that I see:</p>
  <p><a href="https://i.stack.imgur.com/Ailbz.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/Ailbz.jpg" alt="enter image description here" /></a></p>
  <p>Any help on resolving either of these issues would be greatly appreciated.</p>
  <p>Thanks</p>
  <p>Carson</p>
  <p>P.s. I'm using the Url_launcher package to do this.</p>