Created
December 6, 2019 08:40
-
-
Save tirth-aubergine/5e76e87addf0a8c9b441f6cc8154add4 to your computer and use it in GitHub Desktop.
HomeScreen - Share FAB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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