2026-03-11 07:32:52 +08:00
|
|
|
import Cocoa
|
|
|
|
|
import FlutterMacOS
|
|
|
|
|
|
|
|
|
|
class MainFlutterWindow: NSWindow {
|
|
|
|
|
override func awakeFromNib() {
|
|
|
|
|
let flutterViewController = FlutterViewController()
|
|
|
|
|
let windowFrame = self.frame
|
|
|
|
|
self.contentViewController = flutterViewController
|
|
|
|
|
self.setFrame(windowFrame, display: true)
|
|
|
|
|
|
|
|
|
|
RegisterGeneratedPlugins(registry: flutterViewController)
|
2026-03-26 18:42:11 +08:00
|
|
|
(NSApp.delegate as? AppDelegate)?.registerApplicationChannels(
|
2026-03-25 22:48:57 +08:00
|
|
|
for: flutterViewController
|
|
|
|
|
)
|
2026-03-11 07:32:52 +08:00
|
|
|
|
|
|
|
|
super.awakeFromNib()
|
2026-03-11 14:04:29 +08:00
|
|
|
|
|
|
|
|
DispatchQueue.main.async {
|
|
|
|
|
if !self.isZoomed {
|
|
|
|
|
self.zoom(nil)
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-03-11 07:32:52 +08:00
|
|
|
}
|
|
|
|
|
}
|