MethodChannelFlutterReadium class

An implementation of FlutterReadiumPlatform that uses method channels.

Inheritance

Properties

currentReaderWidget ↔ ReadiumReaderWidgetInterface?
The currently mounted ReadiumReaderWidgetInterface, if any. Read-only for consumers; the active reader widget registers itself via the protected setter.
getter/setter pairinherited
defaultPreferences ↔ EPUBPreferences?
Default EPUB preferences applied to all publications unless overridden per-session. Use setDefaultPreferences to update.
getter/setter pairinherited
errorEventChannel ↔ EventChannel
getter/setter pair
externalPlaybackCommandChannel ↔ EventChannel
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
methodChannel ↔ MethodChannel
The method channel used to interact with the native platform.
getter/setter pair
narrationSyncChannel ↔ EventChannel
getter/setter pair
onErrorEvent → Stream<ReadiumError>
State stream for error events occurring in the reader or playback.
no setteroverride
onExternalPlaybackCommand → Stream<ReadiumExternalPlaybackCommand>
Stream emitting playback commands received from system media controls.
no setteroverride
onNarrationSyncChanged → Stream<bool>
Stream emitting narration↔visual sync state changes. true = in sync (hide re-sync UI); false = user took manual control (show re-sync UI). Currently fired by comic (DiViNa) navigators; future: Media Overlay.
no setteroverride
onReaderStatusChanged → Stream<ReadiumReaderStatus>
Fires whenever the reader status changes.
no setteroverride
onTextLocatorChanged → Stream<Locator>
Fires whenever the Reader's current Locator changes.
no setteroverride
onTimebasedPlayerStateChanged → Stream<ReadiumTimebasedState>
Fires whenever the TimebasedNavigator changes state.
no setteroverride
readerStatusChannel ↔ EventChannel
The event channel used to receive text Locator changes from the native platform.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
textLocatorChannel ↔ EventChannel
The event channel used to receive text Locator changes from the native platform.
getter/setter pair
timebasedStateChannel ↔ EventChannel
getter/setter pair

Methods

applyDecorations(String id, List<ReaderDecoration> decorations) → Future<void>
Apply reader decorations (highlights, bookmarks, etc.) to the current ReaderWidgetView. The id parameter is used to identify the decoration set. The decorations parameter is a list of ReaderDecoration objects to apply.
override
audioEnable({AudioPreferences? prefs, Locator? fromLocator}) → Future<void>
Enable audiobook playback with optional preferences and starting from an optional locator.
override
audioSeekBy(Duration offset) → Future<void>
Seek in audio playback relative to current position by the given offset in seconds. Positive values seek forward, negative values seek backward. This is an alternative to next/previous which seeks by a fixed interval.
override
audioSetPreferences(AudioPreferences prefs) → Future<void>
Change the audiobook playback preferences such as speed and seek interval.
override
closePublication() → Future<void>
Close the currently open publication and its related reader or playback ressources.
override
getResourceUrl(String href) → Future<String>
Resolves a publication resource identified by its href to a loadable URL.
override
goBackward() → Future<void>
Navigate left/backwards visually in the current publication renderer.
override
goForward() → Future<void>
Navigate right/forwards visually in the current publication renderer.
override
goToLocator(Locator locator) → Future<bool>
Go directly to the given Locator in the publication, whether visual or audio.
override
goToProgression(double progression) → Future<bool>
Go to a specific progression in the current resource of the publication, where 0.0 is the start and 1.0 is the end.
override
loadPublication(String pubUrl) → Future<Publication>
Load publication manifest from URL, which is usually a packaged ebook or direct URL to a manifest. This will NOT store a reference to the Publication and is purely meant to be used for fetching metadata/manifest for multiple books.
override
next() → Future<void>
Skip to next logical item during playback. For audiobooks this is the default seek interval. For TTS this is the next paragraph.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openPublication(String pubUrl) → Future<Publication>
Opens a publication from a URL and prepares it for reading or playback. If the URL has not already been loaded, it will implicitly do this.
override
pause() → Future<void>
Pause playback.
override
play(Locator? fromLocator) → Future<void>
Play the publication from the given locator, or resume if null.
override
previous() → Future<void>
Skip to previous logical item during playback. For audiobooks this is the default seek interval. For TTS this is the previous paragraph.
override
resume() → Future<void>
Resume playback.
override
searchInPublication(String searchKey) → Future<List<TextSearchResult>>
Searches for searchKey in the currently opened publication and returns matching results.
override
setAudioRecoveryPolicy(AudioRecoveryPolicy policy) → Future<void>
Configures the automatic audio-stream error recovery loop (retry attempts, backoff, and stall detection).
override
setCssInjections(List<InjectionAsset> injections) → Future<void>
Registers extra CSS assets to inject into every EPUB HTML resource, in addition to the built-in flutterReadiumTools.css. Call before opening a publication so the injections are in effect when the reader view is created.
override
setCustomHeaders(Map<String, String> headers) → Future<void>
Sets custom HTTP headers forwarded to the native HTTP layer for all network requests.
override
setDecorationStyle(ReaderDecorationStyle? utteranceDecoration, ReaderDecorationStyle? rangeDecoration) → Future<void>
Set the decoration styles for utterances and ranges.
override
setDefaultPreferences(EPUBPreferences preferences) → void
Stores preferences as the default EPUB preferences applied to future publications.
inherited
setEPUBPreferences(EPUBPreferences preferences) → Future<void>
Sets the default EPUB rendering preferences and updates preferences for the ReaderWidgetView.
override
setJavaScriptInjections(List<InjectionAsset> injections) → Future<void>
Registers extra JavaScript assets to inject into every EPUB HTML resource, in addition to the built-in flutterReadiumTools.js. Call before opening a publication so the injections are in effect when the reader view is created.
override
setLogLevel(LogLevel level) → Future<void>
Sets the log verbosity of the plugin's internal logging system, for both Dart and native code.
override
setNarrationSyncEnabled(bool enabled) → Future<void>
Toggles narration↔visual sync for the current publication.
override
setPDFPreferences(PDFPreferences preferences) → Future<void>
Sets the PDF rendering preferences for the current ReaderWidgetView.
override
stop() → Future<void>
Stop playback and tear down the active time-based navigator.
override
toString() → String
A string representation of this object.
inherited
ttsEnable(TTSPreferences? preferences) → Future<void>
Enabled TTS playback for the current publication with optional preferences.
override
ttsGetAvailableVoices() → Future<List<ReaderTTSVoice>>
Get the list of available TTS voices on the platform.
override
ttsSetPreferences(TTSPreferences preferences) → Future<void>
Change the TTS preferences such as speed, pitch, and volume.
override
ttsSetVoice(String voiceIdentifier, String? forLanguage) → Future<void>
Set the TTS voice by its identifier, optionally for a specific language.
override

Operators

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