|
@@ -144,7 +144,7 @@ import 'package:compdfkit_flutter/cpdf_configuration.dart';
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
-const String DOCUMENT_PATH = 'pdfs/PDF_Document.pdf';
|
|
|
+const String _documentPath = 'pdfs/PDF_Document.pdf';
|
|
|
|
|
|
void main() {
|
|
|
runApp(const MyApp());
|
|
@@ -191,13 +191,13 @@ class _MyAppState extends State<MyApp> {
|
|
|
}
|
|
|
|
|
|
void showDocument(BuildContext context) async {
|
|
|
- final bytes = await DefaultAssetBundle.of(context).load(DOCUMENT_PATH);
|
|
|
+ final bytes = await DefaultAssetBundle.of(context).load(_documentPath);
|
|
|
final list = bytes.buffer.asUint8List();
|
|
|
final tempDir = await ComPDFKit.getTemporaryDirectory();
|
|
|
var pdfsDir = Directory('${tempDir.path}/pdfs');
|
|
|
pdfsDir.createSync(recursive: true);
|
|
|
|
|
|
- final tempDocumentPath = '${tempDir.path}/$DOCUMENT_PATH';
|
|
|
+ final tempDocumentPath = '${tempDir.path}/$_documentPath';
|
|
|
final file = File(tempDocumentPath);
|
|
|
if (!file.existsSync()) {
|
|
|
file.create(recursive: true);
|
|
@@ -332,7 +332,7 @@ import 'package:compdfkit_flutter/cpdf_configuration.dart';
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
-const String DOCUMENT_PATH = 'pdfs/PDF_Document.pdf';
|
|
|
+const String _documentPath = 'pdfs/PDF_Document.pdf';
|
|
|
|
|
|
void main() {
|
|
|
runApp(const MyApp());
|
|
@@ -379,13 +379,13 @@ class _MyAppState extends State<MyApp> {
|
|
|
}
|
|
|
|
|
|
void showDocument(BuildContext context) async {
|
|
|
- final bytes = await DefaultAssetBundle.of(context).load(DOCUMENT_PATH);
|
|
|
+ final bytes = await DefaultAssetBundle.of(context).load(_documentPath);
|
|
|
final list = bytes.buffer.asUint8List();
|
|
|
final tempDir = await ComPDFKit.getTemporaryDirectory();
|
|
|
var pdfsDir = Directory('${tempDir.path}/pdfs');
|
|
|
pdfsDir.createSync(recursive: true);
|
|
|
|
|
|
- final tempDocumentPath = '${tempDir.path}/$DOCUMENT_PATH';
|
|
|
+ final tempDocumentPath = '${tempDir.path}/$_documentPath';
|
|
|
final file = File(tempDocumentPath);
|
|
|
if (!file.existsSync()) {
|
|
|
file.create(recursive: true);
|