share function
Share text
and files
with external applications.
You can specify the subject by entering title
.
Implementation
Future<void> share({
String? text,
String? title,
List<String> files = const [],
}) async {
if (files.isNotEmpty) {
await Share.shareFiles(files, subject: title, text: text);
} else {
assert(text.isNotEmpty, "Text is empty.");
await Share.share(text ?? "", subject: title);
}
}