flutter-share
flutter-share copied to clipboard
Asset file couldn't attach.
I am trying to share an assets file but the file is not attaching, please see the attached image. This is what I did for making a copy of asset's file in temp path:
Directory tempDir = await getTemporaryDirectory();
String tempPath = tempDir.path;
//fileName = assets folder's filename
String filePath = join(tempPath, fileName);
ByteData data = await rootBundle.load(join(assetPath, fileName));
List<int> bytes =
data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
await File(filePath).writeAsBytes(bytes);
Getting the same error using temporary directory as well. File will not attach.