ReadiumReaderChannel class

Internal use only. Used by ReadiumReaderWidget to talk to the native widget.

Inheritance

Constructors

ReadiumReaderChannel(String name, {required void onPageChanged(Locator), void onExternalLinkActivated(String)?, void onTextSelected(TextSelectionEvent)?, void onSelectionAction(SelectionActionEvent)?, void onDecorationInteraction(DecorationInteractionEvent)?})
Creates a channel bound to name. onPageChanged is called when the native navigator reports a page change. onExternalLinkActivated is called when an external (non-publication) link is tapped.

Properties

binaryMessenger BinaryMessenger
The messenger which sends the bytes for this channel.
no setterinherited
codec MethodCodec
The message codec used by this channel, not null.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
name String
The logical channel on which communication happens, not null.
finalinherited
onDecorationInteraction ↔ void Function(DecorationInteractionEvent)?
Called when the user interacts with an existing decoration.
getter/setter pair
onExternalLinkActivated ↔ void Function(String)?
Called when the reader activates a link that points outside the publication.
getter/setter pair
onPageChanged → void Function(Locator)
Called by the native side whenever the visible page changes.
final
onSelectionAction ↔ void Function(SelectionActionEvent)?
Called when the user taps a configured editing action on selected text.
getter/setter pair
onTextSelected ↔ void Function(TextSelectionEvent)?
Called when the user selects text in the reader.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

applyDecorations(String id, List<ReaderDecoration> decorations) Future<void>
Apply decorations to the reader.
configureSelectionActions(List<SelectionAction> actions) Future<void>
Configure the native selection context menu actions.
dispose() Future<void>
Tears down the method channel handler and signals the native side to clean up.
go(Locator locator, {required bool isAudioBookWithText, bool animated = false}) Future<void>
Go e.g. navigate to a specific locator in the publication.
goBackward({bool animated = true}) Future<void>
Go to the previous page.
goForward({bool animated = true}) Future<void>
Go to the next page.
invokeListMethod<T>(String method, [dynamic arguments]) Future<List<T>?>
An implementation of invokeMethod that can return typed lists.
inherited
invokeMapMethod<K, V>(String method, [dynamic arguments]) Future<Map<K, V>?>
An implementation of invokeMethod that can return typed maps.
inherited
invokeMethod<T>(String method, [dynamic arguments]) Future<T?>
Invokes a method on this channel with the specified arguments.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onMethodCall(MethodCall call) Future
Handles method calls from the native platform.
setEPUBPreferences(EPUBPreferences preferences) Future<void>
Set EPUB preferences.
setMethodCallHandler(Future handler(MethodCall call)?) → void
Sets a callback for receiving method calls on this channel.
inherited
setPDFPreferences(PDFPreferences preferences) Future<void>
Set PDF preferences.
toString() String
A string representation of this object.
inherited

Operators

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