Packages, Plugins, And Pub

A Dart package adds Dart code. A Flutter plugin adds Dart API plus target-specific implementation code. That difference matters for rebuilds, tests, and release risk.

Package Types

TypeExample useRisk
Dart-only packagePure validation, date handling, modelsAPI churn, transitive dependencies
Flutter UI packageWidgets, charts, design componentsVisual quality, accessibility, maintenance
PluginCamera, file picker, notifications, preferencesPlatform support, permissions, native build failures
Federated pluginShared interface with separate target implementationsMissing implementation for a target
FFI packageNative library bridgeABI, packaging, signing, platform support

Dependency Gate

Before adding a dependency, record:

CheckWhy
pub.dev score and maintenanceAvoid abandoned packages
supported platformsPrevent surprise web/desktop failures
latest release and changelogSpot stale APIs and breaking changes
native permissions and setupAvoid hidden manifest/Info.plist/store policy work
licenseKeep distribution safe
existing alternativesAvoid dependency sprawl

Add Workflow

flutter pub add package_name
flutter pub get
flutter analyze
flutter test

If the package has native code, fully restart the app and test each target platform that matters.

Gotcha: flutter pub add can be correct and still break iOS pods, Android Gradle, web builds, or desktop packaging. Dependency changes are platform changes until proven otherwise.