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

插件详情v3.0.1

screenshot_callback

Flutter 插件,可在 iOS 和 Android 上检测移动设备截图并执行回调函数。

AndroidiOS
近 30 天下载
7060
喜欢数
101
Pub 分数
150

安装插件

flutter pub add screenshot_callback

插件介绍

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

screenshot_callback 包是一个 Flutter 插件,可在 Android 和 iOS 设备上检测移动设备截图。当拍摄截图时,它会触发回调函数,使开发者能够动态响应——例如暂停敏感内容或记录事件。该插件专为跨平台兼容性设计,可无缝集成到现有的 Flutter 应用中,无需更改原生代码。该插件利用平台特定的 API 高效且可靠地监控截图活动。

适合场景

  • 检测用户在敏感应用中截屏的时机
  • 在检测到截图时触发安全措施
  • 记录截图事件以用于分析
  • 防止未经授权的屏幕截图
  • 在截图后启用响应式 UI 调整

主要特点

  • Android 和 iOS 的跨平台支持
  • 在检测到截图时执行简单回调
  • 使用 pub add 命令进行最小化设置
  • 安全且轻量的实现
  • 无需修改原生代码

适合对象

  • 需要截图保护的应用
  • 注重安全的应用程序
  • 教育或考试类环境
  • 需要使用跟踪的内容提供者
  • 开发注重隐私功能的开发者

使用建议

  • Android 上需要适当的权限
  • 仅限检测截图,无法防止截图
  • 可能无法在所有设备型号或操作系统版本上正常工作
  • 行为在 iOS 和 Android 之间可能有所不同
  • 无法保证在所有场景下100%的检测准确率

原始 README

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

Screenshot Callback

Flutter plugin that allows you to detect mobile screenshot and execute callback functions on iOS and Android. 🚀

Usage • Issues and Feedback • Author • License

Feedback welcome and Pull Requests are most welcome!

Usage

Import the package

To use this plugin, follow the plugin installation instructions.

Use the plugin

Add the following import to your Dart code:

import 'package:screenshot_callback/screenshot_callback.dart';

Initialize ScreenshotCallback with the scopes you want:

ScreenshotCallback screenshotCallback = ScreenshotCallback();
addListener

Then invoke addListener method of ScreenshotCallback. Add custom functions that you want to excute after detect screenshot. e.g:

screenshotCallback.addListener(() {
  //Void funtions are implemented
  print('detect screenshot');
});
dispose

You need to call dispose method to terminate ScreenshotCallback before you exit the app e.g:

screenshotCallback.dispose();

Issues and Feedback

Please file issues to send feedback or report a bug. Thank you !

Author

License

MIT

所属分类

源码仓库

使用此插件的项目

暂无相关数据。