Skip to content

This plugin allows Flutter desktop apps to capture screenshots.

License

Notifications You must be signed in to change notification settings

amit548/screen_capturer

 
 

Repository files navigation

screen_capturer

pub version

This plugin allows Flutter desktop apps to take screenshots.


English | 简体中文


Platform Support

Linux macOS Windows
✔️ ✔️ ✔️

Quick Start

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  screen_capturer: ^0.1.5

Or

dependencies:
  screen_capturer:
    git:
      url: https://github.com/leanflutter/screen_capturer.git
      ref: main

Windows requirements

Be sure to modify your Visual Studio installation and ensure that "C++ ATL for latest v142 build tools (x86 & x64)" is installed!

Usage

macOS

Change the file macos/Runner/DebugProfile.entitlements or macos/Runner/Release.entitlements as follows:

Required only for sandbox mode.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.security.app-sandbox</key>
	<true/>
+	<key>com.apple.security.temporary-exception.mach-register.global-name</key>
+	<string>com.apple.screencapture.interactive</string>
</dict>
</plist>
import 'package:screen_capturer/screen_capturer.dart';

CapturedData? capturedData = await screenCapturer.capture(
  mode: CaptureMode.region, // screen, window
  imagePath: '<path>',
  copyToClipboard: true,
);

Please see the example app of this plugin for a full example.

Platform Differences

CaptureMode

Name Description Linux macOS Windows
region Drag the cursor around an object to form a rectangle. ✔️ ✔️ ✔️
screen Capture the entire screen. ✔️ ✔️ ✔️
window Select a window, that you want to capture. (linux capture only the current window) ✔️ ✔️

Who's using it?

License

MIT

About

This plugin allows Flutter desktop apps to capture screenshots.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 41.0%
  • Dart 24.2%
  • CMake 22.7%
  • Swift 4.1%
  • C 3.2%
  • Ruby 2.6%
  • HTML 2.2%