FLUTTER ECOSYSTEM

arkwycr/secure_app_switcher

arkwycr/secure_app_switcher open-source repository details.

secure_app_switcher のプロジェクト画像
Stars
2
Forks
4
最終プッシュ(UTC)
2025/01/19
プロジェクト状態
公開中
arkwycr GitHub avatar
GITHUB User

arkwycr ↗

Japan
言語DartKotlinSwiftRubyObjective-C

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 4 件
  • flutter{"sdk":"flutter"}
  • plugin_platform_interface^2.0.2
  • flutter_test開発用{"sdk":"flutter"}
  • flutter_lints開発用^4.0.0

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

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
https://user-images.githubusercontent.com/113876527/192409757-3289a563-b0df-43a5-9993-bea528019da6.png https://user-images.githubusercontent.com/113876527/192409756-0484c91c-e8c2-4289-89ef-a23522a26a5d.png https://user-images.githubusercontent.com/113876527/192409751-335f586e-89d7-4e13-8099-b15903065227.png https://user-images.githubusercontent.com/113876527/192409701-57af88e0-35eb-4e25-ae38-f96fe6d0a664.png

Android

FLAG_SECURE of WindowManager LayoutParams is used.

WindowManager.LayoutParams | Android Developers

switching apps screenshot disabled
https://user-images.githubusercontent.com/113876527/192409761-960d19ea-0b41-40eb-bbab-bd2a3c4cd2f9.png https://user-images.githubusercontent.com/113876527/192409760-5ae06e9a-7d47-4352-9b59-f0efa81a5064.png
  • 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.