Sub topic 3
Choosing a package: score, likes, publisher, platforms
Assume you know basic Dart syntax, can read YAML, and have a Flutter project created with flutter create. This chapter focuses on evaluating a package before adding it. A high score is useful evidence, but it is not a guarantee that the package fits your app.
Start with the package's purpose
Search [pub.dev](https://pub.dev) using the capability you need, such as HTTP requests, local storage, or date formatting. Read the package description and examples. Confirm that the package solves your actual problem instead of adding a large dependency for a small task.
Check whether the package is a Dart package or a Flutter plugin:
- A Dart package usually contains code that can run without native platform APIs.
- A Flutter plugin connects Dart code to Android, iOS, web, desktop, or another platform.
- A plugin may require extra setup in platform projects, permissions, configuration files, or minimum SDK versions.
A package that works on Android and iOS may not support web. Platform support must match every platform your application targets.
Read the package page critically
The package page provides several signals. Treat them as clues that must be checked together.
| Signal | What it tells you | What to check |
|---|---|---|
| Pub points or score | How well the package follows pub.dev quality checks | The individual checks and recent changes |
| Likes | How many pub.dev users have marked it as useful | Whether the package also has recent activity and documentation |
| Publisher | Who publishes the package and whether the publisher is verified | The organization, domain, and repository |
| Platforms | Platforms declared or supported by the package | Whether your target platforms and required features work |
The pub.dev score, sometimes shown as pub points, measures package quality according to automated checks. It can reflect documentation, analysis, testing, and platform conventions. A lower score does not automatically make a package unsafe or unusable. A high score does not prove that its API is stable or that it has no defects.
Likes show user interest, but they are not a download count, review score, or maintenance guarantee. A package can have many likes and still be unsuitable for your use case. Look at the release history, issue tracker, changelog, and open pull requests.
A verified publisher has demonstrated control of a related domain. This helps you identify official packages from organizations such as a company or project team. It does not replace reading the source code or checking the package's license.
Compare alternatives
Before choosing, compare two or three candidates. Look for:
- A clear API that matches your application.
- Recent releases and responses to important issues.
- Useful documentation and runnable examples.
- Tests and a repository that is easy to inspect.
- A license compatible with your project.
- Dependencies that do not create unnecessary version conflicts.
- Support for your Dart, Flutter, and target platform versions.
Prefer a smaller, maintained package over a popular package that does not support your required platform. If a package is abandoned, check whether the repository has an active successor. Do not select a replacement only because its name is similar.
Exercise
A package has many likes and a high score but does not support web, while a less popular package supports all your target platforms. Which signal should decide your choice?
Show answer
Platform compatibility should decide it. The popular package cannot meet the application's requirements without unsupported workarounds.