Skip to content

Instantly share code, notes, and snippets.

@tirth-aubergine
Created December 6, 2019 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tirth-aubergine/5e76e87addf0a8c9b441f6cc8154add4 to your computer and use it in GitHub Desktop.
Save tirth-aubergine/5e76e87addf0a8c9b441f6cc8154add4 to your computer and use it in GitHub Desktop.
HomeScreen - Share FAB
FloatingActionButton(
heroTag: 'Share',
onPressed: () async {
final names = homeProvider
.xlsxFileTables[homeProvider.xlsxFileSelectedTable]
.rows
.map((name) => name
.toString()
.substring(1, name.toString().length - 1));
names.forEach((name) => pdfGenerator(name));
final String downloadPath =
await getApplicationDocumentsDirectoryPath();
final files = names
.map((name) => File('$downloadPath/$name.pdf').path);
await ShareExtend.shareMultiple([
...files,
], 'file');
},
child: Icon(Icons.share),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment