From 4dca7bf8fd8aafbb54c57bf34ce7f1d87d69fc92 Mon Sep 17 00:00:00 2001 From: Bruno D'Luka Date: Tue, 30 Dec 2025 22:37:23 -0300 Subject: [PATCH 01/11] chore: Migrate iOS to Swift Package Manager --- .../ios/Flutter/AppFrameworkInfo.plist | 2 +- system_theme/example/ios/Podfile.lock | 16 ++ .../ios/Runner.xcodeproj/project.pbxproj | 152 +++++++++++++++--- .../xcshareddata/xcschemes/Runner.xcscheme | 23 ++- .../contents.xcworkspacedata | 3 + .../example/ios/Runner/AppDelegate.swift | 2 +- system_theme/example/lib/main.dart | 60 +++---- system_theme/example/pubspec.lock | 2 +- system_theme/ios/system_theme.podspec | 13 +- system_theme/ios/system_theme/Package.swift | 23 +++ .../system_theme}/SystemThemePlugin.swift | 0 system_theme/macos/system_theme/Package.swift | 10 -- 12 files changed, 238 insertions(+), 68 deletions(-) create mode 100644 system_theme/example/ios/Podfile.lock create mode 100644 system_theme/ios/system_theme/Package.swift rename system_theme/ios/{Classes => system_theme/Sources/system_theme}/SystemThemePlugin.swift (100%) diff --git a/system_theme/example/ios/Flutter/AppFrameworkInfo.plist b/system_theme/example/ios/Flutter/AppFrameworkInfo.plist index 9625e10..1dc6cf7 100644 --- a/system_theme/example/ios/Flutter/AppFrameworkInfo.plist +++ b/system_theme/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 13.0 diff --git a/system_theme/example/ios/Podfile.lock b/system_theme/example/ios/Podfile.lock new file mode 100644 index 0000000..64cf43c --- /dev/null +++ b/system_theme/example/ios/Podfile.lock @@ -0,0 +1,16 @@ +PODS: + - Flutter (1.0.0) + +DEPENDENCIES: + - Flutter (from `Flutter`) + +EXTERNAL SOURCES: + Flutter: + :path: Flutter + +SPEC CHECKSUMS: + Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 + +PODFILE CHECKSUM: 3c63482e143d1b91d2d2560aee9fb04ecc74ac7e + +COCOAPODS: 1.16.2 diff --git a/system_theme/example/ios/Runner.xcodeproj/project.pbxproj b/system_theme/example/ios/Runner.xcodeproj/project.pbxproj index 4052416..15120a5 100644 --- a/system_theme/example/ios/Runner.xcodeproj/project.pbxproj +++ b/system_theme/example/ios/Runner.xcodeproj/project.pbxproj @@ -7,13 +7,16 @@ objects = { /* Begin PBXBuildFile section */ + 07ECE0DB5F450590573FE64E /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6057649D9203F03E6AB7CC2A /* Pods_RunnerTests.framework */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + FE8DA28319D58882F93F35D4 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 56940AAB1EAFC3DBB0E1C09C /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -42,10 +45,17 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 56940AAB1EAFC3DBB0E1C09C /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6057649D9203F03E6AB7CC2A /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 7FD9CE467A41E3D43C2BC967 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + 858DB106870D8EA2D9A5CFFE /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -53,8 +63,10 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; - 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + AA654FBB2E00502340207AFF /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + B8FD728A3AC9CB7BAA72AEFA /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + DCB0B645381B35079F72003A /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + EE5473005ECC9579113F1308 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -62,15 +74,43 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, + FE8DA28319D58882F93F35D4 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E98FC8AD2224E617178D003A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 07ECE0DB5F450590573FE64E /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 879EAFC168FE9441D7AB1E2F /* Frameworks */ = { + isa = PBXGroup; + children = ( + 56940AAB1EAFC3DBB0E1C09C /* Pods_Runner.framework */, + 6057649D9203F03E6AB7CC2A /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, @@ -79,14 +119,6 @@ name = Flutter; sourceTree = ""; }; - 331C8082294A63A400263BE5 /* RunnerTests */ = { - isa = PBXGroup; - children = ( - 331C807B294A618700263BE5 /* RunnerTests.swift */, - ); - path = RunnerTests; - sourceTree = ""; - }; 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( @@ -94,6 +126,8 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, + A36F4937CE0F57C7B847F180 /* Pods */, + 879EAFC168FE9441D7AB1E2F /* Frameworks */, ); sourceTree = ""; }; @@ -121,6 +155,20 @@ path = Runner; sourceTree = ""; }; + A36F4937CE0F57C7B847F180 /* Pods */ = { + isa = PBXGroup; + children = ( + 858DB106870D8EA2D9A5CFFE /* Pods-Runner.debug.xcconfig */, + DCB0B645381B35079F72003A /* Pods-Runner.release.xcconfig */, + B8FD728A3AC9CB7BAA72AEFA /* Pods-Runner.profile.xcconfig */, + AA654FBB2E00502340207AFF /* Pods-RunnerTests.debug.xcconfig */, + 7FD9CE467A41E3D43C2BC967 /* Pods-RunnerTests.release.xcconfig */, + EE5473005ECC9579113F1308 /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -128,9 +176,10 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( + 4EEAA810595806106F578814 /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, - 331C807E294A63A400263BE5 /* Frameworks */, 331C807F294A63A400263BE5 /* Resources */, + E98FC8AD2224E617178D003A /* Frameworks */, ); buildRules = ( ); @@ -146,6 +195,7 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + EBC8E4411EBA658CBF388983 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, @@ -158,6 +208,9 @@ dependencies = ( ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; @@ -168,7 +221,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 331C8080294A63A400263BE5 = { @@ -190,6 +243,9 @@ Base, ); mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; @@ -238,6 +294,28 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; + 4EEAA810595806106F578814 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + 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; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -253,6 +331,28 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + EBC8E4411EBA658CBF388983 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + 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; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -344,7 +444,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -376,7 +476,7 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AE0B7B92F70575B8D7E0D07E /* Pods-RunnerTests.debug.xcconfig */; + baseConfigurationReference = AA654FBB2E00502340207AFF /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -394,7 +494,7 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 89B67EB44CE7B6631473024E /* Pods-RunnerTests.release.xcconfig */; + baseConfigurationReference = 7FD9CE467A41E3D43C2BC967 /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -410,7 +510,7 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 640959BDD8F10B91D80A66BE /* Pods-RunnerTests.profile.xcconfig */; + baseConfigurationReference = EE5473005ECC9579113F1308 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -471,7 +571,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -520,7 +620,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -608,6 +708,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 = 97C146E61CF9000F007C117D /* Project object */; } diff --git a/system_theme/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/system_theme/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index e42adcb..c3fedb2 100644 --- a/system_theme/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/system_theme/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,10 +1,28 @@ + + + + + + + + + + diff --git a/system_theme/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/system_theme/example/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a1..21a3cc1 100644 --- a/system_theme/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/system_theme/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/system_theme/example/ios/Runner/AppDelegate.swift b/system_theme/example/ios/Runner/AppDelegate.swift index 70693e4..b636303 100644 --- a/system_theme/example/ios/Runner/AppDelegate.swift +++ b/system_theme/example/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/system_theme/example/lib/main.dart b/system_theme/example/lib/main.dart index 057a504..240d0e9 100644 --- a/system_theme/example/lib/main.dart +++ b/system_theme/example/lib/main.dart @@ -33,36 +33,38 @@ class _MyAppState extends State { accent.darkest, ]; return Scaffold( - body: Column(children: [ - Text( - 'Accent color: ${defaultTargetPlatform.supportsAccentColor ? 'supported' : 'not supported'}'), - ...colors.map((color) { - return Expanded( - child: Container( - color: color, - alignment: Alignment.center, - child: Text( - [ - 'Lightest', - 'Lighter', - 'Light', - 'Default', - 'Dark', - 'Darker', - 'Darkest', - ][colors.indexOf(color)] + - '\n${color.toHex()}', - style: Theme.of(context).textTheme.titleLarge?.copyWith( - color: color.computeLuminance() >= 0.5 - ? Colors.black - : Colors.white, - ), - textAlign: TextAlign.center, + body: SafeArea( + child: Column(children: [ + Text( + 'Accent color: ${defaultTargetPlatform.supportsAccentColor ? 'supported' : 'not supported'}'), + ...colors.map((color) { + return Expanded( + child: Container( + color: color, + alignment: Alignment.center, + child: Text( + [ + 'Lightest', + 'Lighter', + 'Light', + 'Default', + 'Dark', + 'Darker', + 'Darkest', + ][colors.indexOf(color)] + + '\n${color.toHex()}', + style: Theme.of(context).textTheme.titleLarge?.copyWith( + color: color.computeLuminance() >= 0.5 + ? Colors.black + : Colors.white, + ), + textAlign: TextAlign.center, + ), ), - ), - ); - }).toList(), - ]), + ); + }).toList(), + ]), + ), ); }); } diff --git a/system_theme/example/pubspec.lock b/system_theme/example/pubspec.lock index 2be4369..00e0435 100644 --- a/system_theme/example/pubspec.lock +++ b/system_theme/example/pubspec.lock @@ -179,7 +179,7 @@ packages: path: ".." relative: true source: path - version: "3.1.2" + version: "3.2.0" system_theme_web: dependency: transitive description: diff --git a/system_theme/ios/system_theme.podspec b/system_theme/ios/system_theme.podspec index 3322ae4..03dfe61 100644 --- a/system_theme/ios/system_theme.podspec +++ b/system_theme/ios/system_theme.podspec @@ -4,16 +4,17 @@ # Pod::Spec.new do |s| s.name = 'system_theme' - s.version = '0.0.1' - s.summary = 'A new Flutter plugin project.' + s.version = '3.2.0' + s.summary = 'A Flutter Plugin to retrieve the system theme.' s.description = <<-DESC -A new Flutter plugin project. +A plugin to get the current system theme info. Supports Android, Web, Windows, Linux and macOS DESC - s.homepage = 'http://example.com' + s.homepage = 'https://github.com/bdlukaa/system_theme' s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } + s.author = { 'Bruno D Luka' => 'email@example.com' } + s.source = { :path => '.' } - s.source_files = 'Classes/**/*' + s.source_files = 'system_theme/Sources/system_theme/**/*.swift' s.dependency 'Flutter' s.platform = :ios, '11.0' diff --git a/system_theme/ios/system_theme/Package.swift b/system_theme/ios/system_theme/Package.swift new file mode 100644 index 0000000..b3797d2 --- /dev/null +++ b/system_theme/ios/system_theme/Package.swift @@ -0,0 +1,23 @@ +// 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: "system_theme", + platforms: [ + .iOS("13") + ], + products: [ + .library(name: "system-theme", targets: ["system_theme"]) + ], + dependencies: [], + targets: [ + .target( + name: "system_theme", + dependencies: [], + resources: [ + ] + ) + ] +) diff --git a/system_theme/ios/Classes/SystemThemePlugin.swift b/system_theme/ios/system_theme/Sources/system_theme/SystemThemePlugin.swift similarity index 100% rename from system_theme/ios/Classes/SystemThemePlugin.swift rename to system_theme/ios/system_theme/Sources/system_theme/SystemThemePlugin.swift diff --git a/system_theme/macos/system_theme/Package.swift b/system_theme/macos/system_theme/Package.swift index a4b5906..29c7bc9 100644 --- a/system_theme/macos/system_theme/Package.swift +++ b/system_theme/macos/system_theme/Package.swift @@ -17,16 +17,6 @@ let package = Package( name: "system_theme", dependencies: [], resources: [ - // TODO: If your plugin requires a privacy manifest - // (e.g. if it uses any required reason APIs), update the PrivacyInfo.xcprivacy file - // to describe your plugin's privacy impact, and then uncomment this line. - // For more information, see: - // https://developer.apple.com/documentation/bundleresources/privacy_manifest_files - // .process("PrivacyInfo.xcprivacy"), - - // TODO: If you have other resources that need to be bundled with your plugin, refer to - // the following instructions to add them: - // https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package ] ) ] From f8bc432342a0f0174de5277419f8c4b19784357f Mon Sep 17 00:00:00 2001 From: Bruno D'Luka Date: Tue, 30 Dec 2025 22:52:08 -0300 Subject: [PATCH 02/11] fix(web): Correctly handle colors without alpha channel --- system_theme/example/.gitignore | 1 - system_theme/pubspec.lock | 9 ++++----- system_theme/pubspec.yaml | 6 +++--- system_theme_web/CHANGELOG.md | 8 ++++++-- system_theme_web/lib/system_theme_web.dart | 18 +++++++++++------- system_theme_web/pubspec.yaml | 4 ++-- 6 files changed, 26 insertions(+), 20 deletions(-) diff --git a/system_theme/example/.gitignore b/system_theme/example/.gitignore index 0fa6b67..a1345d0 100644 --- a/system_theme/example/.gitignore +++ b/system_theme/example/.gitignore @@ -32,7 +32,6 @@ /build/ # Web related -lib/generated_plugin_registrant.dart # Symbolication related app.*.symbols diff --git a/system_theme/pubspec.lock b/system_theme/pubspec.lock index 7d8361d..215235e 100644 --- a/system_theme/pubspec.lock +++ b/system_theme/pubspec.lock @@ -176,11 +176,10 @@ packages: system_theme_web: dependency: "direct main" description: - name: system_theme_web - sha256: "900c92c5c050ce58048f241ef9a17e5cd8629808325a05b473dc62a6e99bae77" - url: "https://pub.dev" - source: hosted - version: "0.0.3" + path: "../system_theme_web" + relative: true + source: path + version: "0.0.4" term_glyph: dependency: transitive description: diff --git a/system_theme/pubspec.yaml b/system_theme/pubspec.yaml index 7438cb6..a675161 100644 --- a/system_theme/pubspec.yaml +++ b/system_theme/pubspec.yaml @@ -5,12 +5,12 @@ repository: https://github.com/bdlukaa/system_theme homepage: https://github.com/bdlukaa/system_theme/tree/master/system_theme environment: - sdk: '>=2.12.0 <4.0.0' + sdk: '>=3.0.0 <4.0.0' flutter: ">=1.20.0" dependencies: - system_theme_web: ^0.0.3 - # path: ../system_theme_web/ + system_theme_web: # ^0.0.4 + path: ../system_theme_web/ flutter: sdk: flutter diff --git a/system_theme_web/CHANGELOG.md b/system_theme_web/CHANGELOG.md index a95f033..0beed4f 100644 --- a/system_theme_web/CHANGELOG.md +++ b/system_theme_web/CHANGELOG.md @@ -1,10 +1,14 @@ +## 0.0.4 + +- Correctly handle colors without alpha channel. + ## 0.0.3 -- Support RGBA colors +- Support RGBA colors. ## 0.0.2 -- Support for getting accent color +- Support for getting accent color. ## 0.0.1 diff --git a/system_theme_web/lib/system_theme_web.dart b/system_theme_web/lib/system_theme_web.dart index 68f2b53..b5bcba6 100644 --- a/system_theme_web/lib/system_theme_web.dart +++ b/system_theme_web/lib/system_theme_web.dart @@ -17,9 +17,6 @@ class SystemThemeWeb { channel.setMethodCallHandler(pluginInstance.handleMethodCall); } - /// Handles method calls over the MethodChannel of this plugin. - /// Note: Check the "federated" architecture for a new way of doing this: - /// https://flutter.dev/go/federated-plugins Future handleMethodCall(MethodCall call) async { switch (call.method) { case 'SystemTheme.accentColor': @@ -42,10 +39,17 @@ class SystemThemeWeb { .replaceAll(' ', ''); final rgb = backgroundColor.split(','); - final r = int.tryParse(rgb[0]) ?? 255; - final g = int.tryParse(rgb[1]) ?? 255; - final b = int.tryParse(rgb[2]) ?? 255; - final a = int.tryParse(rgb[3]) ?? 255; + if (rgb.length < 3) { + throw PlatformException( + code: 'Unsupported', + details: 'The accent color is not available in this browser.', + ); + } + + final r = int.tryParse(rgb.firstOrNull ?? '') ?? 255; + final g = int.tryParse(rgb.elementAtOrNull(1) ?? '') ?? 255; + final b = int.tryParse(rgb.elementAtOrNull(2) ?? '') ?? 255; + final a = int.tryParse(rgb.elementAtOrNull(3) ?? '') ?? 255; return { 'accent': { diff --git a/system_theme_web/pubspec.yaml b/system_theme_web/pubspec.yaml index a6dc1bc..6efbdab 100644 --- a/system_theme_web/pubspec.yaml +++ b/system_theme_web/pubspec.yaml @@ -1,10 +1,10 @@ name: system_theme_web description: system_theme implementation for the Web -version: 0.0.3 +version: 0.0.4 homepage: https://github.com/bdlukaa/system_theme/tree/master/system_theme_web environment: - sdk: '>=2.12.0 <4.0.0' + sdk: '>=3.0.0 <4.0.0' flutter: ">=1.20.0" dependencies: From 42e883f84f97505b260c73652b0f80131bb97c15 Mon Sep 17 00:00:00 2001 From: Bruno D'Luka Date: Tue, 30 Dec 2025 23:32:01 -0300 Subject: [PATCH 03/11] fix(web): Correctly parse all types of colors from css --- system_theme/example/.metadata | 10 +- system_theme/example/pubspec.lock | 9 +- system_theme/example/web/index.html | 11 ++- system_theme/example/web/manifest.json | 4 +- system_theme_web/lib/system_theme_web.dart | 109 +++++++++++++++------ 5 files changed, 99 insertions(+), 44 deletions(-) diff --git a/system_theme/example/.metadata b/system_theme/example/.metadata index 784ce12..7e9cd50 100644 --- a/system_theme/example/.metadata +++ b/system_theme/example/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled and should not be manually edited. version: - revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3" + revision: "f6ff1529fd6d8af5f706051d9251ac9231c83407" channel: "stable" project_type: app @@ -13,11 +13,11 @@ project_type: app migration: platforms: - platform: root - create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 - base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 + base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 - platform: web - create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 - base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 + create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 + base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 # User provided section diff --git a/system_theme/example/pubspec.lock b/system_theme/example/pubspec.lock index 00e0435..ee9d240 100644 --- a/system_theme/example/pubspec.lock +++ b/system_theme/example/pubspec.lock @@ -183,11 +183,10 @@ packages: system_theme_web: dependency: transitive description: - name: system_theme_web - sha256: "900c92c5c050ce58048f241ef9a17e5cd8629808325a05b473dc62a6e99bae77" - url: "https://pub.dev" - source: hosted - version: "0.0.3" + path: "../../system_theme_web" + relative: true + source: path + version: "0.0.4" term_glyph: dependency: transitive description: diff --git a/system_theme/example/web/index.html b/system_theme/example/web/index.html index 3fa7abd..1e21cec 100644 --- a/system_theme/example/web/index.html +++ b/system_theme/example/web/index.html @@ -1,5 +1,6 @@ + - + - + system_theme_example + - + + \ No newline at end of file diff --git a/system_theme/example/web/manifest.json b/system_theme/example/web/manifest.json index 096edf8..144aaca 100644 --- a/system_theme/example/web/manifest.json +++ b/system_theme/example/web/manifest.json @@ -1,6 +1,6 @@ { - "name": "example", - "short_name": "example", + "name": "system_theme_example", + "short_name": "system_theme_example", "start_url": ".", "display": "standalone", "background_color": "#0175C2", diff --git a/system_theme_web/lib/system_theme_web.dart b/system_theme_web/lib/system_theme_web.dart index b5bcba6..351b7fc 100644 --- a/system_theme_web/lib/system_theme_web.dart +++ b/system_theme_web/lib/system_theme_web.dart @@ -31,34 +31,7 @@ class SystemThemeWeb { } if (backgroundColor != null) { - backgroundColor = backgroundColor - // most browsers return rgb, but some may return rgba. - .replaceAll('rgba', 'rgb') - .replaceAll('rgb(', '') - .replaceAll(')', '') - .replaceAll(' ', ''); - final rgb = backgroundColor.split(','); - - if (rgb.length < 3) { - throw PlatformException( - code: 'Unsupported', - details: 'The accent color is not available in this browser.', - ); - } - - final r = int.tryParse(rgb.firstOrNull ?? '') ?? 255; - final g = int.tryParse(rgb.elementAtOrNull(1) ?? '') ?? 255; - final b = int.tryParse(rgb.elementAtOrNull(2) ?? '') ?? 255; - final a = int.tryParse(rgb.elementAtOrNull(3) ?? '') ?? 255; - - return { - 'accent': { - 'R': r, - 'G': g, - 'B': b, - 'A': a, - } - }; + return extractColorFromCss(backgroundColor); } return null; default: @@ -68,4 +41,84 @@ class SystemThemeWeb { ); } } + + Map extractColorFromCss(String colorString) { + int r = 255; + int g = 255; + int b = 255; + int a = 255; + + // 1. Handle HEX input (e.g. #FFF, #000000, #000000FF) + if (colorString.startsWith('#')) { + var hex = colorString.replaceAll('#', ''); + + // Handle 3-digit hex (e.g. #FFF -> #FFFFFF) + if (hex.length == 3) { + hex = hex.split('').map((c) => '$c$c').join(); + } + + // Handle 6-digit (RRGGBB) or 8-digit (RRGGBBAA) + if (hex.length == 6 || hex.length == 8) { + r = int.parse(hex.substring(0, 2), radix: 16); + g = int.parse(hex.substring(2, 4), radix: 16); + b = int.parse(hex.substring(4, 6), radix: 16); + + if (hex.length == 8) { + a = int.parse(hex.substring(6, 8), radix: 16); + } + } else { + throw PlatformException( + code: 'Unsupported', + details: 'Invalid Hex color format: $colorString', + ); + } + } + // 2. Handle RGB / RGBA input + else if (colorString.startsWith('rgb')) { + final cleanString = colorString + .replaceAll('rgba', '') + .replaceAll('rgb', '') + .replaceAll('(', '') + .replaceAll(')', ''); + + final values = cleanString.split(',').map((s) => s.trim()).toList(); + + if (values.length < 3) { + throw PlatformException( + code: 'Unsupported', + details: 'The accent color is not available in this browser.', + ); + } + + r = int.tryParse(values[0]) ?? 255; + g = int.tryParse(values[1]) ?? 255; + b = int.tryParse(values[2]) ?? 255; + + if (values.length > 3) { + final alphaRaw = values[3]; + // Browser might return alpha as "0.5" (float) or "128" (int) + // If it contains a dot, treat as float 0.0-1.0 and convert to 0-255 + if (alphaRaw.contains('.')) { + final alphaFloat = double.tryParse(alphaRaw) ?? 1.0; + a = (alphaFloat * 255).round(); + } else { + a = int.tryParse(alphaRaw) ?? 255; + } + } + } else { + throw PlatformException( + code: 'Unsupported', + details: 'Unknown color format: $colorString', + ); + } + + return { + 'accent': { + 'R': r, + 'G': g, + 'B': b, + 'A': a, + } + }; + } } From 2685daf686eef332a63ea7c1d082cf0f0ee5940e Mon Sep 17 00:00:00 2001 From: Bruno D'Luka Date: Tue, 30 Dec 2025 23:32:55 -0300 Subject: [PATCH 04/11] chore: Use latest system_theme_web --- system_theme/pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system_theme/pubspec.yaml b/system_theme/pubspec.yaml index a675161..5c506da 100644 --- a/system_theme/pubspec.yaml +++ b/system_theme/pubspec.yaml @@ -9,8 +9,8 @@ environment: flutter: ">=1.20.0" dependencies: - system_theme_web: # ^0.0.4 - path: ../system_theme_web/ + system_theme_web: ^0.0.4 + # path: ../system_theme_web/ flutter: sdk: flutter From 416dc7ec16354d1f447e7f78362495c65d11a4cd Mon Sep 17 00:00:00 2001 From: Bruno D'Luka Date: Tue, 30 Dec 2025 23:52:23 -0300 Subject: [PATCH 05/11] chore(example): Rebuild Android folder --- system_theme/README.md | 6 -- system_theme/example/.metadata | 2 +- system_theme/example/android/.gitignore | 3 +- system_theme/example/android/app/build.gradle | 71 ------------------- .../example/android/app/build.gradle.kts | 44 ++++++++++++ .../android/app/src/debug/AndroidManifest.xml | 3 +- .../android/app/src/main/AndroidManifest.xml | 17 ++++- .../system_theme_example/MainActivity.kt | 3 +- .../app/src/profile/AndroidManifest.xml | 3 +- system_theme/example/android/build.gradle | 31 -------- system_theme/example/android/build.gradle.kts | 24 +++++++ .../example/android/gradle.properties | 3 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- system_theme/example/android/settings.gradle | 11 --- .../example/android/settings.gradle.kts | 26 +++++++ .../example/ios/Flutter/Debug.xcconfig | 1 - .../example/ios/Flutter/Release.xcconfig | 1 - system_theme/example/ios/Podfile | 43 ----------- system_theme/example/ios/Podfile.lock | 16 ----- system_theme/example/pubspec.lock | 7 +- 20 files changed, 120 insertions(+), 197 deletions(-) delete mode 100644 system_theme/example/android/app/build.gradle create mode 100644 system_theme/example/android/app/build.gradle.kts delete mode 100644 system_theme/example/android/build.gradle create mode 100644 system_theme/example/android/build.gradle.kts delete mode 100644 system_theme/example/android/settings.gradle create mode 100644 system_theme/example/android/settings.gradle.kts delete mode 100644 system_theme/example/ios/Podfile delete mode 100644 system_theme/example/ios/Podfile.lock diff --git a/system_theme/README.md b/system_theme/README.md index 56bbf40..b5c26c9 100644 --- a/system_theme/README.md +++ b/system_theme/README.md @@ -21,12 +21,6 @@

-- [Supported platforms](#supported-platforms) -- [Usage](#usage) - - [Get system accent color](#get-system-accent-color) -- [Contribution](#contribution) - - [Acknowlegments](#acknowlegments) - ### Supported platforms | Feature | Android 10+ | iOS | Web | MacOs 10.14+ | Windows 10+ and XBox | Linux GTK 3+ | diff --git a/system_theme/example/.metadata b/system_theme/example/.metadata index 7e9cd50..7ad3ada 100644 --- a/system_theme/example/.metadata +++ b/system_theme/example/.metadata @@ -15,7 +15,7 @@ migration: - platform: root create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 - - platform: web + - platform: android create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 diff --git a/system_theme/example/android/.gitignore b/system_theme/example/android/.gitignore index 6f56801..be3943c 100644 --- a/system_theme/example/android/.gitignore +++ b/system_theme/example/android/.gitignore @@ -5,9 +5,10 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +# See https://flutter.dev/to/reference-keystore key.properties **/*.keystore **/*.jks diff --git a/system_theme/example/android/app/build.gradle b/system_theme/example/android/app/build.gradle deleted file mode 100644 index f4f24d0..0000000 --- a/system_theme/example/android/app/build.gradle +++ /dev/null @@ -1,71 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion flutter.compileSdkVersion - ndkVersion flutter.ndkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.bruno.system_theme_example" - // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} diff --git a/system_theme/example/android/app/build.gradle.kts b/system_theme/example/android/app/build.gradle.kts new file mode 100644 index 0000000..564b35d --- /dev/null +++ b/system_theme/example/android/app/build.gradle.kts @@ -0,0 +1,44 @@ +plugins { + id("com.android.application") + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.bruno.system_theme_example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_17.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.bruno.system_theme_example" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/system_theme/example/android/app/src/debug/AndroidManifest.xml b/system_theme/example/android/app/src/debug/AndroidManifest.xml index f3e987b..399f698 100644 --- a/system_theme/example/android/app/src/debug/AndroidManifest.xml +++ b/system_theme/example/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + + + + + + + diff --git a/system_theme/example/android/app/src/main/kotlin/com/bruno/system_theme_example/MainActivity.kt b/system_theme/example/android/app/src/main/kotlin/com/bruno/system_theme_example/MainActivity.kt index 7b943a7..168209f 100644 --- a/system_theme/example/android/app/src/main/kotlin/com/bruno/system_theme_example/MainActivity.kt +++ b/system_theme/example/android/app/src/main/kotlin/com/bruno/system_theme_example/MainActivity.kt @@ -2,5 +2,4 @@ package com.bruno.system_theme_example import io.flutter.embedding.android.FlutterActivity -class MainActivity: FlutterActivity() { -} +class MainActivity : FlutterActivity() diff --git a/system_theme/example/android/app/src/profile/AndroidManifest.xml b/system_theme/example/android/app/src/profile/AndroidManifest.xml index f3e987b..399f698 100644 --- a/system_theme/example/android/app/src/profile/AndroidManifest.xml +++ b/system_theme/example/android/app/src/profile/AndroidManifest.xml @@ -1,5 +1,4 @@ - +