패키지, 저장소 및 앱 카테고리 검색

패키지 상세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 컴포넌트 만들기
  • 제스처 충돌 디버깅
  • 투명 터치 영역 구현
  • 테스트에서 사용자 입력 시뮬레이션

주요 기능

  • 히트 테스트 동작 제어
  • 모든 플러터 플랫폼을 지원합니다
  • 간단한 위젯 래퍼
  • 테스트 시나리오에 적합
  • 이벤트 위임 활성화
  • 경량이고 최소한의

적합한 대상

  • 테스트 자동화 엔지니어
  • 세밀한 제어가 필요한 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"),
            ),
          ),
        ),
      ],
    );
  }
}

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.