Add documentation for platform_view
example. (#111623)
This commit is contained in:
parent
c03eef4d57
commit
10f088e64d
@ -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()
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user