title: Flutter: Display Error to User
body: <p>I have a url_launcher that opens up an Email app a an onTap listener and would like to show an error if there is no email app installed on the device ? How can this be achieved using the Flutter framework ?</p>
  
  <p>The _launchcaller() throws an exception when an email app does not exist, but I would like the error message (custom message) to be displayed to the user so they know what is going to on ?</p>
  
  <pre><code>@override
    Widget build(BuildContext context) {
      return Scaffold(
          appBar: AppBar(
            title: Text("Thank you"),
          ),
          body: new ListView(children: &lt;Widget&gt;[
            new Column(
              children: &lt;Widget&gt;[
                new Padding(
                  padding: new EdgeInsets.all(20.0),
                  child: new AnimatedBuilder(
                    animation: animationController,
                    child: new Container(
                      height: 150.0,
                      width: 150.0,
                      child: new Image.asset('assets/angry_face.png'),
                    ),
                    builder: (BuildContext context, Widget _widget) {
                      return new Transform.rotate(
                        angle: animationController.value * 6.3,
                        child: _widget,
                      );
                    },
                  ),
                ),
                new Column(
                  children: &lt;Widget&gt;[
                    new Text(
                      'We are sorry for the inconvenience...',
                      style: new TextStyle(
                          fontSize: 16.0,
                          fontWeight: FontWeight.w700,
                          color: Colors.black87),
                    ),
                    new Padding(
                        padding: new EdgeInsets.symmetric(
                            vertical: 5.0, horizontal: 0.0)),
                    new Text(
                      'Please contact us to resolve this issue!',
                      style: new TextStyle(
                          fontSize: 13.0,
                          fontWeight: FontWeight.w200,
                          color: Colors.black87),
                    ),
                  ],
                ),
                new Padding(
                  padding:
                      new EdgeInsets.symmetric(vertical: 25.0, horizontal: 0.0),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: &lt;Widget&gt;[
                      new GestureDetector(
                        onTap: _launchcaller,
                        child: new Icon(
                          Icons.contact_phone,
                          color: Colors.green,
                          size: 45.0,
                        ),
                      ),
                      new GestureDetector(
                        onTap: _launchcaller,
                        child: new Icon(
                          Icons.email,
                          color: Colors.blue,
                          size: 50.0,
                        ),
                      ),
                    ],
                  ),
                ),
              ],
            ),
          ]));
    }
  
    _launchcaller() async {
      const url = 'mailto:enissl21@gmail.com?subject=subject&amp;body=body';
  
      if (await canLaunch(url)) {
        await launch(url);
      } else {
        throw 'Could not launch $url';
      }
    }
  }
  </code></pre>