Katbook EPUB Reader

pub package License: MIT

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.