screen_capture_kit 1.0.0 copy "screen_capture_kit: ^1.0.0" to clipboard
screen_capture_kit: ^1.0.0 copied to clipboard

PlatformmacOS

Native Dart bindings for macOS ScreenCaptureKit using Dart Build Hooks.

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.

pub version license

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 captureResolution on startCaptureStream / startCaptureStreamWithUpdater and StreamConfiguration (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: true exposes CaptureStream.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 #

  1. Get shareable contentgetShareableContent() returns displays, windows, and applications.
  2. Create a content filtercreateDisplayFilter() or createWindowFilter() for the target.
  3. Start capturestartCaptureStream() for frames, or startCaptureStreamWithUpdater() for runtime config changes and audio. Optional captureResolution (macOS 14+) sets the same quality tier as screenshots on SCStreamConfiguration.
  4. Release — Call releaseFilter(filter) with the same FilterId you 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 #

0
likes
160
points
328
downloads

Documentation

Documentation
API reference

Publisher

verified publisherblendthink.dev

Weekly Downloads

Native Dart bindings for macOS ScreenCaptureKit using Dart Build Hooks.

Repository (GitHub)
View/report issues
Contributing

Topics

#macos #screen-capture #screenshot #ffi #screen-sharing

License

BSD-3-Clause (license)

Dependencies

code_assets, ffi, hooks, meta, native_toolchain_c

More

Packages that depend on screen_capture_kit