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

パッケージ詳細v1.0.1

transparent_pointer

ヒットテストを制御するための TransparentPointer を提供します

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1.6万
いいね数
59
Pub ポイント
150

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

flutter pub add transparent_pointer

パッケージ概要

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

transparent_pointer パッケージは、Flutter アプリケーションでのヒットテストを制御できるウィジェットである TransparentPointer を提供しています。このコンポーネントでウィジェットをラップすることで、ポインターイベントに対して透明にでき、下位のウィジェットがタッチやマウス入力を受けるようにできます。これは特にテスト時や、正確なイベント処理が必要となる複雑なUIを構築する際に役立ちます。このパッケージは、Android、iOS、Web、macOS、Windows、Linux などの主要プラットフォームをすべてサポートしています。

用途

  • UI インタラクションのテスト
  • オーバーレイのヒットテストをバイパスする
  • レイヤードUIコンポーネントの作成
  • ジェスチャーの競合をデバッグする
  • 透過性タッチゾーンの実装
  • テストでのユーザー入力のシミュレーション

主な機能

  • ヒットテストの動作を制御する
  • すべての Flutter プラットフォームをサポートしています
  • シンプルなウィジェットラッパー
  • テストシナリオに最適
  • イベントデリゲーションを有効にする
  • 軽量でミニマル

適している対象

  • テスト自動化エンジニア
  • 細かい制御が必要なUI開発者
  • Flutterアプリのテスト担当者
  • インタラクティブなオーバーレイを構築する開発者
  • ジェスチャーの問題をデバッグしている人
  • 複雑なジェスチャー フローのプロトタイピング

注意事項

  • 本番UIには適していません
  • 通常のタッチ操作に影響を与える可能性があります
  • 複雑なレイアウトでは慎重な統合が必要です
  • ヒットテスト操作に制限される
  • 開発またはテスト環境で最も適しています
  • 視覚的レンダリングに影響しない

元の README

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

transparent_pointer

TransparentPointer is a widget that is invisible for its parent to hit testing, but still allows its subtree to receive pointer events. This is useful to allow a gesture detector that is visually behind another widget to still receive pointer events, while at the same time allowing that other widget to receive those events as well.

Example

In this example, a drag can be started anywhere in the widget, including on top of the text button, even though the button is visually in front of the background gesture detector. At the same time, the button is tappable.

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        GestureDetector(
          behavior: HitTestBehavior.opaque,
          onVerticalDragStart: (_) => print("Background drag started"),
        ),
        Positioned(
          top: 60,
          left: 60,
          height: 60,
          width: 60,
          child: TransparentPointer(
            child: TextButton(
              child: Text("Tap me"),
              onPressed: () => print("You tapped me"),
            ),
          ),
        ),
      ],
    );
  }
}

カテゴリー

ソースリポジトリ

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

データはまだありません。