Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset file couldn't attach. #19

Open
shariful2011 opened this issue Jan 22, 2019 · 1 comment
Open

Asset file couldn't attach. #19

shariful2011 opened this issue Jan 22, 2019 · 1 comment

Comments

@shariful2011
Copy link

shariful2011 commented Jan 22, 2019

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

@KaYBlitZ
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants