We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello. May i give path like that ? or how can i give ?
like that is not working
PDFView( ----> filePath: 'assets/poladqara.pdf', <---- enableSwipe: true, swipeHorizontal: true, autoSpacing: true, pageFling: true, pageSnap: true, defaultPage: currentPage, fitPolicy: FitPolicy.BOTH,
The text was updated successfully, but these errors were encountered:
@override void initState() { super.initState(); fromAsset('pdf_asset/poladwhite.pdf', 'poladwhite.pdf').then((f) { setState(() { whitepathPDF = f.path; }); }); fromAsset('pdf_asset/poladblack.pdf', 'poladblack.pdf').then((f) { setState(() { blackpathPDF = f.path; }); }); } Future<File> fromAsset(String asset, String filename) async { // To open from assets, you can copy them to the app storage folder, and the access them "locally" Completer<File> completer = Completer(); try { var dir = await getApplicationDocumentsDirectory(); File file = File("${dir.path}/$filename"); var data = await rootBundle.load(asset); var bytes = data.buffer.asUint8List(); await file.writeAsBytes(bytes, flush: true); completer.complete(file); } catch (e) { throw Exception('Error parsing asset file!'); } return completer.future; }
Sorry, something went wrong.
No branches or pull requests
Hello. May i give path like that ? or how can i give ?
like that is not working
The text was updated successfully, but these errors were encountered: