KatbookEpubReader class

The main EPUB reader widget.

Inheritance

Constructors

KatbookEpubReader({Key? key, required KatbookEpubController controller, ReaderTheme initialTheme = ReaderTheme.light, double initialFontSize = 16.0, ReadingMode initialReadingMode = ReadingMode.page, bool showAppBar = true, PreferredSizeWidget appBarBuilder(BuildContext context, KatbookEpubReaderState state)?, void onPositionChanged(ReadingPosition position)?, void onChapterChanged(ChapterNode chapter)?, void onProgressChanged(double progress)?, void onReadingModeChanged(ReadingMode mode)?, Widget loadingBuilder(BuildContext context)?, Widget errorBuilder(BuildContext context, Object error)?, Widget tocBuilder(BuildContext context, List<ChapterNode> chapters, void onTap(ChapterNode))?, Widget chapterHeaderBuilder(BuildContext context, ChapterNode chapter)?, Widget paragraphBuilder(BuildContext context, ParagraphElement paragraph, ReaderThemeData theme, double fontSize)?, Widget imageErrorBuilder(BuildContext context, Object error, StackTrace? stackTrace)?, EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), ScrollPhysics? scrollPhysics, ReadingPosition? initialPosition, double contentWidthPercent = 0.65, Locale? locale, void onLocaleChanged(Locale locale)?, bool showLanguageButton = true, bool showThemeButton = true})
Creates a new EPUB reader widget.
const

Properties

appBarBuilder → PreferredSizeWidget Function(BuildContext context, KatbookEpubReaderState state)?
Builder for a custom app bar.
final
chapterHeaderBuilder → Widget Function(BuildContext context, ChapterNode chapter)?
Builder for chapter headers.
final
contentWidthPercent → double
Width of the content area as a percentage of screen width (0.0 to 1.0). Content will be centered. Defaults to 0.65 (65% of screen width).
final
controller → KatbookEpubController
The controller that manages the EPUB book.
final
errorBuilder → Widget Function(BuildContext context, Object error)?
Builder for error display.
final
hashCode → int
The hash code for this object.
no setterinherited
imageErrorBuilder → Widget Function(BuildContext context, Object error, StackTrace? stackTrace)?
Builder for image loading errors.
final
initialFontSize → double
The initial font size.
final
initialPosition → ReadingPosition?
Initial reading position to restore.
final
initialReadingMode → ReadingMode
The initial reading mode (scroll or page).
final
initialTheme → ReaderTheme
The initial theme to use.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingBuilder → Widget Function(BuildContext context)?
Builder for the loading indicator.
final
locale → Locale?
The locale to use for localization. If null, uses the system locale.
final
onChapterChanged → void Function(ChapterNode chapter)?
Called when the current chapter changes.
final
onLocaleChanged → void Function(Locale locale)?
Called when the locale changes.
final
onPositionChanged → void Function(ReadingPosition position)?
Called when the reading position changes.
final
onProgressChanged → void Function(double progress)?
Called when the progress percentage changes.
final
onReadingModeChanged → void Function(ReadingMode mode)?
Called when the reading mode changes.
final
padding → EdgeInsets
Padding around each paragraph.
final
paragraphBuilder → Widget Function(BuildContext context, ParagraphElement paragraph, ReaderThemeData theme, double fontSize)?
Builder for paragraph content.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scrollPhysics → ScrollPhysics?
Scroll physics for the content.
final
showAppBar → bool
Whether to show the built-in app bar.
final
showLanguageButton → bool
Whether to show the language selector button in the app bar.
final
showThemeButton → bool
Whether to show the theme selector button in the app bar.
final
tocBuilder → Widget Function(BuildContext context, List<ChapterNode> chapters, void onTap(ChapterNode))?
Builder for custom table of contents.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<KatbookEpubReader>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited