Skip to content

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