Skip to content
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

Implement PlatformView support on macOS #41722

Open
1 of 3 tasks
stuartmorgan opened this issue Oct 1, 2019 · 61 comments
Open
1 of 3 tasks

Implement PlatformView support on macOS #41722

stuartmorgan opened this issue Oct 1, 2019 · 61 comments
Labels
a: desktop Running on desktop a: platform-views Embedding Android/iOS views in Flutter apps c: new feature Nothing broken; request for a new capability P2 Important issues not at the top of the work list platform-mac Building on or for macOS specifically team-macos Owned by the macOS platform team triaged-macos Triaged by the macOS platform team

Comments

@stuartmorgan
Copy link
Contributor

stuartmorgan commented Oct 1, 2019

We'll want to support embedding native views in a Flutter view, as is currently supported on mobile.

Remaining tasks:

  • Gesture support
  • Focus traversal
  • Accessibility tree merging
@stuartmorgan stuartmorgan added c: new feature Nothing broken; request for a new capability platform-mac Building on or for macOS specifically a: desktop Running on desktop labels Oct 1, 2019
@rodydavis

This comment was marked as off-topic.

@stuartmorgan

This comment was marked as off-topic.

@MichelDiz

This comment has been minimized.

@blasten
Copy link

blasten commented Sep 11, 2020

@stuartmorgan we should chat. There's some opportunity to refactor the existing implementation on iOS, and I wonder if some code could be shared.

@stuartmorgan
Copy link
Contributor Author

I suspect not—on the Flutter end macOS uses embedder.h and iOS doesn't, while on the native end Cocoa and CocoaTouch are similarly but entirely disjoint—but it's certainly worth investigating to find out for sure.

@radvansky-tomas
Copy link

So basically there is currently no option to create plugins which support native views - and then enable things like Google Maps, etc..

@vanlooverenkoen
Copy link
Contributor

vanlooverenkoen commented Mar 10, 2021

Isn't this something that should be implemented before we can speak of a stable desktop release? I can imagine that a lot of apps require some native views, video player, webview, maps,...

@stuartmorgan
Copy link
Contributor Author

Conversely, lots of apps don't require those things; "stable" doesn't mean "has every feature that should eventually be supported" or "supports every use case".

Flutter 1.0, notably, did not support platform views.

@vanlooverenkoen
Copy link
Contributor

Good to know. Is there some kind of roadmap for this? We are building a video streaming app for android, iOS, web, androidtv, tizen, webOS and we want to support desktop apps as well. But I think as long as this is not yet implemented in flutter there is no way to add support for desktop apps.

@radvansky-tomas
Copy link

But isnt PlatformView exactly tool for those features which are NOT supported yet ? so we can use existing OS features / plugins ? I mean having PlatformView ready before actually release of macOSX support seem to be quite essential.

Anyway I am looking forward for new features added to mac osx package

@vanlooverenkoen
Copy link
Contributor

@radvansky-tomas platform channels are supported. The platform views are missing. So you add support for notifications on desktop. But video streaming, google maps (platform views) are not yet supported

@bdlukaa
Copy link

bdlukaa commented Apr 4, 2021

But video streaming, google maps (platform views) are not yet supported

I guess these are supported through a Texture widget, which, according to #30717 and flutter/engine#8507, are supported

@caojianfeng
Copy link

Lots of apps have features with WebView and VideoPlayer.
So they are very base features .

@kanekv
Copy link

kanekv commented Jul 13, 2021

This has a priority of P4, does it mean there is no hope to see it any time soon?

@stuartmorgan
Copy link
Contributor Author

stuartmorgan commented Jul 13, 2021

This has a priority of P4, does it mean there is no hope to see it any time soon?

It means that it's higher priority than the default for feature requests, but not currently on the Flutter team's short-term roadmap.

That doesn't mean it couldn't be implemented soon. Flutter is open-source, and anyone is welcome to pick up from where flutter/engine#22905 left off to contribute an implementation if they feel strongly about having it done sooner.

@imiskolee

This comment has been minimized.

@knopp
Copy link
Member

knopp commented Sep 14, 2023

The NSView size should mirror the size of AppKitView. Can you provide a reproducible example?

@zhuhaichao518
Copy link

zhuhaichao518 commented Sep 16, 2023 via email

@amdshrif
Copy link

This has a priority of P4, does it mean there is no hope to see it any time soon?

It means that it's higher priority than the default for feature requests, but not currently on the Flutter team's short-term roadmap.

That doesn't mean it couldn't be implemented soon. Flutter is open-source, and anyone is welcome to pick up from where flutter/engine#22905 left off to contribute an implementation if they feel strongly about having it done sooner.

@stuartmorgan I would like to contribute and implement the needed support here but I need guidance and help to better understand the effort and how to add the support needed. Let me know if you could help me with that, thanks.

@cbracken
Copy link
Member

@zhuhaichao518 if you can author a reduced reproduction that demonstrates the bug, then please file a new issue so we can take a look into it. That way we can keep this issue focused on missing features (input events, gestures, a11y, focus traversal), rather than bugs with what's already landed (visual rendering/composition, clipping, transforms, etc.)

@cbracken
Copy link
Member

@amdshrif @knopp already has work in progress for some of the input event related side of things. Focus traversal and a11y wiring are both gaps. I'm currently working on a11y support.

@renanyoy
Copy link

I'm trying mac platform view, displaying some MTKView child in simple NSVIew, I have the flutter UI blinking sometime.

https://pub.waves.pw/ms/aestesis.mp4

@knopp
Copy link
Member

knopp commented Nov 20, 2023

I'm trying mac platform view, displaying some MTKView child in simple NSVIew, I have the flutter UI blinking sometime.

https://pub.waves.pw/ms/aestesis.mp4

That looks like the contents was not rendered in time but it got presented anyway. Possibly.

@knopp
Copy link
Member

knopp commented Nov 20, 2023

I'm trying mac platform view, displaying some MTKView child in simple NSVIew, I have the flutter UI blinking sometime.

https://pub.waves.pw/ms/aestesis.mp4

If you can provide a reproducible example (attached to a new issue) I will take a look.

@renanyoy
Copy link

@knopp thank you, I'm preparing an example

@renanyoy
Copy link

@knopp I managed to reproduce it, I filled a new issue #138936

@jhonatansosaferreira

This comment was marked as off-topic.

@flutter-triage-bot
Copy link

This issue is assigned to @cbracken but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

@LylaAhn

This comment was marked as off-topic.

@stuartmorgan
Copy link
Contributor Author

@flutter-triage-bot flutter-triage-bot bot removed the Bot is counting down the days until it unassigns the issue label Apr 3, 2024
@ekuleshov
Copy link

@stuartmorgan @cbracken this issue is linked from the 2024 roadmap but I wasn't been able to find any specific tasks related to this work, e.g. a list of gaps or outstanding issues that need to be completed before this gets real. Do you have any hints on that?

@stuartmorgan
Copy link
Contributor Author

@cbracken Do you want to edit the original issue description to include a checklist of the remaining items (e.g., gesture support) so it stays pinned to a discoverable location?

@cbracken
Copy link
Member

Done!

@cbracken cbracken removed their assignment Apr 10, 2024
@cbracken cbracken added team-macos Owned by the macOS platform team and removed team-desktop labels Jun 5, 2024
@jmagman jmagman added the triaged-macos Triaged by the macOS platform team label Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: desktop Running on desktop a: platform-views Embedding Android/iOS views in Flutter apps c: new feature Nothing broken; request for a new capability P2 Important issues not at the top of the work list platform-mac Building on or for macOS specifically team-macos Owned by the macOS platform team triaged-macos Triaged by the macOS platform team
Projects
Status: In Progress
Development

No branches or pull requests