launchMessage static method
dynamic
launchMessage(})
Launch Message app with the given message.
Implementation
static launchMessage(String telephoneNumber,
{String? message, LaunchMode mode = LaunchMode.platformDefault}) async {
String telephoneUrl = "sms:$telephoneNumber?body=$message";
if (await canLaunchUrlString(telephoneUrl)) {
await launchUrlString(
telephoneUrl,
mode: mode,
);
} else {
showErrorNotice("Error", "Could not launch the $telephoneNumber number");
throw "Can't message that number.";
}
}