You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have planned to implement it, but other things need more stability before going ahead.
alexmercerind
changed the title
ontap event not work
Flutter [onTap] [onPressed] events don't work on [Widget]s placed on-top of [NativeView]s
Mar 28, 2022
Regardless, thanks for the report. Feel free to open & document more issues if you discover.
This will require few changes on the native side, currently when passing HitTest.translucent, the window becomes "click-through" & mouse clicks are sent to the NativeView underneath. And once the mouse cursor moves outside of the area (NativeView's area), it sends back event to make window clickable again.
I think an API that allows to wrap the widgets (which should are meant to be placed on-top of the NativeView) should be good.
Stack(
children: [
LayoutBuilder(
/// Create a [NativeView].
builder: (context, constraints) =>NativeView(
/// Pass [NativeViewController] to render the window.
controller: controller,
width: constraints.maxWidth,
height: constraints.maxHeight,
),
),
Padding(
padding:constEdgeInsets.all(16.0),
/// I had something like this in mind.
child:NativeViewInteractionInterceptArea(
child:FloatingActionButton(
onPressed: () {},
child:constIcon(Icons.edit),
),
),
),
),
],
),
Apart from above, we have another issue which causes `NativeView` to leak with `HitTest.translucent`'s intractability to leak through the title-bar.
Is it possible to send events/clicks programmatically in your case (since current click-through approach doesn't seem that great in my opinion)?
If anyone has any opinions, feel free to share.
Thanks.
I want put a button on NativeView, and add a onTap event, but the event not work when I click the button.
The text was updated successfully, but these errors were encountered: