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

secure_app_switcher 封面
插件详情v1.0.0

secure_app_switcher

在应用切换器或任务列表中对应用屏幕应用安全遮蔽效果。

AndroidiOS
近 30 天下载
774
喜欢数
37
Pub 分数
150

安装插件

flutter pub add secure_app_switcher

插件介绍

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

secure_app_switcher 包通过在设备的应用切换器或任务列表中对应用屏幕预览应用遮罩效果,增强了应用隐私。这可以防止用户在滑动浏览打开的应用时看到敏感内容,为 Android 和 iOS 设备提供额外的安全层。该包可轻松集成到 Flutter 应用中,配置极少,确保应用在多任务处理期间的视觉状态保持隐藏。对于处理机密数据的应用(如银行、医疗或消息平台)尤其有用。

适合场景

  • 保护应用切换器中的敏感UI预览
  • 保护金融或医疗应用
  • 防止意外暴露私有内容
  • 在多用户环境中增强隐私
  • 遵守数据保护法规

主要特点

  • 在任务切换器中预览遮蔽应用
  • 跨平台支持(Android 和 iOS)
  • 所需设置最少
  • 无运行时性能影响
  • 无需修改应用逻辑即可工作

适合对象

  • 注重隐私的应用程序
  • 处理个人或机密数据的应用程序
  • 开发人员优先考虑用户安全
  • 企业级移动应用
  • 需要增强隐私控制的Flutter项目

使用建议

  • 需要平台特定的权限
  • 可能不适用于所有设备制造商
  • 仅限视觉遮蔽,不支持完整应用隔离
  • 不影响在切换器外部拍摄的截图
  • 取决于操作系统级别的行为,可能会有所不同

原始 README

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

secure_app_switcher

Apply a safe masking effect to the app screen on the app switcher or task list.

Functions can be enabled/disabled within any process. It also provides a mechanism for switching functions on a screen-by-screen basis.

The effect is different for iOS and Android.

Usage

Use functions within arbitrary processing
import 'package:secure_app_switcher/secure_app_switcher.dart';

// ON
SecureAppSwitcher.on();

// OFF
SecureAppSwitcher.off();
Use functions on specific screens

It is necessary to set secureAppSwitcherRouteObserver to switch the function at the time of screen transition.

Wrap the target screen widget with MaterialPageRoute and SecureAppSwitcherPage.

  • secureAppSwitcherRouteObserver
@override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Secure App Switcher',
      onGenerateRoute: generateRoute,
      navigatorObservers: [secureAppSwitcherRouteObserver], // add
      initialRoute: '/',
    );
  }
  • SecureAppSwitcherPage, MaterialPageRoute
// Example: Case where the function is enabled on screen A

Route<dynamic> generateRoute(RouteSettings settings) {
  switch (settings.name) {
    case "/":
      return MaterialPageRoute(builder: (context) {
        return const HomeScreen();
      });    
    case "/screenA":
      return MaterialPageRoute(builder: (context) {
        return const SecureAppSwitcherPage( // add
          style: SecureMaskStyle.dark,
          child: ScreenA(),
        );
      });
  }
}

iOS

For iOS, you can specify the type of mask effect.

SecureAppSwitcher.on(iosStyle: SecureMaskStyle.blurLight);
  • Types of mask effects
Light Dark BlurLight BlurDark

Android

FLAG_SECURE of WindowManager LayoutParams is used.

WindowManager.LayoutParams | Android Developers

switching apps screenshot disabled
  • The type of mask effect cannot be specified like iOS.
  • In Android 11 or later, the mask effect is reflected by switching other apps once according to the specifications of Android OS.
  • Taking screenshots is not allowed when the feature is enabled.

Features and bugs

Please file feature requests and bugs on the issue tracker.

所属分类

依赖

依赖清单 1 项

  • plugin_platform_interface^2.0.2

源码仓库

使用此插件的项目