website
website copied to clipboard
Explain how to create macOS PlatformViews
Once we've completed support for PlatformViews on macOS we'll need a page similar to https://docs.flutter.dev/platform-integration/ios/platform-views covering the creation of platform views on macOS.
For the most part, the framework code should be near-identical other than substituting AppKitView where UiKitView is used for iOS and ensuring that any platform-specific checks reference Platform.macOS instead of Platform.iOS.
On the Swift side, there are some small differences in where and how to register platformViews, and the fact that the macOS view being created is an NSView rather than a UIKitView.
For reference, I have a macOS PlatformView example that wraps an Apple Maps MKMapView here: https://github.com/cbracken/platformview_test.
Part of: https://github.com/flutter/flutter/issues/41722
/cc @domesticmouse
Code-wise, I think everything we need for creating/registering macOS PlatformViews, both on the framework and engine side, is in place. There are still a bunch of bugfixes and some implementation work to do for touch/gesture/a11y support, but API-wise, I think we're probably in good enough shape to have a go at the docs.
Is this something you'd prefer I take a look at, or something you'd like to do?
@cbracken : I'd be up for doing this. I'll send you an invite for next week, if that's not too late?
@atsansone I'm happy to help with this =)
Silly question, what is the state of this issue?
Unassigning this as we are not currently promoting this capability. Re-assign when this changes.
Just to be clear, the new page exists here: https://docs.flutter.dev/platform-integration/macos/platform-views