-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[pointer_interceptor] Update app-facing package to accommodate new federated structure #5501
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
[pointer_interceptor] Update app-facing package to accommodate new federated structure #5501
Conversation
|
||
You can use this widget in a cross-platform app freely. In mobile, where the issue that this plugin fixes does not exist, the widget acts as a pass-through of its `children`, without adding anything to the render tree. | ||
`PointerInterceptor` is a widget that prevents mouse events from being captured by an underlying [`HtmlElementView`](https://api.flutter.dev/flutter/widgets/HtmlElementView-class.html) in web, or an underlying [`PlatformView`](https://api.flutter.dev/flutter/widgets/PlatformViewLink-class.html) on iOS. |
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.
`PointerInterceptor` is a widget that prevents mouse events from being captured by an underlying [`HtmlElementView`](https://api.flutter.dev/flutter/widgets/HtmlElementView-class.html) in web, or an underlying [`PlatformView`](https://api.flutter.dev/flutter/widgets/PlatformViewLink-class.html) on iOS. | |
`PointerInterceptor` is a widget that prevents pointer events from being captured by an underlying [`HtmlElementView`](https://api.flutter.dev/flutter/widgets/HtmlElementView-class.html) in web, or an underlying [`PlatformView`](https://api.flutter.dev/flutter/widgets/PlatformViewLink-class.html) on iOS. |
|
||
## What is the problem? | ||
|
||
When overlaying Flutter widgets on top of `HtmlElementView` widgets that respond to mouse gestures (handle clicks, for example), the clicks will be consumed by the `HtmlElementView`, and not relayed to Flutter. | ||
When overlaying Flutter widgets on top of `HtmlElementView`/`PlatformView` widgets that respond to mouse gestures (handle clicks, for example), the clicks will be consumed by the `HtmlElementView`/`PlatformView`, and not relayed to Flutter. |
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.
When overlaying Flutter widgets on top of `HtmlElementView`/`PlatformView` widgets that respond to mouse gestures (handle clicks, for example), the clicks will be consumed by the `HtmlElementView`/`PlatformView`, and not relayed to Flutter. | |
When overlaying Flutter widgets on top of `HtmlElementView`/`PlatformView` widgets that respond to pointer gestures (handle clicks, for example), the clicks will be consumed by the `HtmlElementView`/`PlatformView`, and not relayed to Flutter. |
// TODO(louisehsu): given the difficulty of making the same integration tests | ||
// work for both web and ios implementations, please find tests in their respective | ||
// platform implementation packages. |
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.
If there are not going to be tests here, I'd fully remove integration_test
from the example
app. I don't think it'll annoy the CI too much.
You already have the tests_exist_elsewhere_test.dart
in the main directory, so as long as you point people to the implementation-specific tests from there, I think you can remove the ones here altogether!
ui_web.platformViewRegistry.registerViewFactory( | ||
_htmlElementViewType, | ||
(int viewId) => htmlElement, | ||
); |
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.
We normally recommend the registerViewFactory call to not be in the build
function. Any chance this can be moved elsewhere earlier in the file? (Outside of the NativeWidget class, maybe?)
@@ -9,8 +9,7 @@ import 'package:flutter_test/flutter_test.dart'; | |||
void main() { | |||
test('Tell the user where to find the real tests', () { | |||
print('---'); | |||
print('This package uses integration_test for its tests.'); | |||
print('See `example/README.md` for more info.'); | |||
print('Please find platform tests in their respective packages.'); |
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.
👍
@@ -4,4 +4,5 @@ | |||
|
|||
library pointer_interceptor; | |||
|
|||
export 'src/mobile.dart' if (dart.library.html) 'src/web.dart'; | |||
export 'package:pointer_interceptor/src/pointer_interceptor.dart'; | |||
export 'package:pointer_interceptor_platform_interface/pointer_interceptor_platform_interface.dart'; |
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 don't think this needs to re-export anything from the platform_interface
package, right?
This was obsoleted by #5640; closing. |
Addresses flutter/flutter#30143 by adding an iOS implementation
This PR is Part 3 of #5233
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].CHANGELOG.md
to add a description of the change, [following repository CHANGELOG style].///
).