Try to fix compile error

This commit is contained in:
2024-02-06 13:39:30 +08:00
parent e8d800f93f
commit 2c7182e448

View File

@@ -17,7 +17,7 @@ func openFile(result: FlutterResult, url: URL, readOnly: Bool, writeOnly: Bool,
if append { if append {
opts.insert(FileDescriptor.OpenOptions.append) opts.insert(FileDescriptor.OpenOptions.append)
} }
let uPath = if #available(iOS 16.0, *) { var uPath = if #available(iOS 16.0, *) {
url.path(percentEncoded: false) url.path(percentEncoded: false)
} else { } else {
url.path url.path
@@ -138,13 +138,13 @@ class FilePickerDelegate: NSObject, UIDocumentPickerDelegate {
result(FlutterError(code: "FAILED_TO_GET_CACHE_DIRERCTORY", message: nil, details: nil)) result(FlutterError(code: "FAILED_TO_GET_CACHE_DIRERCTORY", message: nil, details: nil))
return return
} }
let dUrl = if #available(iOS 16.0, *) { var dUrl = if #available(iOS 16.0, *) {
URL.init(filePath: path!) URL.init(filePath: path!)
} else { } else {
URL.init(fileURLWithPath: path!) URL.init(fileURLWithPath: path!)
} }
let url = dUrl.appendingPathComponent(fileName + (ext ?? "")) let url = dUrl.appendingPathComponent(fileName + (ext ?? ""))
let uPath = if #available(iOS 16.0, *) { var uPath = if #available(iOS 16.0, *) {
url.path(percentEncoded: false) url.path(percentEncoded: false)
} else { } else {
url.path url.path