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

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+)
  • System picker — Native content-sharing picker UI (macOS 14+)
  • Audio capture — System audio (macOS 13+), optional microphone (macOS 15+)
  • 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, width: display.width, height: display.height)
      .listen((frame) {
    print('Frame: ${frame.width}x${frame.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.
  4. Release — Call releaseFilter() when done.

For screenshots, use captureScreenshot(filterHandle). 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
 │
 │  Dart API
 ▼
Native Bridge (Objective-C)
 │
 │  FFI / Dart Build Hooks
 ▼
ScreenCaptureKit

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.

0
likes
0
points
328
downloads

Documentation

Documentation

Publisher

verified publisherblendthink.dev

Weekly Downloads

Native Dart bindings for macOS ScreenCaptureKit using Dart Build Hooks.

Repository (GitHub)
View/report issues

Topics

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

License

unknown (license)

Dependencies

code_assets, ffi, hooks, meta, native_toolchain_c

More

Packages that depend on screen_capture_kit