From e2e55cf72e6827da6b72c402e158adb02a5152e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Sharma?= <737941+loic-sharma@users.noreply.github.com> Date: Mon, 25 Nov 2024 11:49:14 -0800 Subject: [PATCH] [various] Migrate example apps' AppDelegate.swift (#8155) Migrated by running: ``` dart run script/tool/bin/flutter_plugin_tools.dart build-examples --ios --swift-package-manager dart run script/tool/bin/flutter_plugin_tools.dart build-examples --macos --swift-package-manager ``` Tests aren't updated as this change should not affect semantics. I will get a test exemption. Part of https://github.com/flutter/flutter/issues/159173 --- packages/animations/example/ios/Runner/AppDelegate.swift | 2 +- .../file_selector/example/ios/Runner/AppDelegate.swift | 2 +- .../file_selector/example/macos/Runner/AppDelegate.swift | 6 +++++- .../example/macos/Runner/AppDelegate.swift | 6 +++++- .../example/ios/Runner/AppDelegate.swift | 2 +- .../example/macos/Runner/AppDelegate.swift | 6 +++++- packages/flutter_image/example/ios/Runner/AppDelegate.swift | 2 +- .../flutter_image/example/macos/Runner/AppDelegate.swift | 6 +++++- .../flutter_markdown/example/ios/Runner/AppDelegate.swift | 2 +- .../flutter_markdown/example/macos/Runner/AppDelegate.swift | 6 +++++- packages/go_router/example/ios/Runner/AppDelegate.swift | 2 +- packages/go_router/example/macos/Runner/AppDelegate.swift | 6 +++++- .../google_sign_in/example/macos/Runner/AppDelegate.swift | 6 +++++- .../example/macos/Runner/AppDelegate.swift | 6 +++++- .../image_picker/example/macos/Runner/AppDelegate.swift | 6 +++++- .../example/macos/Runner/AppDelegate.swift | 6 +++++- .../in_app_purchase/example/macos/Runner/AppDelegate.swift | 6 +++++- .../example/macos/Runner/AppDelegate.swift | 4 ++++ .../local_auth/example/macos/Runner/AppDelegate.swift | 6 +++++- .../example/macos/Runner/AppDelegate.swift | 6 +++++- .../palette_generator/example/ios/Runner/AppDelegate.swift | 2 +- .../example/macos/Runner/AppDelegate.swift | 6 +++++- .../path_provider/example/macos/Runner/AppDelegate.swift | 6 +++++- .../example/ios/Runner/AppDelegate.swift | 2 +- .../example/macos/Runner/AppDelegate.swift | 6 +++++- packages/pigeon/example/app/macos/Runner/AppDelegate.swift | 6 +++++- .../example/ios/Runner/AppDelegate.swift | 2 +- .../example/ios/Runner/AppDelegate.swift | 2 +- packages/rfw/example/hello/ios/Runner/AppDelegate.swift | 2 +- packages/rfw/example/hello/macos/Runner/AppDelegate.swift | 6 +++++- packages/rfw/example/local/ios/Runner/AppDelegate.swift | 2 +- packages/rfw/example/local/macos/Runner/AppDelegate.swift | 6 +++++- packages/rfw/example/remote/ios/Runner/AppDelegate.swift | 2 +- packages/rfw/example/remote/macos/Runner/AppDelegate.swift | 6 +++++- packages/rfw/example/wasm/macos/Runner/AppDelegate.swift | 6 +++++- .../shared_preferences/example/ios/Runner/AppDelegate.swift | 2 +- .../example/macos/Runner/AppDelegate.swift | 6 +++++- .../example/macos/Runner/AppDelegate.swift | 4 ++++ .../example/ios/Runner/AppDelegate.swift | 2 +- .../example/macos/Runner/AppDelegate.swift | 4 ++++ .../example/macos/Runner/AppDelegate.swift | 6 +++++- .../video_player/example/macos/Runner/AppDelegate.swift | 6 +++++- .../example/macos/Runner/AppDelegate.swift | 4 ++++ .../webview_flutter/example/macos/Runner/AppDelegate.swift | 4 ++++ .../example/macos/Runner/AppDelegate.swift | 4 ++++ .../flutter_svg/example/ios/Runner/AppDelegate.swift | 2 +- .../flutter_svg/example/macos/Runner/AppDelegate.swift | 6 +++++- 47 files changed, 165 insertions(+), 41 deletions(-) diff --git a/packages/animations/example/ios/Runner/AppDelegate.swift b/packages/animations/example/ios/Runner/AppDelegate.swift index d83c0ff0beea..4580c8e76da4 100644 --- a/packages/animations/example/ios/Runner/AppDelegate.swift +++ b/packages/animations/example/ios/Runner/AppDelegate.swift @@ -5,7 +5,7 @@ import Flutter import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/file_selector/file_selector/example/ios/Runner/AppDelegate.swift b/packages/file_selector/file_selector/example/ios/Runner/AppDelegate.swift index d83c0ff0beea..4580c8e76da4 100644 --- a/packages/file_selector/file_selector/example/ios/Runner/AppDelegate.swift +++ b/packages/file_selector/file_selector/example/ios/Runner/AppDelegate.swift @@ -5,7 +5,7 @@ import Flutter import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/file_selector/file_selector/example/macos/Runner/AppDelegate.swift b/packages/file_selector/file_selector/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/file_selector/file_selector/example/macos/Runner/AppDelegate.swift +++ b/packages/file_selector/file_selector/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/file_selector/file_selector_macos/example/macos/Runner/AppDelegate.swift b/packages/file_selector/file_selector_macos/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/file_selector/file_selector_macos/example/macos/Runner/AppDelegate.swift +++ b/packages/file_selector/file_selector_macos/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/flutter_adaptive_scaffold/example/ios/Runner/AppDelegate.swift b/packages/flutter_adaptive_scaffold/example/ios/Runner/AppDelegate.swift index d83c0ff0beea..4580c8e76da4 100644 --- a/packages/flutter_adaptive_scaffold/example/ios/Runner/AppDelegate.swift +++ b/packages/flutter_adaptive_scaffold/example/ios/Runner/AppDelegate.swift @@ -5,7 +5,7 @@ import Flutter import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/flutter_adaptive_scaffold/example/macos/Runner/AppDelegate.swift b/packages/flutter_adaptive_scaffold/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/flutter_adaptive_scaffold/example/macos/Runner/AppDelegate.swift +++ b/packages/flutter_adaptive_scaffold/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/flutter_image/example/ios/Runner/AppDelegate.swift b/packages/flutter_image/example/ios/Runner/AppDelegate.swift index d83c0ff0beea..4580c8e76da4 100644 --- a/packages/flutter_image/example/ios/Runner/AppDelegate.swift +++ b/packages/flutter_image/example/ios/Runner/AppDelegate.swift @@ -5,7 +5,7 @@ import Flutter import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/flutter_image/example/macos/Runner/AppDelegate.swift b/packages/flutter_image/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/flutter_image/example/macos/Runner/AppDelegate.swift +++ b/packages/flutter_image/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/flutter_markdown/example/ios/Runner/AppDelegate.swift b/packages/flutter_markdown/example/ios/Runner/AppDelegate.swift index d83c0ff0beea..4580c8e76da4 100644 --- a/packages/flutter_markdown/example/ios/Runner/AppDelegate.swift +++ b/packages/flutter_markdown/example/ios/Runner/AppDelegate.swift @@ -5,7 +5,7 @@ import Flutter import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/flutter_markdown/example/macos/Runner/AppDelegate.swift b/packages/flutter_markdown/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/flutter_markdown/example/macos/Runner/AppDelegate.swift +++ b/packages/flutter_markdown/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/go_router/example/ios/Runner/AppDelegate.swift b/packages/go_router/example/ios/Runner/AppDelegate.swift index d83c0ff0beea..4580c8e76da4 100644 --- a/packages/go_router/example/ios/Runner/AppDelegate.swift +++ b/packages/go_router/example/ios/Runner/AppDelegate.swift @@ -5,7 +5,7 @@ import Flutter import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/go_router/example/macos/Runner/AppDelegate.swift b/packages/go_router/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/go_router/example/macos/Runner/AppDelegate.swift +++ b/packages/go_router/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/AppDelegate.swift b/packages/google_sign_in/google_sign_in/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner/AppDelegate.swift +++ b/packages/google_sign_in/google_sign_in/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/AppDelegate.swift b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/AppDelegate.swift +++ b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/image_picker/image_picker/example/macos/Runner/AppDelegate.swift b/packages/image_picker/image_picker/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/image_picker/image_picker/example/macos/Runner/AppDelegate.swift +++ b/packages/image_picker/image_picker/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/image_picker/image_picker_macos/example/macos/Runner/AppDelegate.swift b/packages/image_picker/image_picker_macos/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/image_picker/image_picker_macos/example/macos/Runner/AppDelegate.swift +++ b/packages/image_picker/image_picker_macos/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/in_app_purchase/in_app_purchase/example/macos/Runner/AppDelegate.swift b/packages/in_app_purchase/in_app_purchase/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/in_app_purchase/in_app_purchase/example/macos/Runner/AppDelegate.swift +++ b/packages/in_app_purchase/in_app_purchase/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/in_app_purchase/in_app_purchase_storekit/example/macos/Runner/AppDelegate.swift b/packages/in_app_purchase/in_app_purchase_storekit/example/macos/Runner/AppDelegate.swift index 689c0ecd5254..21fbd0297b22 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/example/macos/Runner/AppDelegate.swift +++ b/packages/in_app_purchase/in_app_purchase_storekit/example/macos/Runner/AppDelegate.swift @@ -10,4 +10,8 @@ class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/local_auth/local_auth/example/macos/Runner/AppDelegate.swift b/packages/local_auth/local_auth/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/local_auth/local_auth/example/macos/Runner/AppDelegate.swift +++ b/packages/local_auth/local_auth/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/local_auth/local_auth_darwin/example/macos/Runner/AppDelegate.swift b/packages/local_auth/local_auth_darwin/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/local_auth/local_auth_darwin/example/macos/Runner/AppDelegate.swift +++ b/packages/local_auth/local_auth_darwin/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/palette_generator/example/ios/Runner/AppDelegate.swift b/packages/palette_generator/example/ios/Runner/AppDelegate.swift index d83c0ff0beea..4580c8e76da4 100644 --- a/packages/palette_generator/example/ios/Runner/AppDelegate.swift +++ b/packages/palette_generator/example/ios/Runner/AppDelegate.swift @@ -5,7 +5,7 @@ import Flutter import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/palette_generator/example/macos/Runner/AppDelegate.swift b/packages/palette_generator/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/palette_generator/example/macos/Runner/AppDelegate.swift +++ b/packages/palette_generator/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/path_provider/path_provider/example/macos/Runner/AppDelegate.swift b/packages/path_provider/path_provider/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/path_provider/path_provider/example/macos/Runner/AppDelegate.swift +++ b/packages/path_provider/path_provider/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/path_provider/path_provider_foundation/example/ios/Runner/AppDelegate.swift b/packages/path_provider/path_provider_foundation/example/ios/Runner/AppDelegate.swift index d83c0ff0beea..4580c8e76da4 100644 --- a/packages/path_provider/path_provider_foundation/example/ios/Runner/AppDelegate.swift +++ b/packages/path_provider/path_provider_foundation/example/ios/Runner/AppDelegate.swift @@ -5,7 +5,7 @@ import Flutter import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/path_provider/path_provider_foundation/example/macos/Runner/AppDelegate.swift b/packages/path_provider/path_provider_foundation/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/path_provider/path_provider_foundation/example/macos/Runner/AppDelegate.swift +++ b/packages/path_provider/path_provider_foundation/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/pigeon/example/app/macos/Runner/AppDelegate.swift b/packages/pigeon/example/app/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/pigeon/example/app/macos/Runner/AppDelegate.swift +++ b/packages/pigeon/example/app/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/AppDelegate.swift b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/AppDelegate.swift index 8891e986b166..2ed87872b128 100644 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/AppDelegate.swift +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/AppDelegate.swift @@ -5,7 +5,7 @@ import Flutter import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/AppDelegate.swift b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/AppDelegate.swift index 8891e986b166..2ed87872b128 100644 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/AppDelegate.swift +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/AppDelegate.swift @@ -5,7 +5,7 @@ import Flutter import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/rfw/example/hello/ios/Runner/AppDelegate.swift b/packages/rfw/example/hello/ios/Runner/AppDelegate.swift index d83c0ff0beea..4580c8e76da4 100644 --- a/packages/rfw/example/hello/ios/Runner/AppDelegate.swift +++ b/packages/rfw/example/hello/ios/Runner/AppDelegate.swift @@ -5,7 +5,7 @@ import Flutter import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/rfw/example/hello/macos/Runner/AppDelegate.swift b/packages/rfw/example/hello/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/rfw/example/hello/macos/Runner/AppDelegate.swift +++ b/packages/rfw/example/hello/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/rfw/example/local/ios/Runner/AppDelegate.swift b/packages/rfw/example/local/ios/Runner/AppDelegate.swift index d83c0ff0beea..4580c8e76da4 100644 --- a/packages/rfw/example/local/ios/Runner/AppDelegate.swift +++ b/packages/rfw/example/local/ios/Runner/AppDelegate.swift @@ -5,7 +5,7 @@ import Flutter import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/rfw/example/local/macos/Runner/AppDelegate.swift b/packages/rfw/example/local/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/rfw/example/local/macos/Runner/AppDelegate.swift +++ b/packages/rfw/example/local/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/rfw/example/remote/ios/Runner/AppDelegate.swift b/packages/rfw/example/remote/ios/Runner/AppDelegate.swift index d83c0ff0beea..4580c8e76da4 100644 --- a/packages/rfw/example/remote/ios/Runner/AppDelegate.swift +++ b/packages/rfw/example/remote/ios/Runner/AppDelegate.swift @@ -5,7 +5,7 @@ import Flutter import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/rfw/example/remote/macos/Runner/AppDelegate.swift b/packages/rfw/example/remote/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/rfw/example/remote/macos/Runner/AppDelegate.swift +++ b/packages/rfw/example/remote/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/rfw/example/wasm/macos/Runner/AppDelegate.swift b/packages/rfw/example/wasm/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/rfw/example/wasm/macos/Runner/AppDelegate.swift +++ b/packages/rfw/example/wasm/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/shared_preferences/shared_preferences/example/ios/Runner/AppDelegate.swift b/packages/shared_preferences/shared_preferences/example/ios/Runner/AppDelegate.swift index d83c0ff0beea..4580c8e76da4 100644 --- a/packages/shared_preferences/shared_preferences/example/ios/Runner/AppDelegate.swift +++ b/packages/shared_preferences/shared_preferences/example/ios/Runner/AppDelegate.swift @@ -5,7 +5,7 @@ import Flutter import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/shared_preferences/shared_preferences/example/macos/Runner/AppDelegate.swift b/packages/shared_preferences/shared_preferences/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/shared_preferences/shared_preferences/example/macos/Runner/AppDelegate.swift +++ b/packages/shared_preferences/shared_preferences/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/shared_preferences/shared_preferences_foundation/example/macos/Runner/AppDelegate.swift b/packages/shared_preferences/shared_preferences_foundation/example/macos/Runner/AppDelegate.swift index 689c0ecd5254..21fbd0297b22 100644 --- a/packages/shared_preferences/shared_preferences_foundation/example/macos/Runner/AppDelegate.swift +++ b/packages/shared_preferences/shared_preferences_foundation/example/macos/Runner/AppDelegate.swift @@ -10,4 +10,8 @@ class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/two_dimensional_scrollables/example/ios/Runner/AppDelegate.swift b/packages/two_dimensional_scrollables/example/ios/Runner/AppDelegate.swift index d83c0ff0beea..4580c8e76da4 100644 --- a/packages/two_dimensional_scrollables/example/ios/Runner/AppDelegate.swift +++ b/packages/two_dimensional_scrollables/example/ios/Runner/AppDelegate.swift @@ -5,7 +5,7 @@ import Flutter import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/two_dimensional_scrollables/example/macos/Runner/AppDelegate.swift b/packages/two_dimensional_scrollables/example/macos/Runner/AppDelegate.swift index 689c0ecd5254..21fbd0297b22 100644 --- a/packages/two_dimensional_scrollables/example/macos/Runner/AppDelegate.swift +++ b/packages/two_dimensional_scrollables/example/macos/Runner/AppDelegate.swift @@ -10,4 +10,8 @@ class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/url_launcher/url_launcher_macos/example/macos/Runner/AppDelegate.swift b/packages/url_launcher/url_launcher_macos/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/url_launcher/url_launcher_macos/example/macos/Runner/AppDelegate.swift +++ b/packages/url_launcher/url_launcher_macos/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/video_player/video_player/example/macos/Runner/AppDelegate.swift b/packages/video_player/video_player/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..21fbd0297b22 100644 --- a/packages/video_player/video_player/example/macos/Runner/AppDelegate.swift +++ b/packages/video_player/video_player/example/macos/Runner/AppDelegate.swift @@ -5,9 +5,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/video_player/video_player_avfoundation/example/macos/Runner/AppDelegate.swift b/packages/video_player/video_player_avfoundation/example/macos/Runner/AppDelegate.swift index 689c0ecd5254..21fbd0297b22 100644 --- a/packages/video_player/video_player_avfoundation/example/macos/Runner/AppDelegate.swift +++ b/packages/video_player/video_player_avfoundation/example/macos/Runner/AppDelegate.swift @@ -10,4 +10,8 @@ class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/webview_flutter/webview_flutter/example/macos/Runner/AppDelegate.swift b/packages/webview_flutter/webview_flutter/example/macos/Runner/AppDelegate.swift index 689c0ecd5254..21fbd0297b22 100644 --- a/packages/webview_flutter/webview_flutter/example/macos/Runner/AppDelegate.swift +++ b/packages/webview_flutter/webview_flutter/example/macos/Runner/AppDelegate.swift @@ -10,4 +10,8 @@ class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/AppDelegate.swift b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/AppDelegate.swift index 689c0ecd5254..21fbd0297b22 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/AppDelegate.swift +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/macos/Runner/AppDelegate.swift @@ -10,4 +10,8 @@ class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/third_party/packages/flutter_svg/example/ios/Runner/AppDelegate.swift b/third_party/packages/flutter_svg/example/ios/Runner/AppDelegate.swift index 9074fee9290d..626664468b89 100644 --- a/third_party/packages/flutter_svg/example/ios/Runner/AppDelegate.swift +++ b/third_party/packages/flutter_svg/example/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import Flutter import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/third_party/packages/flutter_svg/example/macos/Runner/AppDelegate.swift b/third_party/packages/flutter_svg/example/macos/Runner/AppDelegate.swift index d53ef6437726..b3c176141221 100644 --- a/third_party/packages/flutter_svg/example/macos/Runner/AppDelegate.swift +++ b/third_party/packages/flutter_svg/example/macos/Runner/AppDelegate.swift @@ -1,9 +1,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } }