Add A Package Or Plugin

Treat every dependency as app surface area. Plugins are also platform surface area.

Workflow

  1. Search pub.dev and official docs.
  2. Confirm the package supports every target you care about.
  3. Read setup steps for Android, iOS, web, and desktop.
  4. Check maintenance, license, changelog, and major issues.
  5. Add the package.
  6. Run static and test gates.
  7. Fully restart the app if native code is involved.
  8. 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

CheckRequired note
Target matrixWhich platforms are supported and unsupported?
PermissionsAndroid manifest, iOS Info.plist, desktop entitlements, web browser permissions
SetupGradle, CocoaPods/SPM, native files, generated code
TestingUnit fake, widget fake, integration path, platform failure path
ReleaseStore 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.