Search code snippets, questions, articles...

Launcher

import 'package:url_launcher/url_launcher.dart';

void _showUrl() {
  _launch('http://www.nandiraju.com');
}

void _showEmail() {
  _launch('mailto:[email protected]');
}

void _showTelephone() {
  _launch('tel:999-999-9999');
}

void _showSms() {
  _launch('sms:999-999-9999');
}

void _launch(String urlString) async {
  if(await canLaunch(urlString)) {
    await launch(urlString);
  } else {
    throw 'Could not launch Url';
  }
}
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place.
Was this helpful?
0 Comments