flutter_readium 0.0.1
flutter_readium: ^0.0.1 copied to clipboard
Flutter plugin for reading EPUB, audiobook, and WebPub publications. Wraps the Readium toolkits on iOS, Android, and Web.
Changelog #
All notable changes to flutter_readium are documented here.
Format follows Keep a Changelog.
Unreleased #
0.0.1 - 2025-06-01 #
Added #
- Text selection callback —
ReadiumReaderWidget.onTextSelectedfires aTextSelectionEvent(locator + selected text) when the user selects text in the reader. Supported on iOS, Android, and Web. - Selection actions —
ReadiumReaderWidget.selectionActionsconfigures native context menu items (up to 5 on iOS) shown on text selection. Tapping an action firesReadiumReaderWidget.onSelectionActionwith aSelectionActionEvent. - Decoration interaction —
ReadiumReaderWidget.onDecorationInteractionfires aDecorationInteractionEventwhen the user taps an existing decoration/highlight. Supported on iOS and Android. - Allowed default actions —
ReadiumReaderWidget.allowedDefaultActionscontrols which system-provided selection menu items (Copy, Share, Look Up, Translate, Select All) are shown. Passnullfor all defaults, or a specificSet<DefaultSelectionAction>to filter. iOS supportscopy,share,lookup,translate; Android supportscopy,share,selectAll. Unsupported values for a platform are silently ignored. - PDF reading —
ReadiumReaderWidgetnow opens PDF publications on iOS (PDFKit viaPDFNavigatorViewControllerfrom swift-toolkit) and Android (PDFium viaPdfiumNavigatorFragmentfrom kotlin-toolkit). PDF is not supported on Web. - PDF preferences —
FlutterReadium.setPDFPreferences(PDFPreferences)applies runtime display settings (layout,readingProgression,pageSpacing,fit) to the active PDF navigator.PDFLayoutunifies iOS'sscroll+scrollAxisand Android'sscrollAxisinto one cross-platform setting (paginated,scrollVertical,scrollHorizontal);PDFFitcontrols page fitting (auto,page,width). - PDF TOC enrichment —
onTextLocatorChangedevents for PDF publications now includetitle(chapter name) andlocations.otherLocations["tocHref"]derived from#page=NTOC fragments, matching the existing EPUB enrichment behaviour. - Core reader API —
FlutterReadiumsingleton providingopenPublication,closePublication,loadPublication,goToLocator,goToProgression,goForward,goBackward. - EPUB reader widget —
ReadiumReaderWidgetrenders EPUB and WebPub content via a native platform view (iOS/macOS/Android) or a WebView (web). - EPUB preferences —
EPUBPreferenceswith font family, font size, scroll mode, line height, word spacing, letter spacing, paragraph spacing, text alignment, column count, publisher styles, vertical writing, custom CSS properties and first-element margin.FlutterReadium.setDefaultPreferences(EPUBPreferences)stores defaults applied to future publications;FlutterReadium.setEPUBPreferences(EPUBPreferences)applies preferences to the active reader widget. - TTS (text-to-speech) —
ttsEnable,ttsSetPreferences,ttsSetVoice,ttsGetAvailableVoiceswith voice metadata loaded from the Readium speech voice-data registry. TTS decoration styles are configurable viasetDecorationStyle. - Audio / MediaOverlay playback —
audioEnable,audioSetPreferences,audioSeekBy,play,pause,resume,stop,next,previousfor pre-recorded audio publications and MediaOverlay synchronized narration. - Decorations —
applyDecorationslets callers add highlights, underlines, and custom decoration styles to the visual reader. - Search —
searchInPublicationreturns a list ofTextSearchResultmatching a query string. - Navigation helpers —
skipToNextTOC/skipToPreviousTOCwalk the publication's table of contents;toPhysicalPageIndexandgoByLinknavigate by page-list entry or link. - Event streams —
onReaderStatusChanged,onTextLocatorChanged,onTimebasedPlayerStateChanged,onErrorEventexpose real-time reader state as Dart streams. - Platform support — iOS (swift-toolkit 3.7.0), macOS (same), Android (kotlin-toolkit 3.1.2), Web (TypeScript webpack bundle using @readium/navigator).
- Custom HTTP headers —
setCustomHeadersforwards headers to the native HTTP layer. - Log level control —
setLogLevelconfigures the plugin's internal logging verbosity. - Page information —
Locations.pageandLocations.totalPagesextension getters expose the current page and total page count (parsed from locator fragments) for publications that include a page list. - Progress slider support in the example app via a slider bound to
totalProgression.