원클릭으로
flutter-spm
Guide for integrating, configuring, and caching dependencies using Swift Package Manager (SPM) in Flutter iOS/macOS applications.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Guide for integrating, configuring, and caching dependencies using Swift Package Manager (SPM) in Flutter iOS/macOS applications.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Audit and rewrite project changelogs to adhere strictly to Keep a Changelog and Semantic Versioning standards. Use when reviewing, drafting, or refining project changelogs.
Guide for utilizing the Genkit Dart SDK to build full-stack, AI-powered agentic applications.
Guide for utilizing Dart 3.0+ up to 3.12 syntax updates (private named parameters, extension types, records, pattern matching, wildcard variables, and primary constructors).
Optimize Dart code for performance, type safety, and runtime error prevention. Use when profiling hot paths, enforcing sound typing, handling null safety, or debugging type mismatches and runtime failures.
Run Dart tooling workflows for static analysis, dependency conflict resolution, and test migration to package:checks. Use when fixing analyzer errors, resolving pub dependency conflicts, or modernizing test assertions.
Configure and run integration tests using the integration_test package with Flutter Driver. Use when testing complete user flows, verifying navigation, or running end-to-end tests on devices or CI.
| name | flutter-spm |
| description | Guide for integrating, configuring, and caching dependencies using Swift Package Manager (SPM) in Flutter iOS/macOS applications. |
| metadata | {"platforms":"flutter, ios, macOS","languages":"swift, dart","category":"platform"} |
Introduced in Flutter 3.44
Swift Package Manager is the default dependency manager for iOS and macOS applications in Flutter, replacing CocoaPods. This modern integration improves compilation speeds and simplifies native package dependency trees.
In Flutter 3.44+, newly generated iOS and macOS platforms are configured to use SPM out of the box.
Podfile or Podfile.lock: The iOS directory no longer requires CocoaPods.pubspec.yaml or Package.swift files, which Flutter automatically integrates into the runner target.To add a native package directly to the iOS Runner:
ios/Runner.xcworkspace in Xcode.https://github.com/Alamofire/Alamofire) and select target version.Runner target.To define an SPM dependency for a Flutter plugin, use the swift_packages field in pubspec.yaml:
flutter:
plugin:
platforms:
ios:
pluginClass: MyPlugin
swift_packages:
- name: Alamofire
url: https://github.com/Alamofire/Alamofire.git
version: 5.9.0
SPM dependencies are stored outside the project workspace. To optimize CI build times (e.g., in GitHub Actions), cache the following directories:
~/Library/Caches/org.swift.swiftpm~/Library/Developer/Xcode/DerivedData- name: Cache Swift Package Manager Dependencies
uses: actions/cache@v4
with:
path: |
~/Library/Caches/org.swift.swiftpm
~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-spm-${{ hashFiles('**/pubspec.yaml', 'ios/Runner.xcodeproj/project.pbxproj') }}
restore-keys: |
${{ runner.os }}-spm-
If SPM dependencies fail to resolve during CLI builds:
# 1. Clean the project
flutter clean
# 2. Resolve package dependencies manually via Xcode CLI
xcodebuild -resolvePackageDependencies -workspace ios/Runner.xcworkspace -scheme Runner
If multiple plugins request incompatible versions of the same Swift Package: