closePublication method

  1. @override
Future<void> closePublication()
override

Close the currently open publication and its related reader or playback ressources.

Implementation

@override
Future<void> closePublication() async {
  await methodChannel.invokeMethod<void>('closePublication');
  // Reset the lazy-stream fields so the next getter access creates a fresh
  // subscription and fires onListen on native before the next book's widget
  // mounts. The native side clears its event buffers in the same call, so no
  // stale locator or status from this publication will be replayed.
  _onTextLocatorChanged = null;
  _onReaderStatusChanged = null;
  _onNarrationSyncChanged = null;
}