EpubSelectionCallback typedef

EpubSelectionCallback = void Function(String selectedText, String cfiRange, Rect selectionRect, Rect viewRect)

Callback for text selection events with WebView-relative coordinates.

Provides precise positioning information for implementing custom selection UI. All rectangles are relative to the WebView's coordinate system (not screen coordinates).

Parameters:

  • selectedText - The text that was selected
  • cfiRange - The EPUB CFI (Canonical Fragment Identifier) range for the selection
  • selectionRect - The bounding rectangle of the selected text (WebView-relative)
  • viewRect - The bounding rectangle of the entire WebView

Implementation

typedef EpubSelectionCallback = void Function(String selectedText, String cfiRange, Rect selectionRect, Rect viewRect);