将资产复制到一个临时文件。
Future<File> copyAsset() async { Directory tempDir = await getTemporaryDirectory(); String tempPath = tempDir.path; File tempFile = File('$tempPath/copy.pdf'); ByteData bd = await rootBundle.load('assets/asset.pdf'); await tempFile.writeAsBytes(bd.buffer.asUint8List(), flush: true); return tempFile; }


