Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tirth-aubergine
Last active December 6, 2019 07:21
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/60c6847bdd3e2c1dbc1b48b419251114 to your computer and use it in GitHub Desktop.
Save tirth-aubergine/60c6847bdd3e2c1dbc1b48b419251114 to your computer and use it in GitHub Desktop.
ResultScreen - Download
FlatButton(
onPressed: () {
pdfGenerator(name);
Scaffold.of(context).showSnackBar(
SnackBar(
content: Text('$name.pdf downloaded'),
action: SnackBarAction(
label: 'View',
onPressed: () async {
String downloadPath =
await getApplicationDocumentsDirectoryPath();
Navigator.pushNamed(context, '/viewer',
arguments: {
'view': '$downloadPath/$name.pdf'
});
},
),
),
);
},
child: Icon(Icons.file_download),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment