### Installation Rules for Application Bundle Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/linux/CMakeLists.txt Defines installation rules to create a relocatable application bundle. It cleans the bundle directory, installs the executable, data files, libraries, and assets. ```cmake set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() install(CODE " file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") " COMPONENT Runtime) set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) install(FILES "${bundled_library}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endforeach(bundled_library) set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") install(DIRECTORY "${NATIVE_ASSETS_DIR}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Setup Granular Callbacks for Screenshots and Recordings Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Register specific handlers for screenshot detection and screen recording start/stop events. Ensure streams are active and callbacks are started. Callbacks are cleared with `removeAllCallbacks`. ```dart import 'package:no_screenshot/no_screenshot.dart'; final _ns = NoScreenshot.instance; void setupCallbacks() { // Register targeted handlers _ns.onScreenshotDetected = (ScreenshotSnapshot snapshot) { debugPrint('Screenshot at ${snapshot.timestamp} by ${snapshot.sourceApp}'); debugPrint('Path: ${snapshot.screenshotPath}'); // e.g. log to analytics, show a warning dialog }; _ns.onScreenRecordingStarted = (ScreenshotSnapshot snapshot) { debugPrint('Recording started — locking sensitive UI'); _ns.screenshotOff(); }; _ns.onScreenRecordingStopped = (ScreenshotSnapshot snapshot) { debugPrint('Recording stopped — restoring UI'); _ns.screenshotOn(); }; // Requires the screenshot / recording streams to be active _ns.startScreenshotListening(); _ns.startScreenRecordingListening(); _ns.startCallbacks(); debugPrint('Callbacks active: ${_ns.hasActiveCallbacks}'); // true } void teardownCallbacks() { _ns.removeAllCallbacks(); // stops dispatching and clears all three handlers _ns.stopScreenshotListening(); _ns.stopScreenRecordingListening(); } ``` -------------------------------- ### Running the Flutter Example Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/README.md Standard command to run a Flutter project. For Linux users experiencing Wayland issues, an alternative command is provided. ```bash flutter run ``` ```bash GDK_BACKEND=x11 flutter run -d linux ``` -------------------------------- ### Event Monitoring Source: https://github.com/flutterplaza/no_screenshot/blob/development/README.md Methods to start, stop, and manage listening for screenshot and screen recording events. ```APIDOC ## startScreenshotListening() ### Description Start monitoring for screenshot events. ### Method `Future` ## stopScreenshotListening() ### Description Stop monitoring for screenshot events. ### Method `Future` ## startScreenRecordingListening() ### Description Start monitoring for screen recording events. ### Method `Future` ## stopScreenRecordingListening() ### Description Stop monitoring for screen recording events. ### Method `Future` ``` -------------------------------- ### Install no_screenshot Plugin Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Add the no_screenshot package to your pubspec.yaml file and run flutter pub get. ```yaml dependencies: no_screenshot: ^1.0.0 ``` -------------------------------- ### Quick Start: Control Screenshots Source: https://github.com/flutterplaza/no_screenshot/blob/development/README.md Instantiate the NoScreenshot plugin and use its methods to disable, enable, or toggle screenshot and screen recording protection. ```dart import 'package:no_screenshot/no_screenshot.dart'; final noScreenshot = NoScreenshot.instance; // Disable screenshots & screen recording await noScreenshot.screenshotOff(); // Re-enable screenshots & screen recording await noScreenshot.screenshotOn(); // Toggle between enabled / disabled await noScreenshot.toggleScreenshot(); ``` -------------------------------- ### Basic Screenshot and Recording Control Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/README.md Use `NoScreenshot.instance` to get the singleton instance. Call `screenshotOff()` to disable protection and `screenshotOn()` to re-enable it. These methods are asynchronous. ```dart import 'package:no_screenshot/no_screenshot.dart'; final noScreenshot = NoScreenshot.instance; // Disable screenshots & screen recording await noScreenshot.screenshotOff(); // Re-enable screenshots & screen recording await noScreenshot.screenshotOn(); ``` -------------------------------- ### Listen for Real-Time Screenshot Events Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Start listening to `screenshotStream` after calling `startScreenshotListening()`. The stream emits `ScreenshotSnapshot` objects containing event details. Remember to call `stopScreenshotListening()` and cancel the subscription in `dispose()`. ```dart import 'dart:async'; import 'package:flutter/widgets.dart'; import 'package:no_screenshot/no_screenshot.dart'; class ScreenshotMonitorPage extends StatefulWidget { const ScreenshotMonitorPage({super.key}); @override State createState() => _ScreenshotMonitorPageState(); } class _ScreenshotMonitorPageState extends State { final _noScreenshot = NoScreenshot.instance; StreamSubscription? _sub; @override void initState() { super.initState(); _sub = _noScreenshot.screenshotStream.listen((ScreenshotSnapshot snapshot) { // snapshot.wasScreenshotTaken → bool, true when a screenshot was just captured // snapshot.isScreenshotProtectionOn → bool, current protection state // snapshot.screenshotPath → String, file path (macOS & Linux only) // snapshot.isScreenRecording → bool, whether recording is active // snapshot.timestamp → int, ms since epoch (0 = unknown) // snapshot.sourceApp → String, app that triggered the event debugPrint('Screenshot taken: ${snapshot.wasScreenshotTaken}'); debugPrint('Path: ${snapshot.screenshotPath}'); debugPrint('Source app: ${snapshot.sourceApp}'); debugPrint('Timestamp: ${snapshot.timestamp}'); }); _noScreenshot.startScreenshotListening(); } @override void dispose() { _noScreenshot.stopScreenshotListening(); _sub?.cancel(); super.dispose(); } @override Widget build(BuildContext context) => const Placeholder(); } ``` -------------------------------- ### Screen Recording Detection Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Starts or stops native screen-recording detection. Changes in screen recording status are emitted via the `screenshotStream`. ```APIDOC ## `startScreenRecordingListening()` / `stopScreenRecordingListening()` ### Description Starts or stops native screen-recording detection, which emits `isScreenRecording` changes via the same `screenshotStream`. Recording monitoring is independent of screenshot monitoring — both can run simultaneously. ### Methods - `startScreenRecordingListening()`: Begins listening for screen recording events. - `stopScreenRecordingListening()`: Stops listening for screen recording events. ### Usage Example ```dart import 'package:no_screenshot/no_screenshot.dart'; final _ns = NoScreenshot.instance; // Start listening _ns.startScreenRecordingListening(); // Listen for changes _ns.screenshotStream.listen((snapshot) { if (snapshot.isScreenRecording) { print('Screen recording detected!'); } }); // Stop listening (e.g. in dispose) _ns.stopScreenRecordingListening(); ``` ``` -------------------------------- ### Start and Stop Screen Recording Detection Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Initiates and terminates native screen recording detection. This feature is independent of screenshot monitoring and can be used concurrently. ```dart import 'package:flutter/widgets.dart'; import 'package:no_screenshot/no_screenshot.dart'; class RecordingAwarePage extends StatefulWidget { const RecordingAwarePage({super.key}); @override State createState() => _RecordingAwarePageState(); } class _RecordingAwarePageState extends State { final _ns = NoScreenshot.instance; @override void initState() { super.initState(); _ns.screenshotStream.listen((snapshot) { if (snapshot.isScreenRecording) { debugPrint('WARNING: Screen is being recorded!'); // e.g. show an in-app warning banner } }); _ns.startScreenRecordingListening(); } @override void dispose() { _ns.stopScreenRecordingListening(); super.dispose(); } @override Widget build(BuildContext context) => const Placeholder(); } ``` -------------------------------- ### Listen for Screenshot Events in Real Time Source: https://github.com/flutterplaza/no_screenshot/blob/development/README.md Subscribe to the screenshot stream to receive real-time updates on screenshot activity. Ensure you start monitoring explicitly and stop it when no longer needed. ```dart final _noScreenshot = NoScreenshot.instance; // 1. Subscribe to the stream _noScreenshot.screenshotStream.listen((snapshot) { debugPrint('Protection active: ${snapshot.isScreenshotProtectionOn}'); debugPrint('Screenshot taken: ${snapshot.wasScreenshotTaken}'); debugPrint('Path: ${snapshot.screenshotPath}'); }); // 2. Start monitoring await _noScreenshot.startScreenshotListening(); // 3. Stop monitoring when no longer needed await _noScreenshot.stopScreenshotListening(); ``` -------------------------------- ### screenshotStream Source: https://context7.com/flutterplaza/no_screenshot/llms.txt A broadcast `Stream` that emits whenever a screenshot event occurs. Monitoring is **off by default** and must be started explicitly using `startScreenshotListening()` and stopped with `stopScreenshotListening()`. ```APIDOC ## screenshotStream ### Description Provides a real-time stream of screenshot and screen recording events. ### Stream ```dart Stream get screenshotStream ``` ### Event Data (`ScreenshotSnapshot`) - `wasScreenshotTaken` (bool): `true` when a screenshot was just captured. - `isScreenshotProtectionOn` (bool): Current protection state. - `screenshotPath` (String): File path (macOS & Linux only). - `isScreenRecording` (bool): Whether recording is active. - `timestamp` (int): Milliseconds since epoch (0 = unknown). - `sourceApp` (String): The app that triggered the event. ``` ```APIDOC ## startScreenshotListening() ### Description Starts listening for screenshot and screen recording events. This must be called before `screenshotStream` will emit any events. ### Method ```dart Future startScreenshotListening() ``` ``` ```APIDOC ## stopScreenshotListening() ### Description Stops listening for screenshot and screen recording events. ### Method ```dart Future stopScreenshotListening() ``` ``` -------------------------------- ### Detect Screen Recording Events Source: https://github.com/flutterplaza/no_screenshot/blob/development/README.md Monitor for screen recording events using the same stream as screenshot events. Start and stop recording monitoring independently of screenshot monitoring. ```dart final _noScreenshot = NoScreenshot.instance; // 1. Subscribe to the stream (same stream as screenshot events) _noScreenshot.screenshotStream.listen((snapshot) { if (snapshot.isScreenRecording) { debugPrint('Screen is being recorded!'); } }); // 2. Start recording monitoring await _noScreenshot.startScreenRecordingListening(); // 3. Stop recording monitoring when no longer needed await _noScreenshot.stopScreenRecordingListening(); ``` -------------------------------- ### Force X11 Backend for Release Builds Source: https://github.com/flutterplaza/no_screenshot/blob/development/README.md For release builds or desktop shortcuts on Linux, launch the application with the X11 backend by setting the GDK_BACKEND environment variable. ```bash GDK_BACKEND=x11 ./your_app ``` -------------------------------- ### Project and Build Configuration Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/linux/CMakeLists.txt Sets up the minimum CMake version, project name, executable name, and application ID. It also configures build type and standard compilation settings. ```cmake cmake_minimum_required(VERSION 3.13) project(runner LANGUAGES CXX) set(BINARY_NAME "no_screenshot_example") set(APPLICATION_ID "com.flutterplaza.no_screenshot_example") cmake_policy(SET CMP0063 NEW) set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") if(FLUTTER_TARGET_PLATFORM_SYSROOT) set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) endif() if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Profile" "Release") endif() ``` -------------------------------- ### Add Dependency Libraries and Include Directories Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/windows/runner/CMakeLists.txt Links necessary libraries (flutter, flutter_wrapper_app, dwmapi.lib) and adds the source directory to include paths. Add any other application-specific dependencies here. ```cmake target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") ``` -------------------------------- ### Plugin Instance Source: https://github.com/flutterplaza/no_screenshot/blob/development/README.md Access the singleton instance of the NoScreenshot plugin. ```APIDOC ## NoScreenshot.instance ### Description Singleton instance of the plugin. ### Method Accessor ### Return Type `NoScreenshot` ``` -------------------------------- ### Apply Standard Build Settings Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/windows/runner/CMakeLists.txt Applies a standard set of build settings to the application target. This can be customized or removed if the application requires different build configurations. ```cmake apply_standard_settings(${BINARY_NAME}) ``` -------------------------------- ### Runtime Output Directory Configuration Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/linux/CMakeLists.txt Configures the runtime output directory for the binary to a specific subdirectory to prevent accidental execution of unbundled copies. ```cmake set_target_properties(${BINARY_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" ) ``` -------------------------------- ### Force X11 Backend on Linux Source: https://github.com/flutterplaza/no_screenshot/blob/development/README.md When running on Linux with Wayland, Flutter might render a black screen. Force the X11 backend by setting the GDK_BACKEND environment variable. ```bash GDK_BACKEND=x11 flutter run -d linux ``` -------------------------------- ### Find and Link System Libraries with CMake Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/linux/flutter/CMakeLists.txt This section uses PkgConfig to find and check for required system libraries like GTK, GLIB, and GIO. These are essential for Flutter's Linux desktop integration. ```cmake find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) ``` -------------------------------- ### Granular Callbacks Source: https://github.com/flutterplaza/no_screenshot/blob/development/README.md APIs for setting up and managing granular callbacks for specific screenshot and recording events. ```APIDOC ## onScreenshotDetected ### Description Callback fired when a screenshot is detected. ### Return Type `ScreenshotEventCallback?` ## onScreenRecordingStarted ### Description Callback fired when screen recording starts. ### Return Type `ScreenshotEventCallback?` ## onScreenRecordingStopped ### Description Callback fired when screen recording stops. ### Return Type `ScreenshotEventCallback?` ## startCallbacks() ### Description Start dispatching events to registered callbacks. ### Method `void` ## stopCallbacks() ### Description Stop dispatching events (keeps callback assignments). ### Method `void` ## removeAllCallbacks() ### Description Clear all callbacks and stop dispatching. ### Method `void` ## hasActiveCallbacks ### Description Whether callbacks are currently being dispatched. ### Return Type `bool` ``` -------------------------------- ### SecureNavigatorObserver + SecureRouteConfig Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Implement per-route protection policies using `SecureNavigatorObserver` and `SecureRouteConfig`. This observer automatically applies the specified protection mode based on the named route being navigated to. ```APIDOC ## `SecureNavigatorObserver` + `SecureRouteConfig` — Per-Route Protection Policies A `NavigatorObserver` that maps named routes to `SecureRouteConfig` objects, automatically applying the correct protection mode on push, pop, replace, and remove navigation events. ```dart import 'package:flutter/material.dart'; import 'package:no_screenshot/secure_navigator_observer.dart'; import 'package:no_screenshot/overlay_mode.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( navigatorObservers: [ SecureNavigatorObserver( policies: { '/payment': SecureRouteConfig(mode: OverlayMode.secure), '/profile': SecureRouteConfig(mode: OverlayMode.blur, blurRadius: 50.0), '/home': SecureRouteConfig(mode: OverlayMode.none), '/branded': SecureRouteConfig(mode: OverlayMode.color, color: 0xFF2196F3), '/docs': SecureRouteConfig(mode: OverlayMode.image), }, // Unmapped routes fall back to no protection defaultConfig: SecureRouteConfig(mode: OverlayMode.none), ), ], routes: { '/home': (_) => const HomePage(), '/payment': (_) => const PaymentPage(), '/profile': (_) => const ProfilePage(), '/branded': (_) => const BrandedPage(), '/docs': (_) => const DocsPage(), }, initialRoute: '/home', ); } } ``` ``` -------------------------------- ### Granular Callbacks Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Register typed callbacks for specific events like screenshot detection and screen recording start/stop. Use `startCallbacks()` to begin dispatching events and `stopCallbacks()` or `removeAllCallbacks()` to pause or clear them. ```APIDOC ## Granular Callbacks — `onScreenshotDetected`, `onScreenRecordingStarted`, `onScreenRecordingStopped` Instead of filtering the raw stream, register typed callbacks for specific events. `startCallbacks()` begins dispatching; `stopCallbacks()` pauses without clearing assignments; `removeAllCallbacks()` clears everything. ```dart import 'package:no_screenshot/no_screenshot.dart'; final _ns = NoScreenshot.instance; void setupCallbacks() { // Register targeted handlers _ns.onScreenshotDetected = (ScreenshotSnapshot snapshot) { debugPrint('Screenshot at ${snapshot.timestamp} by ${snapshot.sourceApp}'); debugPrint('Path: ${snapshot.screenshotPath}'); // e.g. log to analytics, show a warning dialog }; _ns.onScreenRecordingStarted = (ScreenshotSnapshot snapshot) { debugPrint('Recording started — locking sensitive UI'); _ns.screenshotOff(); }; _ns.onScreenRecordingStopped = (ScreenshotSnapshot snapshot) { debugPrint('Recording stopped — restoring UI'); _ns.screenshotOn(); }; // Requires the screenshot / recording streams to be active _ns.startScreenshotListening(); _ns.startScreenRecordingListening(); _ns.startCallbacks(); debugPrint('Callbacks active: ${_ns.hasActiveCallbacks}'); // true } void teardownCallbacks() { _ns.removeAllCallbacks(); // stops dispatching and clears all three handlers _ns.stopScreenshotListening(); _ns.stopScreenRecordingListening(); } ``` ``` -------------------------------- ### Toggle and Enable Image Overlay in App Switcher Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Manages a custom image asset displayed in the OS app-switcher instead of live app content. Ensure the overlay image is placed in the platform-specific asset path before use. ```dart import 'package:no_screenshot/no_screenshot.dart'; // Asset placement (one-time setup per platform): // Android : android/app/src/main/res/drawable/no_screenshot_image.png // iOS/macOS: Runner/Assets.xcassets/NoScreenshotImage.imageset/ final _ns = NoScreenshot.instance; // Toggle on/off — returns the new active state Future toggleImageOverlay() async { final bool isNowActive = await _ns.toggleScreenshotWithImage(); debugPrint('Image overlay active: $isNowActive'); } // Always enable (idempotent — safe to call multiple times) Future enableImageOverlay() async { final bool enabled = await _ns.screenshotWithImage(); debugPrint('Image overlay enabled: $enabled'); } ``` -------------------------------- ### Include Generated Plugin Rules Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/linux/CMakeLists.txt Includes the CMake file that manages the building and integration of generated plugins into the application. ```cmake include(flutter/generated_plugins.cmake) ``` -------------------------------- ### Widgets Source: https://github.com/flutterplaza/no_screenshot/blob/development/README.md Declarative UI components for integrating screenshot protection directly into widgets. ```APIDOC ## SecureWidget ### Description Declarative protection — enables on mount, disables on unmount. ### Type `StatefulWidget` ## SecureNavigatorObserver ### Description Per-route protection policies via named route mapping. ### Type `NavigatorObserver` ## SecureRouteConfig ### Description Configuration for a route's protection mode, blur radius, and color. ### Type `class` ## OverlayMode ### Description Enum for different overlay modes. ### Enum Values - `none` - `secure` - `blur` - `color` - `image` ### Type `enum` ``` -------------------------------- ### Image Overlay in App Switcher Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Shows a custom image asset in the OS app-switcher instead of the live app content. `toggleScreenshotWithImage()` flips the state; `screenshotWithImage()` always enables it. ```APIDOC ## `toggleScreenshotWithImage()` / `screenshotWithImage()` ### Description Shows a custom image asset in the OS app-switcher instead of the live app content. `toggleScreenshotWithImage()` flips the state; `screenshotWithImage()` always enables it (idempotent). The overlay image must be placed at the platform-specific asset path before calling these methods. ### Methods - `toggleScreenshotWithImage()`: Toggles the image overlay on or off. Returns the new active state. - `screenshotWithImage()`: Ensures the image overlay is enabled. This method is idempotent. ### Asset Placement - Android: `android/app/src/main/res/drawable/no_screenshot_image.png` - iOS/macOS: `Runner/Assets.xcassets/NoScreenshotImage.imageset/` ### Usage Example ```dart import 'package:no_screenshot/no_screenshot.dart'; final _ns = NoScreenshot.instance; // Toggle the image overlay Future toggleImageOverlay() async { final bool isNowActive = await _ns.toggleScreenshotWithImage(); print('Image overlay active: $isNowActive'); } // Always enable the image overlay Future enableImageOverlay() async { final bool enabled = await _ns.screenshotWithImage(); print('Image overlay enabled: $enabled'); } ``` ``` -------------------------------- ### Flutter and System Dependencies Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/linux/CMakeLists.txt Includes the Flutter managed directory and checks for GTK+ 3.0 system dependencies using PkgConfig. ```cmake set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) add_subdirectory("runner") add_dependencies(${BINARY_NAME} flutter_assemble) ``` -------------------------------- ### Add Include Directories Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/linux/runner/CMakeLists.txt Specifies the include directories for the application, making source files accessible during compilation. ```cmake target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") ``` -------------------------------- ### Listening for Screenshot Events Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/README.md Subscribe to `screenshotStream` to receive real-time `ScreenshotSnapshot` objects. Ensure `startScreenshotListening()` is called to begin monitoring. The snapshot provides details like protection status, recording status, and source app. ```dart noScreenshot.screenshotStream.listen((snapshot) { print('Protection: ${snapshot.isScreenshotProtectionOn}'); print('Screenshot taken: ${snapshot.wasScreenshotTaken}'); print('Recording: ${snapshot.isScreenRecording}'); print('Timestamp: ${snapshot.timestamp}'); print('Source app: ${snapshot.sourceApp}'); }); await noScreenshot.startScreenshotListening(); ``` -------------------------------- ### Register Granular Callbacks for Events Source: https://github.com/flutterplaza/no_screenshot/blob/development/README.md Register targeted callbacks for screenshot and screen recording events. Ensure native monitoring is active by calling startScreenshotListening() and/or startScreenRecordingListening(). ```dart final _noScreenshot = NoScreenshot.instance; // Register callbacks _noScreenshot.onScreenshotDetected = (snapshot) { debugPrint('Screenshot taken! Path: ${snapshot.screenshotPath}'); debugPrint('Timestamp: ${snapshot.timestamp}'); debugPrint('Source app: ${snapshot.sourceApp}'); }; _noScreenshot.onScreenRecordingStarted = (snapshot) { debugPrint('Screen recording started!'); }; _noScreenshot.onScreenRecordingStopped = (snapshot) { debugPrint('Screen recording stopped.'); }; // Start dispatching events (requires screenshot/recording listening to be active) _noScreenshot.startCallbacks(); // Stop dispatching (keeps callback assignments) _noScreenshot.stopCallbacks(); // Remove all callbacks and stop dispatching _noScreenshot.removeAllCallbacks(); ``` -------------------------------- ### screenshotOff() Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Activates platform-level screenshot and screen-recording prevention. Returns `true` when protection is successfully enabled (or was already enabled), `false` on failure. ```APIDOC ## screenshotOff() ### Description Activates platform-level screenshot and screen-recording prevention. ### Method ```dart Future screenshotOff() ``` ### Returns - `Future`: Returns `true` when protection is successfully enabled (or was already enabled), `false` on failure. ``` -------------------------------- ### Color Overlay in App Switcher Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Shows a solid ARGB color over the app in the OS app-switcher. The `color` parameter defaults to opaque black (`0xFF000000`). ```APIDOC ## `toggleScreenshotWithColor()` / `screenshotWithColor()` ### Description Shows a solid ARGB color over the app in the OS app-switcher. The `color` parameter defaults to opaque black (`0xFF000000`). Mutually exclusive with blur and image overlays. ### Methods - `toggleScreenshotWithColor([int color = 0xFF000000])`: Toggles the color overlay on or off. Returns the new active state. - `screenshotWithColor([int color = 0xFF000000])`: Ensures the color overlay is enabled. This method is idempotent. ### Parameters - `color` (int, Optional): The ARGB color to display. Defaults to opaque black (`0xFF000000`). ### Usage Example ```dart import 'package:no_screenshot/no_screenshot.dart'; final _ns = NoScreenshot.instance; // Toggle with default color (opaque black) Future toggleBlack() async { final bool isNowActive = await _ns.toggleScreenshotWithColor(); print('Color overlay active: $isNowActive'); } // Toggle with a custom ARGB color (opaque blue) Future toggleBlue() async { final bool isNowActive = await _ns.toggleScreenshotWithColor(color: 0xFF2196F3); print('Color overlay active: $isNowActive'); } // Always enable idempotently with a brand color Future enableBrandOverlay() async { await _ns.screenshotWithColor(color: 0xFF6200EE); // Material purple } ``` ``` -------------------------------- ### Overlay Modes Source: https://github.com/flutterplaza/no_screenshot/blob/development/README.md Methods to apply different overlay modes for screenshot protection. ```APIDOC ## toggleScreenshotWithImage() ### Description Toggle image overlay mode (returns new state). ### Method `Future` ## toggleScreenshotWithBlur({double blurRadius = 30.0}) ### Description Toggle blur overlay mode with optional radius (returns new state). ### Parameters #### Path Parameters - **blurRadius** (double) - Optional - Default: 30.0 - The radius for the blur effect. ### Method `Future` ## toggleScreenshotWithColor({int color = 0xFF000000}) ### Description Toggle solid color overlay mode with optional ARGB color (returns new state). ### Parameters #### Path Parameters - **color** (int) - Optional - Default: 0xFF000000 - The ARGB color for the overlay. ### Method `Future` ## screenshotWithImage() ### Description Always enable image overlay (idempotent). ### Method `Future` ## screenshotWithBlur({double blurRadius = 30.0}) ### Description Always enable blur overlay (idempotent). ### Parameters #### Path Parameters - **blurRadius** (double) - Optional - Default: 30.0 - The radius for the blur effect. ### Method `Future` ## screenshotWithColor({int color = 0xFF000000}) ### Description Always enable color overlay (idempotent). ### Parameters #### Path Parameters - **color** (int) - Optional - Default: 0xFF000000 - The ARGB color for the overlay. ### Method `Future` ``` -------------------------------- ### Configuring Granular Callbacks Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/README.md Set `onScreenshotDetected` to a callback function that executes when a screenshot is taken. Call `startCallbacks()` to activate these granular event listeners. ```dart // Granular callbacks noScreenshot.onScreenshotDetected = (snapshot) { print('Screenshot detected!'); }; noScreenshot.startCallbacks(); ``` -------------------------------- ### Add Preprocessor Definitions Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/linux/runner/CMakeLists.txt Adds preprocessor definitions for the application ID, making it available during compilation. ```cmake add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") ``` -------------------------------- ### applyOverlayMode Function Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Applies an overlay mode imperatively for screenshot and screen recording protection. This function is idempotent and can be used for one-shot application of protection strategies. ```APIDOC ## `applyOverlayMode()` Applies an overlay mode imperatively. ### Parameters - **mode** (`OverlayMode`) - Required - The protection mode to apply. - **blurRadius** (`double`) - Optional - The blur radius to use when `mode` is `OverlayMode.blur`. - **color** (`int`) - Optional - The solid color to use when `mode` is `OverlayMode.color`. ### Request Example ```dart Future applyProtection(OverlayMode mode) async { await applyOverlayMode( mode, blurRadius: 45.0, // only used when mode == OverlayMode.blur color: 0xFF000000, // only used when mode == OverlayMode.color ); } Future handleSensitiveData(bool isSensitive) async { await applyOverlayMode( isSensitive ? OverlayMode.secure : OverlayMode.none, ); } ``` ### Response This function returns a `Future` and does not return any specific data upon completion. ``` -------------------------------- ### Define Application Executable Target Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/windows/runner/CMakeLists.txt Defines the main executable for the Windows application. Ensure BINARY_NAME is consistent with the top-level CMakeLists.txt for `flutter run` to function correctly. Add any new source files to this list. ```cmake add_executable(${BINARY_NAME} WIN32 "flutter_window.cpp" "main.cpp" "utils.cpp" "win32_window.cpp" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" "Runner.rc" "runner.exe.manifest" ) ``` -------------------------------- ### Integrate Flutter Tool Build Steps Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/windows/runner/CMakeLists.txt Ensures that the Flutter tool's build artifacts are included in the application's build process. This dependency is crucial and should not be removed. ```cmake add_dependencies(${BINARY_NAME} flutter_assemble) ``` -------------------------------- ### Apply Overlay Protection Modes Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Use `applyOverlayMode()` for one-shot imperative application of protection. Specify `blurRadius` for blur mode and `color` for color mode. ```dart import 'package:no_screenshot/overlay_mode.dart'; // OverlayMode values: // OverlayMode.none → re-enables screenshots (no protection) // OverlayMode.secure → blocks screenshots and screen recording (FLAG_SECURE / equivalent) // OverlayMode.blur → Gaussian blur overlay in app switcher // OverlayMode.color → solid color overlay in app switcher // OverlayMode.image → custom image overlay in app switcher // Use applyOverlayMode() for one-shot imperative application: Future applyProtection(OverlayMode mode) async { await applyOverlayMode( mode, blurRadius: 45.0, // only used when mode == OverlayMode.blur color: 0xFF000000, // only used when mode == OverlayMode.color ); } // Example: dynamically switch modes based on app state Future handleSensitiveData(bool isSensitive) async { await applyOverlayMode( isSensitive ? OverlayMode.secure : OverlayMode.none, ); } ``` -------------------------------- ### SecureWidget Source: https://context7.com/flutterplaza/no_screenshot/llms.txt A `StatefulWidget` wrapper that automatically applies screenshot protection when mounted and re-enables it when unmounted. Supports various `OverlayMode` values for different protection levels. ```APIDOC ## `SecureWidget` — Declarative Widget-Tree Protection A `StatefulWidget` wrapper that automatically calls the correct `NoScreenshot` API when mounted and re-enables screenshots when unmounted. Supports all `OverlayMode` values. ```dart import 'package:no_screenshot/secure_widget.dart'; import 'package:no_screenshot/overlay_mode.dart'; // Block all captures on a payment screen Widget paymentPage() => SecureWidget( mode: OverlayMode.secure, child: PaymentScreen(), ); // Blur the app-switcher thumbnail on a profile page Widget profilePage() => SecureWidget( mode: OverlayMode.blur, blurRadius: 50.0, child: ProfileScreen(), ); // Show a branded color in the app switcher Widget brandedPage() => SecureWidget( mode: OverlayMode.color, color: 0xFF2196F3, // opaque blue child: BrandedScreen(), ); // Show a custom image asset in the app switcher Widget imageProtectedPage() => SecureWidget( mode: OverlayMode.image, child: SensitiveScreen(), ); // No protection (re-enables screenshots on mount — useful to explicitly reset) Widget publicPage() => SecureWidget( mode: OverlayMode.none, child: PublicScreen(), ); ``` ``` -------------------------------- ### screenshotOn() Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Removes screenshot and screen-recording prevention, restoring normal OS behavior. Returns `true` on success. ```APIDOC ## screenshotOn() ### Description Removes screenshot and screen-recording prevention, restoring normal OS behavior. ### Method ```dart Future screenshotOn() ``` ### Returns - `Future`: Returns `true` on success. ``` -------------------------------- ### SecureNavigatorObserver for Per-Route Protection Policies Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Implement `NavigatorObserver` to define protection policies for named routes using `SecureRouteConfig`. This automatically applies protection modes on navigation events. Unmapped routes default to no protection. ```dart import 'package:flutter/material.dart'; import 'package:no_screenshot/secure_navigator_observer.dart'; import 'package:no_screenshot/overlay_mode.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( navigatorObservers: [ SecureNavigatorObserver( policies: { '/payment': SecureRouteConfig(mode: OverlayMode.secure), '/profile': SecureRouteConfig(mode: OverlayMode.blur, blurRadius: 50.0), '/home': SecureRouteConfig(mode: OverlayMode.none), '/branded': SecureRouteConfig(mode: OverlayMode.color, color: 0xFF2196F3), '/docs': SecureRouteConfig(mode: OverlayMode.image), }, // Unmapped routes fall back to no protection defaultConfig: SecureRouteConfig(mode: OverlayMode.none), ), ], routes: { '/home': (_) => const HomePage(), '/payment': (_) => const PaymentPage(), '/profile': (_) => const ProfilePage(), '/branded': (_) => const BrandedPage(), '/docs': (_) => const DocsPage(), }, initialRoute: '/home', ); } } ``` -------------------------------- ### Re-enable Screenshots and Screen Recording Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Call `screenshotOn()` to remove prevention and restore normal OS behavior. Returns true on success. ```dart import 'package:no_screenshot/no_screenshot.dart'; final _noScreenshot = NoScreenshot.instance; Future unlockScreen() async { final bool success = await _noScreenshot.screenshotOn(); debugPrint('Screenshot protection removed: $success'); } ``` -------------------------------- ### Link Dependency Libraries Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/linux/runner/CMakeLists.txt Links the necessary libraries for the Flutter application, including the Flutter engine and GTK. Add any other application-specific dependencies here. ```cmake target_link_libraries(${BINARY_NAME} PRIVATE flutter) target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) ``` -------------------------------- ### Toggle and Enable Color Overlay in App Switcher Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Applies a solid ARGB color over the app in the OS app-switcher. The color defaults to opaque black (0xFF000000). This overlay is mutually exclusive with blur and image overlays. ```dart import 'package:no_screenshot/no_screenshot.dart'; final _ns = NoScreenshot.instance; // Toggle with default color (opaque black) Future toggleBlack() async { final bool isNowActive = await _ns.toggleScreenshotWithColor(); debugPrint('Color overlay active: $isNowActive'); } // Toggle with a custom ARGB color (opaque blue) Future toggleBlue() async { final bool isNowActive = await _ns.toggleScreenshotWithColor(color: 0xFF2196F3); debugPrint('Color overlay active: $isNowActive'); } // Always enable idempotently with a brand color Future enableBrandOverlay() async { await _ns.screenshotWithColor(color: 0xFF6200EE); // Material purple } ``` -------------------------------- ### Define Executable Target Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/linux/runner/CMakeLists.txt Defines the main executable for the Flutter application. Ensure BINARY_NAME is consistent with the top-level CMakeLists.txt for `flutter run` to function correctly. Add any new application source files to this list. ```cmake add_executable(${BINARY_NAME} "main.cc" "my_application.cc" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" ) ``` -------------------------------- ### Enable Swift Package Manager for Flutter Source: https://github.com/flutterplaza/no_screenshot/blob/development/README.md Configure your Flutter environment to use Swift Package Manager for iOS and macOS projects. This is an optional step if you are not using CocoaPods. ```bash flutter config --enable-swift-package-manager flutter create my_app ``` -------------------------------- ### SecureWidget for Declarative Protection Source: https://github.com/flutterplaza/no_screenshot/blob/development/README.md Wraps a widget subtree with protection. Protection is enabled on mount and disabled on unmount automatically. Choose from various overlay modes like blur, secure, color, or image. ```dart import 'package:no_screenshot/secure_widget.dart'; import 'package:no_screenshot/overlay_mode.dart'; // Protect a page with blur overlay SecureWidget( mode: OverlayMode.blur, blurRadius: 50.0, child: MySecurePage(), ) // Protect with full screenshot block SecureWidget( mode: OverlayMode.secure, child: PaymentScreen(), ) // Protect with solid color overlay SecureWidget( mode: OverlayMode.color, color: 0xFF000000, child: ConfidentialScreen(), ) ``` -------------------------------- ### Toggle and Enable Blur Overlay in App Switcher Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Applies a Gaussian blur to the app's current content for the OS app-switcher. The blur radius defaults to 30.0. This overlay is mutually exclusive with image and color overlays. ```dart import 'package:no_screenshot/no_screenshot.dart'; final _ns = NoScreenshot.instance; // Toggle with default radius (30.0) Future toggleBlur() async { final bool isNowActive = await _ns.toggleScreenshotWithBlur(); debugPrint('Blur overlay active: $isNowActive'); } // Toggle with a custom radius Future toggleStrongBlur() async { final bool isNowActive = await _ns.toggleScreenshotWithBlur(blurRadius: 50.0); debugPrint('Blur overlay active: $isNowActive'); } // Always enable idempotently Future enableBlur() async { await _ns.screenshotWithBlur(blurRadius: 40.0); } ``` -------------------------------- ### Add Preprocessor Definitions for Build Version Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/windows/runner/CMakeLists.txt Adds preprocessor definitions to include Flutter version information directly into the build. This is useful for conditional compilation or runtime checks based on the Flutter version. ```cmake target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"" target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}" target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}" target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}" target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") ``` -------------------------------- ### Define list_prepend Function in CMake Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/linux/flutter/CMakeLists.txt This custom CMake function prepends a prefix to each element in a list. It's used here as a workaround for older CMake versions that lack the list(TRANSFORM ... PREPEND ...) command. ```cmake function(list_prepend LIST_NAME PREFIX) set(NEW_LIST "") foreach(element ${${LIST_NAME}}) list(APPEND NEW_LIST "${PREFIX}${element}") endforeach(element) set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) endfunction() ``` -------------------------------- ### Apply Standard Compilation Settings Function Source: https://github.com/flutterplaza/no_screenshot/blob/development/example/linux/CMakeLists.txt Defines a function to apply common compilation features and options to a target, including C++ standard, warning flags, optimization levels, and NDEBUG definition. ```cmake function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_14) target_compile_options(${TARGET} PRIVATE -Wall -Werror) target_compile_options(${TARGET} PRIVATE "<$>:-O3>") target_compile_definitions(${TARGET} PRIVATE "<$>:NDEBUG>") endfunction() ``` -------------------------------- ### Usage: Enable Screenshots Source: https://github.com/flutterplaza/no_screenshot/blob/development/README.md Call the screenshotOn method to re-enable screenshots and screen recording. This method returns a boolean indicating success. ```dart final _noScreenshot = NoScreenshot.instance; // Enable screenshots (returns true on success) Future enableScreenshot() async { final result = await _noScreenshot.screenshotOn(); debugPrint('screenshotOn: $result'); } ``` -------------------------------- ### Blur Overlay in App Switcher Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Applies a Gaussian blur to the app's current content in the OS app-switcher. The `blurRadius` parameter defaults to `30.0`. ```APIDOC ## `toggleScreenshotWithBlur()` / `screenshotWithBlur()` ### Description Applies a Gaussian blur of the app's current content in the OS app-switcher. No asset is required. The `blurRadius` parameter defaults to `30.0`. Blur, color, and image overlays are mutually exclusive — enabling one disables the others at the native layer. ### Methods - `toggleScreenshotWithBlur([double blurRadius = 30.0])`: Toggles the blur overlay on or off. Returns the new active state. - `screenshotWithBlur([double blurRadius = 30.0])`: Ensures the blur overlay is enabled. This method is idempotent. ### Parameters - `blurRadius` (double, Optional): The radius for the Gaussian blur. Defaults to `30.0`. ### Usage Example ```dart import 'package:no_screenshot/no_screenshot.dart'; final _ns = NoScreenshot.instance; // Toggle with default radius Future toggleBlur() async { final bool isNowActive = await _ns.toggleScreenshotWithBlur(); print('Blur overlay active: $isNowActive'); } // Toggle with a custom radius Future toggleStrongBlur() async { final bool isNowActive = await _ns.toggleScreenshotWithBlur(blurRadius: 50.0); print('Blur overlay active: $isNowActive'); } // Always enable idempotently with a custom radius Future enableBlur() async { await _ns.screenshotWithBlur(blurRadius: 40.0); } ``` ``` -------------------------------- ### SecureWidget for Declarative Widget-Tree Protection Source: https://context7.com/flutterplaza/no_screenshot/llms.txt Wrap widgets with `SecureWidget` to automatically manage screenshot protection. Supports various `OverlayMode` values like secure, blur, color, image, and none. Protection is applied on mount and re-enabled on unmount. ```dart import 'package:no_screenshot/secure_widget.dart'; import 'package:no_screenshot/overlay_mode.dart'; // Block all captures on a payment screen Widget paymentPage() => SecureWidget( mode: OverlayMode.secure, child: PaymentScreen(), ); // Blur the app-switcher thumbnail on a profile page Widget profilePage() => SecureWidget( mode: OverlayMode.blur, blurRadius: 50.0, child: ProfileScreen(), ); // Show a branded color in the app switcher Widget brandedPage() => SecureWidget( mode: OverlayMode.color, color: 0xFF2196F3, // opaque blue child: BrandedScreen(), ); // Show a custom image asset in the app switcher Widget imageProtectedPage() => SecureWidget( mode: OverlayMode.image, child: SensitiveScreen(), ); // No protection (re-enables screenshots on mount — useful to explicitly reset) Widget publicPage() => SecureWidget( mode: OverlayMode.none, child: PublicScreen(), ); ``` -------------------------------- ### Per-Route Protection Policies with SecureNavigatorObserver Source: https://github.com/flutterplaza/no_screenshot/blob/development/README.md Applies different protection levels to specific routes using SecureNavigatorObserver. Add it to your MaterialApp's navigatorObservers. Unmapped routes use the defaultConfig. ```dart import 'package:no_screenshot/secure_navigator_observer.dart'; import 'package:no_screenshot/overlay_mode.dart'; MaterialApp( navigatorObservers: [ SecureNavigatorObserver( policies: { '/payment': SecureRouteConfig(mode: OverlayMode.secure), '/profile': SecureRouteConfig(mode: OverlayMode.blur, blurRadius: 50.0), '/home': SecureRouteConfig(mode: OverlayMode.none), '/branded': SecureRouteConfig(mode: OverlayMode.color, color: 0xFF2196F3), }, defaultConfig: SecureRouteConfig(mode: OverlayMode.none), // for unmapped routes ), ], routes: { '/home': (_) => HomePage(), '/payment': (_) => PaymentPage(), '/profile': (_) => ProfilePage(), '/branded': (_) => BrandedPage(), }, ) ``` -------------------------------- ### Screenshot and Recording Control Source: https://github.com/flutterplaza/no_screenshot/blob/development/README.md Methods to enable, disable, or toggle screenshot and screen recording protection. ```APIDOC ## screenshotOff() ### Description Disable screenshots & screen recording. ### Method `Future` ## screenshotOn() ### Description Enable screenshots & screen recording. ### Method `Future` ## toggleScreenshot() ### Description Toggle screenshot protection on/off. ### Method `Future` ```