FlutterReadiumPlatform class abstract
The interface that implementations of FlutterReadium must implement.
Platform implementations should extend this class rather than implement it as FlutterReadium
does not consider newly added methods to be breaking changes. Extending this class
(using extends) ensures that the subclass will get the default implementation, while
platform implementations that implements this interface will be broken by newly added
FlutterReadiumPlatform methods.
- Inheritance
-
- Object
- PlatformInterface
- FlutterReadiumPlatform
- Implementers
Constructors
- FlutterReadiumPlatform()
- Constructs a FlutterReadiumPlatform.
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 pair
- defaultPreferences ↔ EPUBPreferences?
-
Default EPUB preferences applied to all publications unless overridden per-session.
Use setDefaultPreferences to update.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
-
onErrorEvent
→ Stream<
ReadiumError> -
State stream for error events occurring in the reader or playback.
no setter
-
onExternalPlaybackCommand
→ Stream<
ReadiumExternalPlaybackCommand> -
Stream emitting playback commands received from system media controls.
no setter
-
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 setter -
onReaderStatusChanged
→ Stream<
ReadiumReaderStatus> -
Stream emitting the current reader lifecycle status (loading, ready, closed, error).
no setter
-
onTextLocatorChanged
→ Stream<
Locator> -
Stream emitting the current visual reader position (first visible locator on the page).
no setter
-
onTimebasedPlayerStateChanged
→ Stream<
ReadiumTimebasedState> -
Stream emitting the current timebased playback state during TTS or audio playback.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
applyDecorations(
String id, List< ReaderDecoration> decorations) → Future<void> -
Apply reader decorations (highlights, bookmarks, etc.) to the current ReaderWidgetView.
The
idparameter is used to identify the decoration set. Thedecorationsparameter is a list of ReaderDecoration objects to apply. -
audioEnable(
{AudioPreferences? prefs, Locator? fromLocator}) → Future< void> - Enable audiobook playback with optional preferences and starting from an optional locator.
-
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.
-
audioSetPreferences(
AudioPreferences prefs) → Future< void> - Change the audiobook playback preferences such as speed and seek interval.
-
closePublication(
) → Future< void> - Close the currently open publication and its related reader or playback ressources.
-
getResourceUrl(
String href) → Future< String> -
Resolves a publication resource identified by its
hrefto a loadable URL. -
goBackward(
) → Future< void> - Navigate left/backwards visually in the current publication renderer.
-
goForward(
) → Future< void> - Navigate right/forwards visually in the current publication renderer.
-
goToLocator(
Locator locator) → Future< bool> - Go directly to the given Locator in the publication, whether visual or audio.
-
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.
-
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.
-
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.
-
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.
-
pause(
) → Future< void> - Pause playback.
-
play(
Locator? fromLocator) → Future< void> - Play the publication from the given locator, or resume if null.
-
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.
-
resume(
) → Future< void> - Resume playback.
-
searchInPublication(
String searchKey) → Future< List< TextSearchResult> > -
Searches for
searchKeyin the currently opened publication and returns matching results. -
setAudioRecoveryPolicy(
AudioRecoveryPolicy policy) → Future< void> - Configures the automatic audio-stream error recovery loop (retry attempts, backoff, and stall detection).
-
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. -
setCustomHeaders(
Map< String, String> headers) → Future<void> - Sets custom HTTP headers forwarded to the native HTTP layer for all network requests.
-
setDecorationStyle(
ReaderDecorationStyle? utteranceDecoration, ReaderDecorationStyle? rangeDecoration) → Future< void> - Set the decoration styles for utterances and ranges.
-
setDefaultPreferences(
EPUBPreferences preferences) → void -
Stores
preferencesas the default EPUB preferences applied to future publications. -
setEPUBPreferences(
EPUBPreferences preferences) → Future< void> - Sets the default EPUB rendering preferences and updates preferences for the ReaderWidgetView.
-
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. -
setLogLevel(
LogLevel level) → Future< void> - Sets the log verbosity of the plugin's internal logging system, for both Dart and native code.
-
setNarrationSyncEnabled(
bool enabled) → Future< void> - Toggles narration↔visual sync for the current publication.
-
setPDFPreferences(
PDFPreferences preferences) → Future< void> - Sets the PDF rendering preferences for the current ReaderWidgetView.
-
stop(
) → Future< void> - Stop playback and tear down the active time-based navigator.
-
toString(
) → String -
A string representation of this object.
inherited
-
ttsEnable(
TTSPreferences? preferences) → Future< void> - Enabled TTS playback for the current publication with optional preferences.
-
ttsGetAvailableVoices(
) → Future< List< ReaderTTSVoice> > - Get the list of available TTS voices on the platform.
-
ttsSetPreferences(
TTSPreferences preferences) → Future< void> - Change the TTS preferences such as speed, pitch, and volume.
-
ttsSetVoice(
String voiceIdentifier, String? forLanguage) → Future< void> - Set the TTS voice by its identifier, optionally for a specific language.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ FlutterReadiumPlatform
-
The current platform implementation. Defaults to MethodChannelFlutterReadium.
getter/setter pair