Unverified Commit 10f088e6 authored by Alex Wallen's avatar Alex Wallen Committed by GitHub

Add documentation for `platform_view` example. (#111623)

parent c03eef4d
...@@ -5,6 +5,12 @@ ...@@ -5,6 +5,12 @@
import Cocoa import Cocoa
import FlutterMacOS 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 { class MainFlutterWindow: NSWindow {
override func awakeFromNib() { override func awakeFromNib() {
let flutterViewController = FlutterViewController.init() let flutterViewController = FlutterViewController.init()
......
...@@ -4,6 +4,17 @@ ...@@ -4,6 +4,17 @@
import Cocoa 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 { class PlatformViewController: NSViewController {
var count: Int = 0 var count: Int = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment