email static method

Future<UComposeResult> email({
  1. List<String> to = const <String>[],
  2. List<String> cc = const <String>[],
  3. List<String> bcc = const <String>[],
  4. String? subject,
  5. String? body,
  6. bool isHtml = false,
  7. List<String> attachments = const <String>[],
})

Implementation

static Future<UComposeResult> email({
  List<String> to = const <String>[],
  List<String> cc = const <String>[],
  List<String> bcc = const <String>[],
  String? subject,
  String? body,
  bool isHtml = false,
  List<String> attachments = const <String>[],
}) async {
  final Uri mailto = Uri(
    scheme: "mailto",
    path: to.join(","),
    query: _query(<String, String?>{"cc": cc.isEmpty ? null : cc.join(","), "bcc": bcc.isEmpty ? null : bcc.join(","), "subject": subject, "body": body}),
  );
  if (kIsWeb) return await ULaunchWeb.open(mailto.toString(), "_self") ? UComposeResult.opened : UComposeResult.unavailable;
  final String? result = await _call<String>("email", <String, Object?>{
    "to": to,
    "cc": cc,
    "bcc": bcc,
    "subject": subject,
    "body": body,
    "html": isHtml,
    "attachments": attachments,
    "mailto": mailto.toString(),
  });
  return _compose(result);
}