2021-06-19 23:41:19 +08:00
|
|
|
import Cocoa
|
|
|
|
import FlutterMacOS
|
|
|
|
|
2025-02-07 18:17:46 +08:00
|
|
|
@main
|
2021-06-19 23:41:19 +08:00
|
|
|
class AppDelegate: FlutterAppDelegate {
|
|
|
|
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
2024-06-20 21:00:56 +02:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
override func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
|
|
|
|
if !flag {
|
|
|
|
for window in sender.windows {
|
|
|
|
window.makeKeyAndOrderFront(self)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-19 23:41:19 +08:00
|
|
|
return true
|
|
|
|
}
|
2025-02-10 09:20:24 +08:00
|
|
|
|
|
|
|
override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
|
|
|
|
return true
|
|
|
|
}
|
2021-06-19 23:41:19 +08:00
|
|
|
}
|