launchSms method

Future<bool> launchSms({
  1. String? body,
})

Implementation

Future<bool> launchSms({String? body}) async {
  if (this == null || this!.isEmpty) return false;
  final phone = this!.replaceAll(RegExp(r'[^0-9+]'), '');
  final uri = body != null
      ? 'sms:$phone?body=${Uri.encodeComponent(body)}'
      : 'sms:$phone';
  return _safeLaunch(uri, mode: LaunchMode.platformDefault);
}