Choosing the right packages for your Flutter project is a crucial part of the development process, failing to pick the right packages can lead to a lot of headaches down the road.

Most frameworks and languages have a package manager, Python has pip, JavaScript has npm, and Dart has pub.

While most of what I am going to talk about is applicable to all languages, I am going to focus on Dart and Flutter.

Understanding the metrics

Flutter and Dart come with a powerful package manager called pub.dev, with it come three metrics and one good indicator that can help you decide if a package is right for you and in good health.

Popularity

Popularity measures the number of apps that depend on a package over the past 60 days, this score is based on actual download counts, it provides a good indication into what other developers are using.

Likes

Likes offer a measure of how many developers have liked a package, to like a package you need to be logged in to pub.dev, this is another good indication but not as reliable as the popularity score.

Pub Points

Pub points measure the quality of a package, it is based on a set of criteria that a package must meet, the criterias can be found here and are evolving over time.

Bonus metric : Published Date

The published date is the date the package was last published (last updated), this is a good indication of how active the package is, avoid the ones that have not been updated for more than a year.

The GitHub Repository check

While the Dart metrics are a good indication of a package quality, using the packages’s GitHub repository can give you a better insight into the package’s health, let’s take a look at the things you should check.

Latest Commit

Check the repository’s commit history to ensure recent activity. A regularly updated repository is more likely to be actively maintained and supported, big gaps are fine as long as the repository is active and updated regularly.

Issues and Pull Requests

Check the repository’s issues and pull requests, are they being responded to? Are they being closed? Are they being ignored? A package with a big number of open issues and pull requests does not necessarily mean it is a bad package as long as they are being responded to and closed.

Documentation and Examples

Verify the presence of comprehensive documentation. Well-documented projects are easier to understand and integrate. It is also a good indication that the developers understand what they are building.

Bonus Tip - Flutter Favorite program

The aim of the Flutter Favorite program is to identify packages and plugins that you should first consider when building your app.

Flutter Favorite packages have passed high quality standards using the following metrics:

  • Overall package score
  • Permissive license, including (but not limited to) Apache, Artistic, BSD, CC BY, MIT, MS-PL and W3C
  • GitHub version tag matches the current version from pub.dev, so you can see exactly what source is in the - package
  • Feature completeness—and not marked as incomplete (for example, with labels like “beta” or “under - construction”)
  • Verified publisher
  • General usability when it comes to the overview, docs, sample/example code, and API quality
  • Good runtime behavior in terms of CPU and memory usage
  • High quality dependencies

Finally, Flutter Favorite packages need to be reviewed and approved by the Flutter Ecosystem Committee which is made up of members of the Flutter team and the community.