Skip to content
pubscout

extra_hittest_area

1.0.0, released 2 years ago by fluttercandies.com

Manually add extra hitTest area to widgets without changing their layout size.

WASM-ready
$ flutter pub add extra_hittest_area
Source repository

What it does

Provides wrapper widgets like GestureDetectorHitTestWithoutSizeLimit and layout variants such as StackHitTestWithoutSizeLimit to expand the touch target area beyond the visual bounds of a widget without modifying its layout size.

AI-written summary of version 1.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to make a small icon button easier to tap by increasing its hit test area.
  • A touch target needs to extend outside of its parent widget bounds.

Skip it when

  • You want to actually resize the widget and its layout bounds rather than just the hit test area.

Strengths

  • Does not alter widget size or layout.
  • Provides debugging colors to visualize extra hit test areas.
  • Supports multiple layout and listener widget variants.

Weaknesses

  • Requires using specific custom wrapper widgets instead of standard Flutter widgets.
  • Limited documentation beyond the README.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
return GestureDetectorHitTestWithoutSizeLimit(
  child: mockButtonUI(text),
  extraHitTestArea: const EdgeInsets.all(16),
  onTap: () {},
);

Alternatives

Packages that do the same job and could replace extra_hittest_area.