I am using PDFView plugin to read pdf but whenever I pass the url to it,the pdf doesnot load. I did not receive any of the error but pdf does not open. I am getting the pdf url from the firebase storage.
class FilePage extends StatefulWidget {
FilePage({required this.file, this.isImage = false});
final FirebaseFile file;
final isImage;
_FilePageState createState() => _FilePageState();
}
class _FilePageState extends State<FilePage> {
@override
void initState() {
super.initState();
}
bool _isLoading = true;
@override
Widget build(BuildContext context) {
//initState(){
return WillPopScope(
onWillPop: () async => true,
child: Scaffold(
appBar: AppBar(
backgroundColor: Colors.indigo[900],
title: Text(widget.file.name
.split('.')
.first),
centerTitle: true,
),
body: _isLoading? const
Center( child: CircularProgressIndicator() )
:
PDFView(
filePath: widget.file.url,
preventLinkNavigation: false,
)
),
);
}
}
Are you setting this variable to false after its loaded?