Add A Package Or Plugin
Treat every dependency as app surface area. Plugins are also platform surface area.
Workflow
- Search pub.dev and official docs.
- Confirm the package supports every target you care about.
- Read setup steps for Android, iOS, web, and desktop.
- Check maintenance, license, changelog, and major issues.
- Add the package.
- Run static and test gates.
- Fully restart the app if native code is involved.
- Smoke every target platform that depends on it.
flutter pub add package_name
flutter pub get
dart format pubspec.yaml lib test
flutter analyze
flutter test
Plugin Checklist
| Check | Required note |
|---|---|
| Target matrix | Which platforms are supported and unsupported? |
| Permissions | Android manifest, iOS Info.plist, desktop entitlements, web browser permissions |
| Setup | Gradle, CocoaPods/SPM, native files, generated code |
| Testing | Unit fake, widget fake, integration path, platform failure path |
| Release | Store policy, privacy declaration, signing/package impact |
Gotcha: A package can compile on your development target and still make the app unreleasable on another target because permissions, store policy, or packaging were never checked.