diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index 28066c9..ee6fbe4 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -2,7 +2,7 @@ import Flutter import UIKit import UniformTypeIdentifiers -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate, UIDocumentPickerDelegate { var flutterResult: FlutterResult? var directoryPath: URL! diff --git a/lib/components/window_frame.dart b/lib/components/window_frame.dart index 37b078c..fda1520 100644 --- a/lib/components/window_frame.dart +++ b/lib/components/window_frame.dart @@ -96,7 +96,7 @@ class WindowFrame extends StatelessWidget { ? Colors.white : Colors.black, ), - ).toAlign(Alignment.centerLeft).paddingLeft(4), + ).toAlign(Alignment.centerLeft).paddingLeft(4+(App.isMacOS?25:0)), ), ), if (kDebugMode) diff --git a/macos/Runner/AppDelegate.swift b/macos/Runner/AppDelegate.swift index fe764e2..906f330 100644 --- a/macos/Runner/AppDelegate.swift +++ b/macos/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { var flutterResult: FlutterResult? var directoryPath: URL! @@ -13,15 +13,21 @@ class AppDelegate: FlutterAppDelegate { methodChannel.setMethodCallHandler { (call, result) in switch call.method { case "getProxy": - if let proxySettings = CFNetworkCopySystemProxySettings()?.takeUnretainedValue() as NSDictionary?, - let dict = proxySettings.object(forKey: kCFNetworkProxiesHTTPProxy) as? NSDictionary, - let host = dict.object(forKey: kCFNetworkProxiesHTTPProxy) as? String, - let port = dict.object(forKey: kCFNetworkProxiesHTTPPort) as? Int { - let proxyConfig = "\(host):\(port)" - result(proxyConfig) - } else { - result("") - } + if let proxySettings = CFNetworkCopySystemProxySettings()?.takeUnretainedValue() as NSDictionary? { + if let httpProxy = proxySettings[kCFNetworkProxiesHTTPProxy] as? String, + let httpPort = proxySettings[kCFNetworkProxiesHTTPPort] as? Int { + let proxyConfig = "\(httpProxy):\(httpPort)" + result(proxyConfig) + } else if let socksProxy = proxySettings[kCFNetworkProxiesSOCKSProxy] as? String, + let socksPort = proxySettings[kCFNetworkProxiesSOCKSPort] as? Int { + let proxyConfig = "\(socksProxy):\(socksPort)" + result(proxyConfig) + } else { + result("") + } + } else { + result("") + } case "getDirectoryPath": self.flutterResult = result self.getDirectoryPath()