website icon indicating copy to clipboard operation
website copied to clipboard

Explain how to create macOS PlatformViews

Open cbracken opened this issue 2 years ago • 5 comments

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

cbracken avatar Sep 19 '23 17:09 cbracken

/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 avatar Sep 19 '23 17:09 cbracken

@cbracken : I'd be up for doing this. I'll send you an invite for next week, if that's not too late?

atsansone avatar Sep 21 '23 15:09 atsansone

@atsansone I'm happy to help with this =)

domesticmouse avatar Sep 21 '23 21:09 domesticmouse

Silly question, what is the state of this issue?

domesticmouse avatar Dec 20 '23 21:12 domesticmouse

Unassigning this as we are not currently promoting this capability. Re-assign when this changes.

domesticmouse avatar May 30 '24 01:05 domesticmouse

Just to be clear, the new page exists here: https://docs.flutter.dev/platform-integration/macos/platform-views

sfshaza2 avatar Jul 29 '24 17:07 sfshaza2