website icon indicating copy to clipboard operation
website copied to clipboard

[macOS] Add platform view documentation

Open cbracken opened this issue 1 year ago • 7 comments

This adds documentation on authoring and using platform views for Flutter apps targeting macOS.

The initial version of this documentation is Swift-only, but a follow-up will add Objective-C example code.

Fixes: #9424

Presubmit checklist

  • [X] This PR is marked as draft with an explanation if not meant to land until a future stable release.
  • [X] This PR doesn’t contain automatically generated corrections (Grammarly or similar).
  • [X] This PR follows the Google Developer Documentation Style Guidelines — for example, it doesn’t use i.e. or e.g., and it avoids I and we (first person).
  • [X] This PR uses semantic line breaks of 80 characters or fewer.

cbracken avatar Jun 25 '24 09:06 cbracken

Visit the preview URL for this PR (updated for commit bd8c6aabbcd71322db42a28764f3ebf77689c6af):

https://flutter-docs-prod--pr10796-macos-platformview-docs-hj2iqzhf.web.app

flutter-website-bot avatar Jun 25 '24 09:06 flutter-website-bot

Does this fix https://github.com/flutter/website/issues/9424?

atsansone avatar Jun 25 '24 18:06 atsansone

@atsansone yes, this will fix that bug; added to the description -- thanks!

cbracken avatar Jun 25 '24 23:06 cbracken

The initial version of this documentation is Swift-only, but a follow-up will add Objective-C example code.

Technically we've never supported Obj-C as a language for macOS. In practice it works because of interop of course, but we haven't traditionally done documentation or examples in anything but Swift.

stuartmorgan-g avatar Jun 27 '24 02:06 stuartmorgan-g

Technically we've never supported Obj-C as a language for macOS.

Thanks. Was thinking it might be handy just in case people had some existing Obj-C NSViews they'd like to wrap but you're entirely right: we don't even have an Obj-C template for macOS, and people in that boat can just expose their own Swift-friendly header to the plugin. Not only that, but publishing Obj-C source implies that we're willing to commit to supporting that use-case and we aren't in a position to do so.

Removed the tabs and sending this out as Swift-only.

cbracken avatar Jun 27 '24 06:06 cbracken

Alright; this is ready for a proper review.

cbracken avatar Jun 27 '24 06:06 cbracken

Does this need any version note or similar clarification?

parlough avatar Jun 27 '24 21:06 parlough

@cbracken, are these docs valid for the current stable release? If not, I can add a note at the top stating that fact.

sfshaza2 avatar Jul 01 '24 18:07 sfshaza2

@loic-sharma, do you know if this info is valid as of now, or if it's valid after the next release? Before I land it, I want to be clear. If it's for the next release, I can still land it, but will first add a note.

sfshaza2 avatar Jul 02 '24 22:07 sfshaza2

@sfshaza2 In general we don't want to tell people to use macOS platform views until after the next stable release (due to critical missing functionality like gesture support).

stuartmorgan-g avatar Jul 03 '24 15:07 stuartmorgan-g