You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FlutterReadium is a singleton that provides the full reader API. Obtain the instance with FlutterReadium().
Publication lifecycle
Method
Description
loadPublication(url)
Parse a publication manifest without opening it for reading. Never affects the open publication.
openPublication(url)
Open a publication for reading; required before showing [ReadiumReaderWidget] or using any navigation API. ⚠️ Only one publication can be open at a time. Opening the URL that is already open returns that publication without reloading it; call closePublication() first to reload.
closePublication()
Close the current publication and release native resources
final pub =awaitFlutterReadium().openPublication(url);
// ...awaitFlutterReadium().closePublication();
Navigation
Method
Description
goForward()
Next page or section
goBackward()
Previous page or section
goToLocator(locator)
Navigate to an exact position; returns true on success
goToProgression(value)
Navigate to a 0.0–1.0 position in the current resource
goByLink(link, pub)
Navigate to a publication link
toPhysicalPageIndex(index, pub)
Navigate to a printed page number. TODO: will be deprecated in favor of goByLink
skipToNextTOC(publication, currentTocHref)
Skip to next chapter
skipToPreviousTOC(publication, currentTocHref)
Skip to previous chapter
Preferences
Method
Description
setDefaultPreferences(prefs)
Set EPUB defaults applied to all future publications. See preferences.md
setDefaultPDFPreferences(prefs)
Set PDF defaults applied to every PDF opened afterwards. setPDFPreferences also updates them. See preferences.md
setEPUBPreferences(prefs)
Apply EPUB display preferences to the current publication. See preferences.md
setPDFPreferences(prefs)
Apply PDF display preferences to the current publication and update the PDF defaults. See preferences.md
setCustomHeaders(headers)
Set HTTP headers used for all network requests
setLogLevel(level)
Set the plugin's internal log verbosity
setAudioRecoveryPolicy(policy)
Configure audio-stream error recovery and resource-loading watchdog reporting/recovery. See error-codes.md
Decorations
// Apply (or replace) a named groupawaitFlutterReadium().applyDecorations('highlights', decorations);
// Clear a groupawaitFlutterReadium().applyDecorations('highlights', []);
TTS
Method
Description
ttsEnable(prefs)
Enable TTS for the current publication. See preferences.md
ttsSetPreferences(prefs)
Update TTS preferences without restarting. See preferences.md
ttsGetAvailableVoices()
List all available voices
ttsSetVoice(id, language)
Set a specific voice; language scopes it to a content language
setDecorationStyle(utterance, range)
Set decoration styles for TTS highlighting
Available voices include the platform identifier, name, language, network status, gender and quality. When Readium Speech recognizes a voice, it provides a friendly label. Platform-reported male or female gender is preserved; a missing, null, or unspecified gender uses catalog gender when available, otherwise it remains unspecified. Platform-reported quality is preserved; when missing, it falls back to the highest quality listed by Readium Speech, which may describe a different variant. label is null when no match is found. Readium Speech veryHigh maps to TTSVoiceQuality.highest.
TODO: Slightly inconsistent that audioEnable takes a fromLocator and ttsEnable doesn't.