Closed uni-united closed 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
@uni-united could you format your sample code?
and let me know if you put permissions
permissions
Solved by updating the dependency to the latest version. Thanks
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