如何解决当使用 Flutter epub_viewer 打开 EPUB 文件时.... EpubViewer.locatorStream.listen() 不起作用
当使用 Flutter epub_viewer 打开 EPUB 文件时.... EpubViewer.locatorStream.listen() 不起作用只是想将此数据保存到 SharedPreferences 然后获取...
或者我该怎么办?
代码:
openEpuB() async {
//var data = {
//"bookId": "urn:uuid:d348699e-9011-4f87-901a-69754701bf83",//"href": "/OEBPS/Text/content_1.xhtml",//"created": 1608833000320,//"locations": {"cfi": "epubcfi(/0!/4/724/7:0)"},//"title": ""
//};
if (true) {
EpubViewer.setConfig(
identifier: 'androidBook',scrollDirection: EpubScrollDirection.VERTICAL,enableTts: false,allowSharing: true,);
EpubViewer.openAsset('assets/4.epub',// lastLocation: data.isNotEmpty ? EpubLocator.fromJson(data) : null
);
EpubViewer.locatorStream.listen(
(event) async {
print('WORk!!!!');
// Get locator here
saveDB(event);
},);
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。