ScreenShareStore provides a complete set of screen sharing APIs, including full-screen sharing on mobile, and screen / window source enumeration and targeted sharing on desktop (Win/Mac).ScreenShareStore instance. Do not attempt to initialize directly.Property | Type | Description |
screenStatus | Screen sharing status. |
Function | Description |
Singleton object. | |
Start screen sharing. | |
Enumerate shareable screens / windows (desktop only). | |
Stop screen sharing. | |
Reset to default state. |
void startScreenShare({String iOSAppGroup = '', String? sourceId, ShareConfig? property});
Parameter | Type | Description |
iOSAppGroup | String | Defaults to '', which is the correct value for Android (ignored on the Android platform). On iOS, the value must match the App Group string configured in the Broadcast Upload Extension, used for sharing data between the host app and the Extension, in the format group.<reverse-domain>. Passing an empty string is allowed but does not guarantee screen sharing stability; configuring it correctly is recommended. |
sourceId | String? | Desktop only (Win/Mac). The runtime handle of the screen / window to share, taken from ShareSource.sourceId returned by getShareSources. When null, no specific target is selected. The handle is volatile and must not be persisted; only pass it back while it is still live. |
property | Desktop only (Win/Mac). Capture config, see ShareConfig. Uses default config when null. |
Future<List<ShareSource>> getShareSources({required Size thumbnailSize, required Size iconSize});
Parameter | Type | Description |
thumbnailSize | Size | Desired thumbnail size for each source. |
iconSize | Size | Desired icon size for each source. |
void stopScreenShare();
void reset();
Enum Value | Value | Description |
window | 0 | An application window. |
screen | 1 | A physical monitor / whole screen. |
Property | Type | Description |
type | Source type. | |
sourceId | String | Live runtime handle (HWND / CGWindowID), stringified. Do not persist. |
sourceName | String | Source name at enumeration time. May be stale versus the live window title. |
isMinimizeWindow | bool | Whether the window is minimized. Use it to hide or gray out minimized windows in the source-picker UI (minimized windows cannot be captured effectively). |
thumbnail | ImageProvider? | Thumbnail image, may be null if not requested / unavailable. |
icon | ImageProvider? | Icon image, may be null if not requested / unavailable. |
Property | Type | Description |
enableCaptureMouse | bool | Whether to capture the mouse cursor. Defaults to true. |
Property | Type | Description |
screenStatus | Screen sharing status. |
// Get singleton instancefinal store = ScreenShareStore.shared;// Subscribe to state changesstore.state.screenStatus.addListener(() {print('Screen sharing status: ${store.state.screenStatus.value}');});// Mobile: start screen sharingstore.startScreenShare(iOSAppGroup: 'group.com.example.app');// Desktop: enumerate sources and share a specific targetfinal sources = await store.getShareSources(thumbnailSize: const Size(320, 180),iconSize: const Size(48, 48),);if (sources.isNotEmpty) {store.startScreenShare(sourceId: sources.first.sourceId);}// Stop screen sharingstore.stopScreenShare();
Esta página foi útil?
Você também pode entrar em contato com a Equipe de vendas ou Enviar um tíquete em caso de ajuda.
comentários