-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[web] Add PointerInterceptor widget #256
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
Conversation
packages/web_mouse_click_boundary/example/integration_test/widget_test.dart
Outdated
Show resolved
Hide resolved
packages/web_mouse_click_boundary/example/integration_test/widget_test.dart
Outdated
Show resolved
Hide resolved
|
In an offline discussion, this has been suggested to be renamed |
packages/web_pointer_interceptor/test/tests_exist_elsewhere_test.dart
Outdated
Show resolved
Hide resolved
|
I think I've addressed all of @yjbanov's comments. I also migrated the package to Null-Safety by bumping its lower SDK version (and some minimal changes to the code). Attempting to migrate tests now (but I don't think this'll work) |
|
Reverted null safety because of: |
| <center> | ||
|
|
||
|  | ||
|
|
||
| _In the dashed areas, clicks won't work as expected._ | ||
| </center> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll tweak this after pushing, when the images live in the repo.
yjbanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @override | ||
| Widget build(BuildContext context) { | ||
| return Scaffold( | ||
| appBar: AppBar( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the AppBar or its contents be wrapped in PointerInterceptor? The content in the body can be rendered under the appbar and if it contains iframes, consume pointer events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're right, and that'd also cover the Drawer open button, I'm going to give that a shot!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooops, not for now:
The argument type 'PointerInterceptor' can't be assigned to the parameter type 'PreferredSizeWidget'.
The contents should be wrappable (individually)
|
It's not clear how this differs from AbsorbPointer or IgnorePointer. Wouldn't this functionality be better in those classes? |
@RandalSchwartz I've double-checked the documentation and it seems that this doesn't fit well with neither The issue, in web, is that any flutter element that you overlay on top of an This happens because in the browser, it seems that the In this case, the I'm not 100% sure that this would mesh well with either I also added something similar to the above in the README of the PointerInterceptor, do you think it needs further elaboration? More details can be added there. |
[Migrate & Simplify] bottom navigation multiple beamers example

This PR adds the (web) PointerInterceptor widget, to address issues like: flutter/flutter#54027.
The widget can be used simply as a wrapper of any widget that is overlaid on top of a platform view, so it can handle clicks "as expected".
More info about usage and testing in the corresponding READMEs!
The example app is deployed here running on top of flutter master: https://dit-mouse-boundary.web.app