Search packages, repositories and app categories

secure_app_switcher cover
Package detailsv1.0.0

secure_app_switcher

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

AndroidiOS
30-day downloads
774
Likes
37
Pub points
150

Install package

flutter pub add secure_app_switcher

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The secure_app_switcher package enhances app privacy by applying a masking effect to the app's screen preview in the device's app switcher or task list. This prevents sensitive content from being visible when users swipe through open apps, offering an extra layer of security on Android and iOS devices. The package integrates seamlessly into Flutter applications with minimal configuration, ensuring that the app’s visual state remains hidden during multitasking. It is particularly useful for apps handling confidential data such as banking, healthcare, or messaging platforms.

Use cases

  • Protecting sensitive UI previews in app switcher
  • Securing financial or medical apps
  • Preventing accidental exposure of private content
  • Enhancing privacy in multi-user environments
  • Complying with data protection regulations

Key features

  • Masking app preview in task switcher
  • Cross-platform support (Android & iOS)
  • Minimal setup required
  • No runtime performance impact
  • Works without modifying app logic

Suitable for

  • Privacy-focused applications
  • Apps handling personal or confidential data
  • Developers prioritizing user security
  • Enterprise-grade mobile apps
  • Flutter projects requiring enhanced privacy controls

Considerations

  • Requires platform-specific permissions
  • May not work on all device manufacturers
  • Limited to visual masking, not full app isolation
  • Does not affect screenshots taken outside the switcher
  • Depends on OS-level behavior which may vary

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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.

Categories

Dependencies

Dependency list 1 items

  • plugin_platform_interface^2.0.2

Source repository

Projects using this package