This pub lets you share any kind of files (csv, mp4, png etc), take screenshot of the widgets you want and return as Image and share them directly as well in the form of an image.
I was happy to see the csv share option, but there is no example for it in the docs. What is the file type? How to export it?
ShareFilesAndScreenshotWidgets().shareFile( "Title", "Name.csv", list, "text/csv", text: "This is the caption!");
Thanks!
This is the code i'm trying to get to work:
final directory = await getApplicationDocumentsDirectory();
File f = File('${directory.path}/mycsv.csv');
String csv = const ListToCsvConverter().convert(data);
await f.writeAsString(csv);
var file_as_bytes = await f.readAsBytes();
Uint8List list = file_as_bytes.buffer.asUint8List();
ShareFilesAndScreenshotWidgets().shareFile(
"Title", "Name.csv", list, "text/csv",
text: "This is the caption!");
I was happy to see the csv share option, but there is no example for it in the docs. What is the file type? How to export it?
ShareFilesAndScreenshotWidgets().shareFile( "Title", "Name.csv", list, "text/csv", text: "This is the caption!");
Thanks!
This is the code i'm trying to get to work: