shareFile method
Future<void>
shareFile(
{ - required String path,
- required String packageName,
- String title = "分享",
- void whenNotFoundApp()?,
})
override
Implementation
@override
Future<void> shareFile({
required String path,
required String packageName,
String title = "分享",
void Function()? whenNotFoundApp,
}) async {
try {
await methodChannel.invokeMethod('shareFile', {
'path': path,
'packageName': packageName,
'title': title,
});
} on PlatformException catch (e) {
if (e.code == 'UNAVAILABLE') whenNotFoundApp?.call();
}
}