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
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.
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
setEPUBPreferences(prefs)
Apply EPUB display preferences to the current publication. See preferences.md
setCustomHeaders(headers)
Set HTTP headers used for all network requests
setLogLevel(level)
Set the plugin's internal log verbosity
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
TODO: Slightly inconsistent that audioEnable takes a fromLocator and ttsEnable doesn't.