binSaed / flutter_cached_pdfview

Enhanced PDF view for Flutter.
https://pub.dev/packages/flutter_cached_pdfview
MIT License
121 stars 70 forks source link

PDF().fromPath('/path'), not showing the PDF #33

Closed uni-united closed 3 years ago

uni-united commented 3 years ago

fromPath is not working Please provide a example to load PDF fromPath as its not working for me

My Code is as below: import 'package:flutter/material.dart'; import 'package:flutter_cached_pdfview/flutter_cached_pdfview.dart';

class PDFScreen extends StatelessWidget { // static const String routeName = '/pdf_screen'; // final String path; // PDFScreen({@required this.path}); @override Widget build(BuildContext context) { final arguments = ModalRoute.of(context).settings.arguments; print(arguments); return Scaffold( appBar: AppBar( title: Text('PDF1'), ), body: PDF().fromPath( '/storage/emulated/0/Android/data/com.example.book_test/files/books/Book1.pdf'), ); } }

The above code should display the PDF but its is not Please help me with the issue

pishguy commented 3 years ago

@uni-united could you format your sample code?

and let me know if you put permissions

uni-united commented 3 years ago

Solved by updating the dependency to the latest version. Thanks