launchEmail static method

dynamic launchEmail(
  1. dynamic email, {
  2. LaunchMode mode = LaunchMode.platformDefault,
})

Launch email app with given email.

Implementation

static launchEmail(email,
    {LaunchMode mode = LaunchMode.platformDefault}) async {
  if (await canLaunchUrlString("mailto:$email")) {
    await launchUrlString(
      "mailto:$email",
      mode: mode,
    );
  } else {
    showErrorNotice("Error", "Could not launch the $email email");
    throw 'Could not launch';
  }
}