parsodyl / touch_interceptor

A Flutter widget that intercepts touch events and sends them to other widgets underneath.

Home Page:https://pub.dev/packages/touch_interceptor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

touch_interceptor

A widget that intercepts touch events and sends them to other widgets underneath.

Schema

Useful when:

  • there is an opaque layer over a widget, and you want to make it transparent to touch events
  • you want seamlessly transfer a touch event from one widget to another

Syntax:

// interceptor
TouchInterceptor(
  // other component(s)
  child: OtherWidget(
    // consumer
    child: TouchConsumer(
      onTouchDown: () {
        // do something
      },
      onTouchUp: () {
        // do something
      },
      onTouchEnter: () {
        // do something
      },
      onTouchExit: () {
        // do something
      },
    ),
  ),
),

See the examples:

About

A Flutter widget that intercepts touch events and sends them to other widgets underneath.

https://pub.dev/packages/touch_interceptor

License:MIT License


Languages

Language:Dart 100.0%