onFilePresentationChange method

Stream<Event<FilePresentationServiceEventNames, FilePresentation>> onFilePresentationChange()

Returns a Stream of the FilePresentationServiceEventNames.filePresentationStarted, FilePresentationServiceEventNames.filePresentationStopped, and FilePresentationServiceEventNames.filePresentationUpdated events. By subscribing to the returned stream you will be notified about started, modified, and stopped file presentations.

Implementation

Stream<Event<FilePresentationServiceEventNames, FilePresentation>>
    onFilePresentationChange() {
  var events = [
    FilePresentationServiceEventNames.filePresentationStarted,
    FilePresentationServiceEventNames.filePresentationStopped,
    FilePresentationServiceEventNames.filePresentationUpdated
  ];
  return _nativeEventsReceiver.addListener(events).map((map) {
    final event = map as Map<Object?, Object?>;
    final key =
        FilePresentationServiceEventNames.valueOf(event["key"] as String);
    final data = event["body"] as Map<Object?, Object?>;
    return Event(key, FilePresentationMapper.fromMap(data));
  });
}