shareFile function

Future<void> shareFile({
  1. required String url,
  2. String? savePath,
})

Implementation

Future<void> shareFile({required String url, String? savePath}) async {
  final path = await downloadFile(url: url, savePath: savePath);

  if (path != null) {
    Share.shareXFiles([XFile(path)]);
  }
}