パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.2.0

flutter_windowmanager

Android WindowManager の LayoutParams を操作するための Flutter プラグイン。

Android
30日間ダウンロード
3410
いいね数
368
Pub ポイント
160

パッケージをインストール

flutter pub add flutter_windowmanager

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

AndroidのWindowManager LayoutParamsの操作を可能にするFlutterプラグインで、開発者がAndroidアプリ内のウィンドウの位置、サイズ、動作を制御できるようにします。システムレベルのウィンドウプロパティへの直接アクセスを提供し、浮動ウィジェットやオーバーレイ、アクティビティ間で継続するカスタムUI要素を作成するのに役立ちます。このプラグインはAndroid専用に設計されており、プラットフォームチャネルを通じてネイティブAndroid SDKと統合されています。ウィンドウタイプ、フォーカス可能性、レイアウトパラメータをプログラム的に調整するなどの高度なウィンドウ管理機能をサポートしています。

用途

  • フローティングUIオーバーレイの作成
  • 常に最前面のウィジェットを作成する
  • カスタムウィンドウ配置の実装
  • スクリーンレコーディングまたはアノテーションツールの開発
  • 透過性または半透過性のウィンドウの管理

主な機能

  • WindowManager LayoutParamsへの直接アクセス
  • ウィンドウタイプのカスタマイズ対応
  • ウィンドウのサイズおよび位置に対するプログラム制御
  • Android 固有の機能
  • ネイティブAndroid SDKとの統合

適している対象

  • ウィンドウオーバーレイを必要とするAndroid専用アプリ
  • 浮遊UIコンポーネントを構築している開発者
  • 永続的な画面要素を必要とするアプリ
  • システムレベルのウィンドウ管理を必要とするツール
  • 高度なAndroid UI実験

注意事項

  • Android プラットフォームに限定
  • 適切なシステム権限が必要です
  • メーカーの制限により、すべてのデバイスで動作しない可能性があります
  • 新しいAndroidバージョンとの互換性の問題
  • ウィンドウのライフサイクルと権限の取り扱いに注意が必要です

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

flutter_windowmanager

Build Status Pub

A Flutter plugin for manipulating Android WindowManager LayoutParams dynamically at application run-time.

Example App Use

Motivation

While Android natively supports a range of window modes, there was no good way to set these dynamically within a running Flutter application - instead requiring that these flags are set within the native MainActivity of the Flutter application itself.

In our App, we only wished to disable screenshots for specific screens, rather than across the entire application lifecycle. This can now be accomplished by simply calling:

await FlutterWindowManager.addFlags(FlutterWindowManager.FLAG_SECURE);

for the relevant screen.

This can further be toggled for a specific screen by either using a RouteAware mixin, or through direct toggling in initState() and dispose() methods in the case of stateful widgets.

Flags

The full range of LayoutParams flags are passed through. The plugin will carry out basic API level checking and throw an error on any unsupported flag specification. Flags are implemented using a bitmask, and may be specified individually or ORed together for setting/clearing multiple flags at once.

The current list of flags is:

FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
FLAG_ALT_FOCUSABLE_IM
FLAG_DIM_BEHIND
FLAG_FORCE_NOT_FULLSCREEN
FLAG_FULLSCREEN
FLAG_HARDWARE_ACCELERATED
FLAG_IGNORE_CHEEK_PRESSES
FLAG_KEEP_SCREEN_ON
FLAG_LAYOUT_INSET_DECOR
FLAG_LAYOUT_IN_SCREEN
FLAG_LAYOUT_NO_LIMITS
FLAG_NOT_FOCUSABLE
FLAG_NOT_TOUCHABLE
FLAG_NOT_TOUCH_MODAL
FLAG_SCALED
FLAG_SECURE
FLAG_SHOW_WALLPAPER
FLAG_SPLIT_TOUCH
FLAG_WATCH_OUTSIDE_TOUCH
FLAG_BLUR_BEHIND
FLAG_DISMISS_KEYGUARD
FLAG_DITHER
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
FLAG_LAYOUT_ATTACHED_IN_DECOR
FLAG_LAYOUT_IN_OVERSCAN
FLAG_LOCAL_FOCUS_MODE
FLAG_SHOW_WHEN_LOCKED
FLAG_TOUCHABLE_WHEN_WAKING
FLAG_TRANSLUCENT_NAVIGATION
FLAG_TRANSLUCENT_STATUS
FLAG_TURN_SCREEN_ON

In practice, this plugin was developed primarily for the toggling of FLAG_SECURE. Other flags have not been tested, and we make no guarantees that toggling with any of the other flags will interact well with Flutter - if you find specific problems with any particular flag, please let us know in the issue tracker.

iOS Support

As flutter_windowmanager only wraps and exposes an underlying Android-specific interface, there is no iOS support planned or possible. For those interested in cross-platform FLAG_SECURE functionality, this functionality has been re-created in the third-party secure_application package. Cross-platform FLAG_KEEP_SCREEN_ON functionality is provided by the third-party keep_screen_on package.

Features and bugs

Please file feature requests and bugs at the issue tracker.

License

Licensed under the terms of the Apache 2.0 license, the full version of which can be found in the LICENSE file included in the distribution.

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト