flutter-share icon indicating copy to clipboard operation
flutter-share copied to clipboard

Asset file couldn't attach.

Open shariful2011 opened this issue 6 years ago • 1 comments

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);

screenshot

shariful2011 avatar Jan 22 '19 14:01 shariful2011

Getting the same error using temporary directory as well. File will not attach.

KaYBlitZ avatar May 27 '19 01:05 KaYBlitZ