FLUTTER ECOSYSTEM

malikwang/expand_tap_area

手動擴展組件的點擊區域,而不改變其大小或佈局。類似於 iOS 開發中的 hitTest。

expand_tap_area 專案封面
Stars
38
Forks
6
最近推送(UTC)
2024年5月1日
專案狀態
未封存
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.