<p dir="auto">Needs some API tweaking since the Clipboard's APIs are asynchronous.</p>
<p dir="auto">A user is reporting that launching URLs on his OnePlus 5 (running Android 8.1) has a 2 second delay before launching. On my LG Stylo 2 (5.1) it is instant, as it is on my iPhone 5c running iOS 10.</p>
<p dir="auto">I have tried both of these and they produce the same results.</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  void _launchURL(String url) async {
    try{
      launch(url);
      print('launched $url');
    }
    catch (e){
      print('Cannot launch $url');
      print(e);
    }
  }"><pre class="notranslate">  <span class="pl-k">void</span> <span class="pl-en">_launchURL</span>(<span class="pl-c1">String</span> url) <span class="pl-k">async</span> {
    <span class="pl-k">try</span>{
      <span class="pl-en">launch</span>(url);
      <span class="pl-en">print</span>(<span class="pl-s">'launched $<span class="pl-v">url</span>'</span>);
    }
    <span class="pl-k">catch</span> (e){
      <span class="pl-en">print</span>(<span class="pl-s">'Cannot launch $<span class="pl-v">url</span>'</span>);
      <span class="pl-en">print</span>(e);
    }
  }</pre></div>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  void _launchURL(String url) async {
    print(url);
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw 'Could not launch $url';
    }
  }"><pre class="notranslate">  <span class="pl-k">void</span> <span class="pl-en">_launchURL</span>(<span class="pl-c1">String</span> url) <span class="pl-k">async</span> {
    <span class="pl-en">print</span>(url);
    <span class="pl-k">if</span> (<span class="pl-k">await</span> <span class="pl-en">canLaunch</span>(url)) {
      <span class="pl-k">await</span> <span class="pl-en">launch</span>(url);
    } <span class="pl-k">else</span> {
      <span class="pl-k">throw</span> <span class="pl-s">'Could not launch $<span class="pl-v">url</span>'</span>;
    }
  }</pre></div>