diff --git a/.gitignore b/.gitignore
index cb6bcca2..18f42f94 100644
--- a/.gitignore
+++ b/.gitignore
@@ -57,6 +57,8 @@ Flutter.podspec
Generated.xcconfig
flutter_export_environment.sh
GeneratedPluginRegistrant.*
+.build/
+.swiftpm/
# Windows related
*.suo
diff --git a/darwin/Assets/.gitkeep b/darwin/Assets/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/darwin/gal.podspec b/darwin/gal.podspec
index 6f10d202..a61bd2c6 100644
--- a/darwin/gal.podspec
+++ b/darwin/gal.podspec
@@ -7,10 +7,11 @@ Pod::Spec.new do |s|
s.version = '1.0.0'
s.summary = 'Flutter plugin for handle native gallary apps.'
s.homepage = 'https://github.com/natsuk4ze/gal'
- s.license = { :file => '../LICENSE' }
+ s.license = { :type => 'BSD-3-Clause', :file => '../LICENSE' }
s.author = { 'Midori Design Studio' => 'https://midoridesign.studio' }
- s.source = { :path => '.' }
- s.source_files = 'Classes/**/*'
+ s.source = { :http => 'https://github.com/natsuk4ze/gal' }
+ s.source_files = 'gal/Sources/gal/**/*.swift'
+ s.resource_bundles = {'gal_privacy' => ['gal/Sources/gal/PrivacyInfo.xcprivacy']}
s.ios.dependency 'Flutter'
s.osx.dependency 'FlutterMacOS'
s.ios.deployment_target = '11.0'
diff --git a/darwin/gal/Package.swift b/darwin/gal/Package.swift
new file mode 100644
index 00000000..702ccc0d
--- /dev/null
+++ b/darwin/gal/Package.swift
@@ -0,0 +1,26 @@
+// swift-tools-version: 5.9
+// The swift-tools-version declares the minimum version of Swift required to build this package.
+
+import PackageDescription
+
+let package = Package(
+ name: "gal",
+ platforms: [
+ .iOS("11.0"),
+ .macOS("11.0")
+ ],
+ products: [
+ .library(name: "gal", targets: ["gal"])
+ ],
+ dependencies: [],
+ targets: [
+ .target(
+ name: "gal",
+ dependencies: [],
+ resources: [
+ .process("PrivacyInfo.xcprivacy")
+ ]
+ )
+ ]
+)
+
diff --git a/darwin/Classes/GalPlugin.swift b/darwin/gal/Sources/gal/GalPlugin.swift
similarity index 100%
rename from darwin/Classes/GalPlugin.swift
rename to darwin/gal/Sources/gal/GalPlugin.swift
diff --git a/darwin/gal/Sources/gal/PrivacyInfo.xcprivacy b/darwin/gal/Sources/gal/PrivacyInfo.xcprivacy
new file mode 100644
index 00000000..0eca193e
--- /dev/null
+++ b/darwin/gal/Sources/gal/PrivacyInfo.xcprivacy
@@ -0,0 +1,14 @@
+
+
+
+
+ NSPrivacyTrackingDomains
+
+ NSPrivacyAccessedAPITypes
+
+ NSPrivacyCollectedDataTypes
+
+ NSPrivacyTracking
+
+
+
\ No newline at end of file
diff --git a/example/macos/Podfile.lock b/example/macos/Podfile.lock
index a12e31bb..5c6e8b7b 100644
--- a/example/macos/Podfile.lock
+++ b/example/macos/Podfile.lock
@@ -1,23 +1,16 @@
PODS:
- FlutterMacOS (1.0.0)
- - gal (1.0.0):
- - Flutter
- - FlutterMacOS
DEPENDENCIES:
- FlutterMacOS (from `Flutter/ephemeral`)
- - gal (from `Flutter/ephemeral/.symlinks/plugins/gal/darwin`)
EXTERNAL SOURCES:
FlutterMacOS:
:path: Flutter/ephemeral
- gal:
- :path: Flutter/ephemeral/.symlinks/plugins/gal/darwin
SPEC CHECKSUMS:
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
- gal: 61e868295d28fe67ffa297fae6dacebf56fd53e1
PODFILE CHECKSUM: 23282d8bcd3669427c3011c3d9efa633cc463571
-COCOAPODS: 1.12.1
+COCOAPODS: 1.16.2
diff --git a/example/macos/Runner.xcodeproj/project.pbxproj b/example/macos/Runner.xcodeproj/project.pbxproj
index e13dce4d..a0c0f877 100644
--- a/example/macos/Runner.xcodeproj/project.pbxproj
+++ b/example/macos/Runner.xcodeproj/project.pbxproj
@@ -26,6 +26,7 @@
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
+ 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
8A82197E86D4414808DEC9DB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9974680D560E534269163590 /* Pods_Runner.framework */; };
/* End PBXBuildFile section */
@@ -81,6 +82,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
8A82197E86D4414808DEC9DB /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -185,7 +187,6 @@
33CC10EB2044A3C60003C045 /* Resources */,
33CC110E2044A8840003C045 /* Bundle Framework */,
3399D490228B24CF009A79C7 /* ShellScript */,
- 946F29F25F8DEA27AFBEC3E4 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -193,6 +194,9 @@
33CC11202044C79F0003C045 /* PBXTargetDependency */,
);
name = Runner;
+ packageProductDependencies = (
+ 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
+ );
productName = Runner;
productReference = 33CC10ED2044A3C60003C045 /* example.app */;
productType = "com.apple.product-type.application";
@@ -204,7 +208,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
- LastUpgradeCheck = 1430;
+ LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {
@@ -232,6 +236,9 @@
Base,
);
mainGroup = 33CC10E42044A3C60003C045;
+ packageReferences = (
+ 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
+ );
productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;
projectDirPath = "";
projectRoot = "";
@@ -317,23 +324,6 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
- 946F29F25F8DEA27AFBEC3E4 /* [CP] Embed Pods Frameworks */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
- );
- name = "[CP] Embed Pods Frameworks";
- outputFileListPaths = (
- "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
- showEnvVarsInLog = 0;
- };
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -637,6 +627,20 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
+
+/* Begin XCLocalSwiftPackageReference section */
+ 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
+ isa = XCLocalSwiftPackageReference;
+ relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
+ };
+/* End XCLocalSwiftPackageReference section */
+
+/* Begin XCSwiftPackageProductDependency section */
+ 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
+ isa = XCSwiftPackageProductDependency;
+ productName = FlutterGeneratedPluginSwiftPackage;
+ };
+/* End XCSwiftPackageProductDependency section */
};
rootObject = 33CC10E52044A3C60003C045 /* Project object */;
}
diff --git a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index 397f3d33..ee5d00fc 100644
--- a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -1,10 +1,28 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/example/macos/Runner/AppDelegate.swift b/example/macos/Runner/AppDelegate.swift
index d53ef643..b3c17614 100644
--- a/example/macos/Runner/AppDelegate.swift
+++ b/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
+ }
}