2021-07-10 17:06:04 +02:00
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
|
|
|
class Share {
|
|
|
|
static Future<void> shareItems(
|
2021-07-23 22:05:57 +02:00
|
|
|
List<String> fileUris, List<String?> mimeTypes) =>
|
2021-07-10 17:06:04 +02:00
|
|
|
_channel.invokeMethod("shareItems", <String, dynamic>{
|
|
|
|
"fileUris": fileUris,
|
|
|
|
"mimeTypes": mimeTypes,
|
|
|
|
});
|
|
|
|
|
2023-08-03 19:23:33 +02:00
|
|
|
static Future<void> shareText(String text, String? mimeType) =>
|
2021-09-28 08:36:00 +02:00
|
|
|
_channel.invokeMethod("shareText", <String, dynamic>{
|
|
|
|
"text": text,
|
|
|
|
"mimeType": mimeType,
|
|
|
|
});
|
|
|
|
|
2023-08-03 19:23:33 +02:00
|
|
|
static Future<void> shareAsAttachData(String fileUri, String? mimeType) =>
|
|
|
|
_channel.invokeMethod("shareAsAttachData", <String, dynamic>{
|
|
|
|
"fileUri": fileUri,
|
|
|
|
"mimeType": mimeType,
|
|
|
|
});
|
|
|
|
|
2021-09-15 08:58:06 +02:00
|
|
|
static const _channel = MethodChannel("com.nkming.nc_photos/share");
|
2021-07-10 17:06:04 +02:00
|
|
|
}
|