搜索插件、代码仓与 APP 分类

插件详情v0.2.3

screen_capturer

此插件允许 Flutter 桌面应用程序捕获屏幕截图。

macOSWindowsLinux
近 30 天下载
3400
喜欢数
83
Pub 分数
150

安装插件

flutter pub add screen_capturer

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

screen_capturer 包使 Flutter 桌面应用程序能够在 macOS、Windows 和 Linux 上捕获屏幕截图。它提供了一个简单的 API,用于获取全屏或特定区域的截图,非常适合需要视觉文档记录、调试工具或屏幕共享功能的应用程序。该插件直接与操作系统的屏幕捕获功能集成,确保跨平台的可靠性能。它专为需要以编程方式与屏幕内容交互的桌面优先 Flutter 应用程序开发者设计。

适合场景

  • 在桌面应用程序中截取屏幕截图
  • 调试和测试工具
  • 屏幕录制工具
  • 视觉文档
  • 用户界面演示

主要特点

  • 跨平台支持(macOS、Windows、Linux)
  • 简易截图 API
  • 区域特定捕获
  • 原生操作系统集成
  • 轻量且快速

适合对象

  • 桌面应用程序开发者
  • 调试工具创建者
  • UI自动化测试人员
  • 屏幕共享应用

使用建议

  • 需要平台特定权限
  • 仅限桌面平台
  • 可能需要用户同意才能访问屏幕
  • 无移动支持
  • 依赖原生系统 API

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

🚀 Ship Your App Faster: Try Fastforge - The simplest way to build, package and distribute your Flutter apps.

screen_capturer

pub version All Contributors

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.2.3

Or

dependencies:
  screen_capturer:
    git:
      path: packages/screen_capturer
      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?

Contributors

LiJianying
LiJianying

💻
Amit Mondal
Amit Mondal

💻
lightrabbit
lightrabbit

💻
liuyuxin
liuyuxin

💻
kalykun
kalykun

📖
Add your contributions

License

MIT

所属分类

依赖

依赖清单 4 项

  • screen_capturer_linux^0.2.3
  • screen_capturer_macos^0.2.2
  • screen_capturer_platform_interface^0.2.2
  • screen_capturer_windows^0.2.2

源码仓库

使用此插件的项目

暂无相关数据。