epub_viewer 0.2.5 copy "epub_viewer: ^0.2.5" to clipboard
epub_viewer: ^0.2.5 copied to clipboard

discontinued
PlatformAndroidiOS

epub_viewer is an epub ebook reader that encapsulates the folioreader framework.

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

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 ePub from Asset

ScreenShots #

                 

Install #

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

platform :ios, '9.0'
copied to clipboard

Import into pubspec.yaml

dependencies:
  epub_viewer: latest_version
copied to clipboard

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
copied to clipboard

Usage #

EpubViewer.setConfig(
  themeColor: Theme.of(context).primaryColor,
  identifier: "iosBook",
  scrollDirection: EpubScrollDirection.VERTICAL,
  allowSharing: true,
  enableTts: true,
)

/**
* @bookPath
* @lastLocation (optional and only android)
*/
EpubViewer.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
EpubViewer.locatorStream.listen((locator) {
   print('LOCATOR: ${EpubLocator.fromJson(jsonDecode(locator))}');
   // convert locator from string to json and save to your database to be retrieved later
});
copied to clipboard

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

await EpubViewer.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
EpubViewer.locatorStream.listen((locator) {
   print('LOCATOR: ${EpubLocator.fromJson(jsonDecode(locator))}');
   // convert locator from string to json and save to your database to be retrieved later
});
copied to clipboard

Check the Sample project or this ebook app 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.

120
likes
150
points
187
downloads

Publisher

verified publisherjideguru.dev

Weekly Downloads

2024.09.19 - 2025.04.03

epub_viewer is an epub ebook reader that encapsulates the folioreader framework.

Repository (GitHub)

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, path, path_provider

More

Packages that depend on epub_viewer