title: Url Launcher using Flutter/Dart
body: <p>Good evening folks,</p>
  <p>I'm having a slight issue with URL launcher. Basically, what I am trying to do is get a URL from a Future function (retrieved from an API) and then navigate to that URL once a raised button is pressed. The code I have implemented works, but not without a small, pesky bug. The bug appears for about half a second to a second (I'm assuming until the API returns the URL), then the raised button is drawn on to the screen and works fine; I'm then able to navigate to the site. I'm trying to get rid of the bug completely. To save you some time, the relevant FutureBuilder is the second one. Below is my code:</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:provider/provider.dart';
  import 'package:url_launcher/url_launcher.dart';
  
  import '../models/yahoo_finance_stock_info.dart';
  import '../providers/companies_provider.dart';
  
  class BusinessScreen extends StatefulWidget {
    static const routeName = '/business-screen';
  
    @override
    _BusinessScreenState createState() =&gt; _BusinessScreenState();
  }
  
  class _BusinessScreenState extends State&lt;BusinessScreen&gt;
      with AutomaticKeepAliveClientMixin&lt;BusinessScreen&gt; {
    @override
    bool get wantKeepAlive =&gt; true;
  
    Future _companyDescription;
    Future _urlForUrlLauncher;
  
    var _isInit = true;
  
    @override
    void didChangeDependencies() {
      if (_isInit) {
        final companyTicker = ModalRoute.of(context).settings.arguments as String;
        final loadedCompany = Provider.of&lt;Companies&gt;(context, listen: false)
            .findByTicker(companyTicker);
  
        _companyDescription =
            Companies().getSecurityExtendStats(loadedCompany.tickerSymbol);
  
        _urlForUrlLauncher =
            Companies().getHistoricalData(loadedCompany.tickerSymbol);
      }
      _isInit = false;
      super.didChangeDependencies();
    }
  
    @override
    void initState() {
      // TODO: implement initState
      super.initState();
      _companyDescription;
    }
  
    @override
    Widget build(BuildContext context) {
      super.build(context);
      final companyTicker = ModalRoute.of(context).settings.arguments as String;
      final loadedCompany = Provider.of&lt;Companies&gt;(context, listen: false)
          .findByTicker(companyTicker);
  
      return Container(
        color: Colors.black87,
        child: Column(
          children: &lt;Widget&gt;[
            Container(
              height: 300,
              width: double.infinity,
              color: Colors.white,
              padding: EdgeInsets.all(10),
              child: SingleChildScrollView(
                padding: EdgeInsets.only(left: 15),
                scrollDirection: Axis.vertical,
                child: FutureBuilder&lt;StockInformation&gt;(
                  future: _companyDescription,
                  builder: (BuildContext context,
                      AsyncSnapshot&lt;StockInformation&gt; snapshot) {
                    if (snapshot.data != null) {
                      return Text(snapshot.data.assetProfile.longBusinessSummary);
                    }
                    return Container(
                      height: 300,
                      child: Center(
                        child: CircularProgressIndicator(),
                      ),
                    );
                  },
                ),
              ),
            ),
            Container(
              height: 75,
              width: double.infinity,
              child: Center(
                child: FutureBuilder(
                  future: _urlForUrlLauncher,
                  builder: (BuildContext context, AsyncSnapshot snapshot) {
                    if (snapshot.data[0]['finalLink'] != null) {
                      String url10K = snapshot.data[0]['finalLink'];
                      return RaisedButton(
                        shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(10),
                          side: BorderSide(
                            color: Colors.grey,
                            width: 1,
                          ),
                        ),
                        onPressed: () async {
                          var url = url10K;
                          if (await canLaunch(url)) {
                            await launch(url);
                          } else {
                            throw 'Could not launch $url';
                          }
                        },
                        child: Text(
                          'Go to company\'s filings',
                          style: TextStyle(
                            color: Colors.white,
                          ),
                        ),
                      );
                    } else {
                      return RaisedButton(
                        shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(10),
                          side: BorderSide(
                            color: Colors.grey,
                            width: 1,
                          ),
                        ),
                        onPressed: null,
                        child: Text(
                          'Go to company\'s filings',
                          style: TextStyle(color: Colors.white,),
                        ),
                      );
                    }
                  },
                ),
              ),
            )
          ],
        ),
      );
    }
  }
  </code></pre>
  <p>Thanks in advance for any and all help with this issue!</p>