FlureadiumPlatform class abstract

The interface that implementations of Flureadium must implement.

Platform implementations should extend this class rather than implement it as Flureadium 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 FlureadiumPlatform methods.

Inheritance
  • Object
  • PlatformInterface
  • FlureadiumPlatform
Implementers

Constructors

FlureadiumPlatform()
Constructs a FlureadiumPlatform.

Properties

currentReaderWidget ReadiumReaderWidgetInterface?
getter/setter pair
defaultNavigationConfig ReaderNavigationConfig?
getter/setter pair
defaultPdfPreferences PDFPreferences?
getter/setter pair
defaultPreferences EPUBPreferences?
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
onReaderStatusChanged Stream<ReadiumReaderStatus>
no setter
onTextLocatorChanged Stream<Locator>
no setter
onTimebasedPlayerStateChanged Stream<ReadiumTimebasedState>
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 id parameter is used to identify the decoration set. The decorations parameter 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.
extractPageThumbnail(String href, int maxHeight, int quality) Future<Uint8List?>
Extracts a downscaled JPEG thumbnail of a publication resource.
getLinkContent(Link link) Future<String?>
Retrieves the content of a given link in the current Publication as a string.
goLeft() Future<void>
Navigate left/backwards visually in the current publication renderer.
goRight() 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.
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.
renderFirstPage(String pubUrl, {int maxWidth = 600, int maxHeight = 800}) Future<Uint8List?>
Renders the first page of a PDF publication as a JPEG image. Returns the image bytes, or null if rendering fails. pubUrl is the file path or URL to the PDF. maxWidth and maxHeight constrain the output dimensions.
resume() Future<void>
Resume playback.
setCustomHeaders(Map<String, String> headers) Future<void>
setDecorationStyle(ReaderDecorationStyle? utteranceDecoration, ReaderDecorationStyle? rangeDecoration) Future<void>
Set the decoration styles for utterances and ranges.
setDefaultPdfPreferences(PDFPreferences preferences) → void
setDefaultPreferences(EPUBPreferences preferences) → void
setEPUBPreferences(EPUBPreferences preferences) Future<void>
Sets the default EPUB rendering preferences and updates preferences for the ReaderWidgetView.
setNavigationConfig(ReaderNavigationConfig config) Future<void>
Sets navigation config and forwards it to the active reader widget.
skipToNext() Future<void>
Skip to next chapter in the current publication.
skipToPrevious() Future<void>
Skip to previous chapter in the current publication.
stop() Future<void>
Stop playback.
toString() String
A string representation of this object.
inherited
ttsCanSpeak() Future<bool>
Check whether TTS can speak the current publication's language.
ttsEnable(TTSPreferences? preferences, {Locator? fromLocator}) Future<void>
Enables TTS playback for the current publication with optional preferences.
ttsGetAvailableVoices() Future<List<ReaderTTSVoice>>
Get the list of available TTS voices on the platform.
ttsGetSystemVoices() Future<List<ReaderTTSVoice>>
Get the list of available TTS voices from the OS without requiring TTS to be enabled. Unlike ttsGetAvailableVoices, this does not need a TTS navigator.
ttsRequestInstallVoice() Future<void>
Request the system to install missing TTS voice data.
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 FlureadiumPlatform
Platform-specific plugins should set this with their own platform-specific class that extends FlureadiumPlatform when they register themselves.
getter/setter pair