搜索插件、代码仓与 APP 分类

插件详情v3.0.0

vocsy_epub_viewer

vocsy_epub_viewer 是一个封装了 folioreader 框架的 epub 电子书阅读器。

AndroidiOS
近 30 天下载
86
喜欢数
98
Pub 分数
140

安装插件

flutter pub add vocsy_epub_viewer

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

vocsy_epub_viewer 是一个 Flutter 包,通过封装 folioreader 框架提供 EPUB 电子书阅读器。它可在 Android 和 iOS 平台上实现 Flutter 应用中 EPUB 文件的无缝阅读。该包提供简洁且可自定义的界面,支持翻页、文本选择和书签等功能,方便用户在电子书中导航。专为希望在其应用中集成 EPUB 支持的开发者设计,无需深入了解底层库即可简化 EPUB 内容的处理流程。

适合场景

  • 在Flutter应用中阅读EPUB书籍
  • 集成数字图书馆功能
  • 构建教育或电子学习应用程序
  • 创建自定义电子书阅读器
  • 嵌入式交互式教科书

主要特点

  • 基于 folioreader 框架构建
  • 支持 Android 和 iOS
  • 可自定义的 UI 组件
  • 页面导航和文本选择
  • 书签和注释支持

适合对象

  • 教育类应用开发者
  • 数字出版平台
  • 电子书应用开发者
  • 移动学习工具
  • 内容丰富的Flutter应用

使用建议

  • 仅限 EPUB 格式
  • 依赖于 folioreader 的稳定性
  • 可能需要额外的样式以保持 UI 一致性
  • 无内置搜索功能
  • 需要手动处理 EPUB 的文件路径

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Vocsy Epub Viewer pub package

originally a fork of epub_kitty with few more features. i made this out of epub_kitty because the author was inactive(he isn't merging PRs or attending to issues) and i started having alot of issues with the plugin

vocsy_epub_viewer is an epub ebook reader that encapsulates the folioreader framework. It supports iOS and android.

Features

Name Android iOS
Reading Time Left / Pages left ✅ ✅
Last Read Locator ✅ ✅
Distraction Free Reading ✅ ❌
Load E-Pub from Asset ✅ ✅
Copy and Share Text ✅ ✅
Highlight Text ✅ ✅
Multiple Theme [Light / Dark] ✅ ❌
Support Multiple Device Language ✅ ✅
Change FontStyle ✅ ❌
Android 13 Supported ✅ ❌

ScreenShots

  • Light                  

  • Dark

              

Install

This plugin requires Swift to work on iOS. Also, the minimum deployment target is 9.0

platform :ios, '9.0'

Import into pubspec.yaml

dependencies:
  vocsy_epub_viewer: latest_version

NOTE Please add this to the release build type in your app build.gradle to avoid crashes on android release builds

minifyEnabled false
shrinkResources false

NOTE Add These Lines In manifest

  
  • 1
    <uses-permission android:name="android.permission.INTERNET" />
  • 2
   xmlns:tools="http://schemas.android.com/tools"
  • 3
   android:usesCleartextTraffic="true"
   android:requestLegacyExternalStorage="true"
   android:networkSecurityConfig="@xml/network_security_config"
  • 4
   android:exported="true"

NOTE android -> app -> src -> main -> res -> xml Inside xml Folder create xml file network_security_config.xml

Usage

VocsyEpub.setConfig(
           themeColor: Theme.of(context).primaryColor,
           identifier: "iosBook",
           scrollDirection: EpubScrollDirection.ALLDIRECTIONS,
           allowSharing: true,
           enableTts: true,
           nightMode: true,
       );

/**
 * @bookPath
 * @lastLocation (optional and only android)
 */
VocsyEpub.open(
          'bookPath',
           lastLocation: EpubLocator.fromJson({
	   "bookId": "2239",
	   "href": "/OEBPS/ch06.xhtml",
	   "created": 1539934158390,
	   "locations": {
		"cfi": "epubcfi(/0!/4/4[simple_book]/2/2/6)"
	          }
	    }), // first page will open up if the value is null
        );

// Get locator which you can save in your database

VocsyEpub.locatorStream.listen((locator) {
	print('LOCATOR: ${EpubLocator.fromJson(jsonDecode(locator))}');
	// convert locator from string to json and save to your database to be retrieved later
});

You can also load epub from your assets using EpubViewer.openAsset()

await VocsyEpub.openAsset('assets/3.epub',
lastLocation: EpubLocator.fromJson({
	"bookId": "2239",
	"href": "/OEBPS/ch06.xhtml",
	"created": 1539934158390,
	"locations": {
	"cfi": "epubcfi(/0!/4/4[simple_book]/2/2/6)"
	  }
	}), // first page will open up if the value is null
   );

// Get locator which you can save in your database

VocsyEpub.locatorStream.listen((locator) {
	print('LOCATOR: ${EpubLocator.fromJson(jsonDecode(locator))}');
	// convert locator from string to json and save to your database to be retrieved later
});

Check the Example for implementation

Issues

If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on Github and I'll look into it. Pull request are also welcome.

For help getting started with Flutter, view the online documentation.

For help on editing plugin code, view the documentation.

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目