Add documentation for platform_view example. (#111623)

This commit is contained in:
Alex Wallen 2022-09-15 13:56:18 -07:00 committed by GitHub
parent c03eef4d57
commit 10f088e64d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -5,6 +5,12 @@
import Cocoa
import FlutterMacOS
/**
The main application window.
Performs Flutter app initialization, and handles channel method calls over the
`samples.flutter.io/platform_view` channel.
*/
class MainFlutterWindow: NSWindow {
override func awakeFromNib() {
let flutterViewController = FlutterViewController.init()

View File

@ -4,6 +4,17 @@
import Cocoa
/**
`ViewControllers` in the xib can inherit from this class to communicate with
the flutter view for this application. ViewControllers that inherit from this
class should be displayed as a popover or modal, with a button that binds to
the IBAction `pop()`.
To get the value of the popover during close, pass a callback function as
the `dispose` parameter. The callback passed will have access to the
`PlatformViewController` and all of it's properties at close so that the `count`
can be passed back through the message channel if needed.
*/
class PlatformViewController: NSViewController {
var count: Int = 0