ScreenCaptureKit for Dart
Native Dart bindings for macOS ScreenCaptureKit using Dart Build Hooks.
screen_capture_kit provides high-performance access to Apple's ScreenCaptureKit API from Dart applications.
It enables screen, window, and display capture on macOS with minimal overhead by calling the native APIs directly.
Features
- Display capture — Capture entire displays or regions
- Window capture — Capture individual windows
- Region capture — Crop to a specific area via
sourceRect - Screenshot — Single-frame capture (macOS 14+), optional
captureResolution(automatic / best / nominal) - Live streams — Same optional
captureResolutiononstartCaptureStream/startCaptureStreamWithUpdaterandStreamConfiguration(macOS 14+) - System picker — Native content-sharing picker UI (macOS 14+)
- Audio capture — System audio (macOS 13+), optional microphone (macOS 15+)
- Stream delegate events (optional) —
emitDelegateEvents: trueexposesCaptureStream.delegateEvents(CaptureStreamDelegateEvent: stop/error and video-effect start/stop on macOS 14+) - Cursor capture — Include or hide the system cursor
- Frame rate configuration — 1–120 fps
- Multi-display — Capture any connected display
- Powered by Dart Build Hooks — No Flutter dependency (pure Dart support)
Platform Support
| Platform | Support |
|---|---|
| macOS | ✅ |
| Windows | ❌ |
| Linux | ❌ |
| iOS | ❌ |
| Android | ❌ |
macOS 12.3 or later is required. Screenshot and system picker require macOS 14+.
Audio capture requires macOS 13+; microphone capture requires macOS 15+.
Installation
Add the package:
dart pub add screen_capture_kit
Example
import 'package:screen_capture_kit/screen_capture_kit.dart';
void main() async {
final kit = ScreenCaptureKit();
final content = await kit.getShareableContent();
if (content.displays.isEmpty) return;
final display = content.displays.first;
final filter = await kit.createDisplayFilter(display);
kit.startCaptureStream(
filter,
frameSize: FrameSize(width: display.width, height: display.height),
)
.listen((frame) {
print('Frame: ${frame.size.width}x${frame.size.height}');
});
// Call kit.releaseFilter(filter) when done
}
Usage flow
- Get shareable content —
getShareableContent()returns displays, windows, and applications. - Create a content filter —
createDisplayFilter()orcreateWindowFilter()for the target. - Start capture —
startCaptureStream()for frames, orstartCaptureStreamWithUpdater()for runtime config changes and audio. OptionalcaptureResolution(macOS 14+) sets the same quality tier as screenshots onSCStreamConfiguration. - Release — Call
releaseFilter(filter)with the sameFilterIdyou used for capture.
For screenshots, use captureScreenshot(filter) (pass the FilterId from createDisplayFilter / createWindowFilter / the picker flow). For the system picker, use presentContentSharingPicker().
Architecture
This package uses Dart Build Hooks to compile native macOS code and bridge the ScreenCaptureKit APIs to Dart.
Dart layers (inward dependencies): domain (entities, value objects, errors) → application (ScreenCaptureKit facade) → infrastructure (macOS FFI + stub). Presentation holds stream-facing types such as CaptureStream. The public barrel exports domain types and the facade only.
Dart (barrel + ScreenCaptureKit)
│
│ FFI
▼
Native bridge (Objective-C)
│
▼
ScreenCaptureKit (Apple framework)
This design allows low-latency frame capture while keeping the Dart API simple.
Example app
See the example/ directory for a full sample including display, window, region, and system picker capture. Run instructions: example/README.md.
Roadmap
Major capability areas are implemented and listed under Features: display/window capture, region crop via sourceRect, cursor visibility, system and microphone audio (where supported by macOS version), frame rate, multi-display, screenshot and live-stream captureResolution (macOS 14+), and the system content-sharing picker (macOS 14+).
Partially exposed or not exposed in the Dart API today includes: a subset of SCStreamDelegate via emitDelegateEvents / CaptureStream.delegateEvents (not the full delegate protocol); many other optional framework knobs (several advanced SCStreamConfiguration properties, include-only window filters). Maintainers track those gaps in the repository checklist .cursor/skills/screen-capture-kit-api-coverage/SKILL.md.
Additional documentation
- Contributing — setup, tests, and PR guidelines
- Domain model — aggregate root, entities, and value objects
- Intended use cases — capture-only scope and typical pipelines
Libraries
- screen_capture_kit
- Native Dart bindings for macOS ScreenCaptureKit.