Skip to content

Click the dock icon to restore after closing the window

Change the file macos/Runner/AppDelegate.swift as follows:

import Cocoa
import FlutterMacOS
class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return false
override func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
if !flag {
for window in {
if !window.isVisible {
NSApp.activate(ignoringOtherApps: true)
return true