搜尋套件、儲存庫與 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 項

原始碼儲存庫

使用此套件的專案