Skip to content

Instantly share code, notes, and snippets.

@Classy-Bear
Last active January 10, 2020 22:18
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 Classy-Bear/9f912f60195730e0f437f52fd6e42c91 to your computer and use it in GitHub Desktop.
Save Classy-Bear/9f912f60195730e0f437f52fd6e42c91 to your computer and use it in GitHub Desktop.
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text("Abrir pdf"),
),
body: Center(
child: Builder(
builder: (context) => Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
color: Colors.amber,
child: Text("Abrir desde la URL"),
onPressed: () {
if (urlPDFPath != null) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
PdfViewPage(path: urlPDFPath)));
}
},
),
SizedBox(
height: 20,
),
RaisedButton(
color: Colors.cyan,
child: Text("Abrir desde la carpeta"),
onPressed: () {
if (assetPDFPath != null) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
PdfViewPage(path: assetPDFPath)));
}
},
)
],
),
),
),
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment