Katbook EPUB Reader
A powerful, customizable EPUB reader widget for Flutter with proper hierarchical chapter support, theme customization, reading progress tracking, and robust image handling.
Features
- π Full EPUB Support - Proper parsing of EPUB 2 and EPUB 3 formats
- π Hierarchical Table of Contents - Support for nested chapters at any depth
- π¨ Built-in Themes - Light, Sepia, and Dark themes out of the box
- π€ Customizable Typography - Adjustable font size with slider control
- π Reading Progress - Precise position tracking and percentage progress
- πΎ Position Save/Restore - Resume reading from where you left off
- πΌοΈ Image Handling - Robust extraction and display of embedded images
- π Responsive Layout - Configurable content width (percentage-based)
- π― CSS Support - Parses EPUB stylesheets for proper text alignment and styling
- π Front Matter Support - Displays cover, dedication, and other pre-chapter content
Installation
Add katbook_epub_reader to your pubspec.yaml:
dependencies:
katbook_epub_reader: ^1.0.0
Or run this command in your terminal:
flutter pub add katbook_epub_reader
Then import it in your Dart code:
import 'package:katbook_epub_reader/katbook_epub_reader.dart';
Dependencies
- epubx ^4.0.0 - EPUB parsing
- html ^0.15.6 - HTML DOM parsing
- scrollable_positioned_list ^0.3.8 - Efficient list scrolling
- collection ^1.19.1 - Collection utilities
Example App
See the example/ directory for a complete, runnable example application.
Comparison with epub_view
| Feature | katbook_epub_reader | epub_view |
|---|---|---|
| Hierarchical TOC | β Any depth | β Flat only |
| CSS Parsing | β Full support | β Limited |
| Front Matter | β Supported | β No |
| Theme System | β 3 built-in | β Basic |
| Font Size Slider | β Built-in | β Manual |
| Position Save/Restore | β Full | β οΈ Limited |
| Content Width Control | β Percentage-based | β No |
| Image Handling | β Robust | β οΈ Basic |
License
MIT License - see LICENSE file for details.
Contributing
Contributions are welcome! Please read our contributing guidelines and submit pull requests to the repository.