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

Uint8List attachments #226

Closed
biancashouse opened this issue Dec 20, 2022 · 5 comments
Closed

Uint8List attachments #226

biancashouse opened this issue Dec 20, 2022 · 5 comments

Comments

@biancashouse
Copy link

I generate pdfs dynamically, and they are Uint8List.
I can't figure out if it is possible to send them (base64encoded?) to the sendinblue api.
Any guidance would be appreciated.
You send files as attachments, so I guess it must be possible ?
Thanks in advance

@close2
Copy link
Collaborator

close2 commented Dec 20, 2022

There is a StreamAttachment class:

I haven't programmed in dart for quite some time. Can you convert the Uint8List to a Stream<List<int>>?

class StreamAttachment extends Attachment {
  final Stream<List<int>> _stream;

  StreamAttachment(this._stream, String contentType, {String? fileName}) {
    this.contentType = contentType;
    this.fileName = fileName;
  }

  @override
  Stream<List<int>> asStream() => _stream;
}

@close2
Copy link
Collaborator

close2 commented Dec 29, 2022

Please reopen, if this doesn't solve your problem.

@close2 close2 closed this as completed Dec 29, 2022
@biancashouse
Copy link
Author

biancashouse commented Jan 3, 2023 via email

@close2
Copy link
Collaborator

close2 commented Jan 4, 2023

This library doesn't work in flutter web. It's technically just not possible.

Is there a way to mark the library unsuitable for flutter web?

@biancashouse
Copy link
Author

biancashouse commented Jan 4, 2023 via email

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