Last active
January 10, 2020 22:18
-
-
Save Classy-Bear/9f912f60195730e0f437f52fd6e42c91 to your computer and use it in GitHub Desktop.
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
@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