FLUTTER ECOSYSTEM

malikwang/expand_tap_area

サイズやレイアウトを変更せずに、ウィジェットのタップ領域を手動で拡張します。iOS開発におけるhitTestに似ています。

expand_tap_area のプロジェクト画像
Stars
38
Forks
6
最終プッシュ(UTC)
2024/05/01
プロジェクト状態
公開中
malikwang GitHub avatar
GITHUB User

malikwang ↗

言語DartObjective-CRubyJavaSwiftKotlin

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

使用している依存関係

依存関係一覧 2 件
  • flutter{"sdk":"flutter"}
  • flutter_test開発用{"sdk":"flutter"}

元の README

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

README を開く / 閉じる

ExpandTapArea

Manually expand the tap area of a widget without changing its size or layout. Similar with the hitTest in iOS development.

Context

In the Human Interface Guidelines, Apple recommends a minimum target size of 44 x 44 px. 
In the Android Material Design Guidelines, it’s suggested that touch targets should be at least 48 x 48 dp.

Inspired by issue

Usage

ExpandTapWidget(
  onTap: () {},
  tapPadding: EdgeInsets.all(25.0),
  child: smallWidget(),
),

Demo

Attention

  1. ExpandTapWidget can be wrapped inside/outside GestureDetector: To avoid the conflict of gesture, it is better to apply on the innermost/smallest widget.
  2. The expanded area wouldn't exceed the boundary of the Parent Box. You can set debugPaintExpandAreaEnabled = true to display the actual expanded area.