extractAsset static method
Implementation
static Future<File> extractAsset(String assetPath,
{bool shouldOverwrite = false, String prefix = ''}) async {
final bytes = await rootBundle.load(assetPath);
final list = bytes.buffer.asUint8List();
final tempDir = await ComPDFKit.getTemporaryDirectory();
final tempDocumentPath = '${tempDir.path}/$prefix$assetPath';
final file = File(tempDocumentPath);
if (shouldOverwrite || !file.existsSync()) {
await file.create(recursive: true);
file.writeAsBytesSync(list);
}
return file;
}