nc-photos/app/lib/mobile/android/share.dart
Ming Ming d5de52a789 Support ATTACH_DATA intent on android
This is typically used to set wallpaper or contact photos
2023-08-04 01:24:25 +08:00

24 lines
760 B
Dart

import 'package:flutter/services.dart';
class Share {
static Future<void> shareItems(
List<String> fileUris, List<String?> mimeTypes) =>
_channel.invokeMethod("shareItems", <String, dynamic>{
"fileUris": fileUris,
"mimeTypes": mimeTypes,
});
static Future<void> shareText(String text, String? mimeType) =>
_channel.invokeMethod("shareText", <String, dynamic>{
"text": text,
"mimeType": mimeType,
});
static Future<void> shareAsAttachData(String fileUri, String? mimeType) =>
_channel.invokeMethod("shareAsAttachData", <String, dynamic>{
"fileUri": fileUri,
"mimeType": mimeType,
});
static const _channel = MethodChannel("com.nkming.nc_photos/share");
}