Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add behavior(HitTestBehavior) to ReorderableListener #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mono0926
Copy link

Before this change, transparent area of ReorderableListener doesn't react to onPointerDown.

This can be reproduced by commenting out this line:

color: Color(0x08000000),

And the problem is fixed by specifying behavior: HitTestBehavior.opaque, so that parameter is needed.

    Widget dragHandle = draggingMode == DraggingMode.iOS
        ? ReorderableListener(
            child: Container(
              padding: EdgeInsets.only(right: 18.0, left: 18.0),
//              color: Color(0x08000000),
              child: Center(
                child: Icon(Icons.reorder, color: Color(0xFF888888)),
              ),
            ),
            // Add this
            behavior: HitTestBehavior.opaque,
          )
        : Container();

Original code:

Widget dragHandle = draggingMode == DraggingMode.iOS
? ReorderableListener(
child: Container(
padding: EdgeInsets.only(right: 18.0, left: 18.0),
color: Color(0x08000000),
child: Center(
child: Icon(Icons.reorder, color: Color(0xFF888888)),
),
),
)
: Container();

@mono0926 mono0926 force-pushed the add-behavior-parameter branch from c4a5d4f to 80863c6 Compare March 30, 2021 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant