EpubViewer class

Inheritance

Constructors

EpubViewer({Key? key, required EpubController epubController, required EpubSource epubSource, String? initialCfi, String? initialXPath, ValueChanged<List<EpubChapter>>? onChaptersLoaded, VoidCallback? onEpubLoaded, VoidCallback? onLocationLoaded, ValueChanged<EpubLocation>? onRelocated, ValueChanged<EpubTextSelection>? onTextSelected, EpubDisplaySettings? displaySettings, ContextMenu? selectionContextMenu, void onAnnotationClicked(String cfiRange, Map<String, dynamic>? rect)?, EpubSelectionCallback? onSelection, VoidCallback? onSelectionChanging, VoidCallback? onDeselection, ValueChanged<String>? onInitialPositionLoading, VoidCallback? onInitialPositionLoaded, void onTouchDown(double x, double y)?, void onTouchUp(double x, double y)?, bool suppressNativeContextMenu = false, bool clearSelectionOnPageChange = true, bool selectAnnotationRange = false})
const

Properties

clearSelectionOnPageChange bool
Whether to automatically clear text selection when navigating to a new page.
final
displaySettings EpubDisplaySettings?
initial display settings
final
epubController EpubController
final
epubSource EpubSource
Epub source, accepts url, file or assets opf format is not tested, use with caution
final
hashCode int
The hash code for this object.
no setterinherited
initialCfi String?
Initial cfi string to specify which part of epub to load initially if null, the first chapter will be loaded
final
initialXPath String?
Initial xpath/XPointer string to specify which part of epub to load initially if null and initialCfi is also null, the first chapter will be loaded
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onAnnotationClicked → void Function(String cfiRange, Map<String, dynamic>? rect)?
Callback for handling annotation click (Highlight and Underline) Provides the CFI range and the selection rect (same format as onSelection)
final
onChaptersLoaded ValueChanged<List<EpubChapter>>?
Call back when chapters are loaded
final
onDeselection VoidCallback?
Callback when text selection is cleared.
final
onEpubLoaded VoidCallback?
Call back when epub is loaded and displayed
final
onInitialPositionLoaded VoidCallback?
Callback when initial position loading completes
final
onInitialPositionLoading ValueChanged<String>?
Callback when initial position loading starts (for showing progress indicator) Receives the type: 'xpath' or 'cfi'
final
onLocationLoaded VoidCallback?
Callback when the location are generated for epub, progress will be only available after this
final
onRelocated ValueChanged<EpubLocation>?
Call back when epub page changes
final
onSelection EpubSelectionCallback?
Callback when text is selected with WebView-relative coordinates.
final
onSelectionChanging VoidCallback?
Callback fired continuously while the user is dragging selection handles.
final
onTextSelected ValueChanged<EpubTextSelection>?
Call back when text selection changes
final
onTouchDown → void Function(double x, double y)?
Callback fired when the user touches down on the EPUB viewer.
final
onTouchUp → void Function(double x, double y)?
Callback fired when the user releases a touch on the EPUB viewer.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectAnnotationRange bool
Whether to programmatically select annotation ranges when clicked.
final
selectionContextMenu ContextMenu?
Context menu for text selection. If null, the default context menu will be used.
final
suppressNativeContextMenu bool
Whether to suppress the native context menu entirely. When true, no native context menu will be shown on text selection. Use with onSelection to implement custom selection UI.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<EpubViewer>
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