> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Screen Sharing

> CometChat Calling SDK v5 - Screen Sharing for Flutter

View screen shares from other participants during a call. The Flutter SDK can receive and display screen shares initiated from web clients.

<Note>
  The Flutter Calls SDK does not support initiating screen sharing. Screen sharing can only be started from web clients. Flutter participants can view shared screens.
</Note>

## How It Works

When a web participant starts screen sharing:

1. The SDK receives the screen share stream
2. The call layout automatically adjusts to display the shared screen prominently
3. Flutter participants can view the shared content

## Listen for Screen Share Events

Monitor when participants start or stop screen sharing:

```dart theme={null}
CallSession? callSession = CallSession.getInstance();

callSession?.addParticipantEventListener(ParticipantEventListener(
  onParticipantStartedScreenShare: (Participant participant) {
    debugPrint("${participant.name} started screen sharing");
    // Layout automatically adjusts to show shared screen
  },
  onParticipantStoppedScreenShare: (Participant participant) {
    debugPrint("${participant.name} stopped screen sharing");
    // Layout returns to normal view
  },
  // Other callbacks...
  onParticipantJoined: (Participant participant) {},
  onParticipantLeft: (Participant participant) {},
  onParticipantListChanged: (List<Participant> participants) {},
  onParticipantAudioMuted: (Participant participant) {},
  onParticipantAudioUnmuted: (Participant participant) {},
  onParticipantVideoPaused: (Participant participant) {},
  onParticipantVideoResumed: (Participant participant) {},
  onParticipantStartedRecording: (Participant participant) {},
  onParticipantStoppedRecording: (Participant participant) {},
  onParticipantHandRaised: (Participant participant) {},
  onParticipantHandLowered: (Participant participant) {},
  onDominantSpeakerChanged: (Participant participant) {},
));
```

<Note>
  Flutter listeners are not lifecycle-aware. You must manually remove listeners in your widget's `dispose()` method to prevent memory leaks.
</Note>

## Check Screen Share Status

Use the `isPresenting` property on the `Participant` object to check if someone is sharing their screen:

```dart theme={null}
CallSession? callSession = CallSession.getInstance();

callSession?.addParticipantEventListener(ParticipantEventListener(
  onParticipantListChanged: (List<Participant> participants) {
    final presenter = participants.where((p) => p.isPresenting).firstOrNull;
    if (presenter != null) {
      debugPrint("${presenter.name} is currently sharing their screen");
    }
  },
));
```
