aboutsummaryrefslogtreecommitdiff
path: root/macos/Runner/MainFlutterWindow.swift
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2023-09-11 01:00:14 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2023-09-11 01:00:14 +0530
commit7651d5200767a339089dd4021bf77a86b6adcf80 (patch)
tree3fef13a7f0140b22716bfbc9a7c6e842782b853c /macos/Runner/MainFlutterWindow.swift
first commitv0.0.1
Diffstat (limited to 'macos/Runner/MainFlutterWindow.swift')
-rw-r--r--macos/Runner/MainFlutterWindow.swift15
1 files changed, 15 insertions, 0 deletions
diff --git a/macos/Runner/MainFlutterWindow.swift b/macos/Runner/MainFlutterWindow.swift
new file mode 100644
index 0000000..3cc05eb
--- /dev/null
+++ b/macos/Runner/MainFlutterWindow.swift
@@ -0,0 +1,15 @@
+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)
+
+ super.awakeFromNib()
+ }
+}