Skip to content

Manually add the extra hitTest area of a widget without changing its size or layout.

License

Notifications You must be signed in to change notification settings

fluttercandies/extra_hittest_area

Repository files navigation

extra_hittest_area

pub package GitHub stars GitHub forks GitHub license GitHub issues flutter-candies

Language: README.md | 中文简体

Manually add the extra hitTest area of a widget without changing its size or layout.

Parent widgets

The widgets are the same as offical widgets. They are make sure your widget can get hitTest from parent, use them if extra hitTest area are beyond the size of parent.

  • StackHitTestWithoutSizeLimit
  • RowHitTestWithoutSizeLimit, ColumnHitTestWithoutSizeLimit, FlexHitTestWithoutSizeLimit
  • SizedBoxHitTestWithoutSizeLimit

Listener widgets

  • GestureDetectorHitTestWithoutSizeLimit
  • RawGestureDetectorHitTestWithoutSizeLimit
  • ListenerHitTestWithoutSizeLimit
parameter description default
extraHitTestArea The extra area of hitTest EdgeInsets.zero
debugHitTestAreaColor The color of the extra area null

you can also set ExtraHitTestBase.debugGlobalHitTestAreaColor instead set debugHitTestAreaColor in everytime.

return GestureDetectorHitTestWithoutSizeLimit(
  child: mockButtonUI(text),
  //debugHitTestAreaColor: Colors.pink.withOpacity(0.4),
  extraHitTestArea: const EdgeInsets.all(16),
  onTap: () {
    showToast('$text:onTap${i++}',
        duration: const Duration(milliseconds: 500));
  },
);

Implements other HitTestWithoutSizeLimit

if some widgets are not included in this package, you can implements them with following classes.

  • RenderBoxHitTestWithoutSizeLimit, RenderBoxChildrenHitTestWithoutSizeLimit

About

Manually add the extra hitTest area of a widget without changing its size or layout.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published