Top Flutter & Dart packages in 2022

A curated list of packages we find useful for Flutter and Dart projects

Open Source
April 26, 2022
and 
April 26, 2022
updated on
June 2, 2022
By 
Guest Contributor

Open source packages play a huge role in software development, especially when it comes to building Flutter apps. Pub.dev has a growing ecosystem of over 24,000 packages to help you add functionality to your Flutter application and leverage solutions created by the community.

This blog contains a curated list of Flutter and Dart packages that are essential to our development on client projects at VGV, as well as those we use in our personal projects.

Table of Contents:

✨ denotes a package added in this update

Top open source packages

alchemist

Alchemist is a package designed to enhance golden testing. This package, developed by Betterment x VGV, contains a declarative API and addresses some pain points of golden test support within the Flutter framework — such as fixing continuous integration test flakes and simplifying injecting a custom theme. Here’s a blog about how to use alchemist with your golden tests.

collection ✨

This package from the Dart team is a must-have if you’re using collections in your codebase. Collection contains functions to help with equality within elements of a collection, as well as between collections, list operations, priority queue implementation, and wrappers.

coverage

We believe in the importance of 100% code coverage, which ensures that each line of code is tested and behaves as expected. coverage is a great Dart package that allows users to collect, manipulate, and format coverage data.

With coverage, you can collect coverage from the Dart VM and format that coverage data into LCOV or pretty-printed format.

cloud_firestore

cloud_firestore is a Flutter plugin that gives users access to the Firebase Cloud Firestore database, a NoSQL cloud database for mobile, web, and server development. This allows your application to read, write, and react to real-time changes in the Firestore database.

Be sure to check out the documentation on how you can start using the cloud_firestore package in your own projects.

equatable ✨

Equatable is a small but helpful package for comparing Dart objects. This package overloads the == operator and allows you to compare objects without code generation.

firebase_auth

We can’t recommend cloud_firestore without also mentioning firebase_auth. firebase_auth allows users to access the Firebase Authentication API, enabling authentication through passwords, telephone numbers, and service providers like Twitter, Facebook, and Google.

Visit the Authentication Usage documentation to learn more about integrating firebase_auth into your projects.

flame ✨

Flame is a must-have for game development in Flutter. It leverages the Flutter framework to provide everything you need to build performant games. With flame, your Flutter game is only a widget away. Get started with their detailed documentation.

flame_bloc ✨

If you’re using flame to build a game, you can also leverage the bloc library for managing game state. The flame_bloc package makes it easy to access and listen to blocs and cubits. For a tutorial on using flame_bloc, check out our blog.

flutter_gen

In Flutter, using a string to specify a path to an asset isn’t safe. For example, an assertion error can be thrown if you accidentally mistype the asset path. flutter_gen is a code generator for assets, fonts, colors, and more, effectively getting rid of string-based APIs.

With flutter_gen, you can use code generation to generate compile-safe asset references instead of using strings for asset paths.


# pubspec.yaml 
flutter:
 assets:
   - assets/images/profile.jpg


Widget build(BuildContext context) {
  return Assets.images.profile.image();
}

For more information on how to install and use flutter_gen, be sure to check out their documentation.‍

googleapis

The googleapis Dart package provides auto-generated Dart libraries to access the APIs found in the Google API Client Libraries. Installing this one package gives you access to dozens of available Google APIs, including the Admin SDK, Calendar, Dialogflow, Drive, and more.

Be sure to read up on how you can use Google APIs with Flutter.

hive

hive is a Dart package that provides developers with an easily accessible NoSQL Database. It is simple, powerful, and intuitive — we appreciate how you can easily store primitives and Dart objects inside hive’s map-like database. Here is an example:


final box = Hive.box(‘myBox’);
box.put(‘company’, ‘VGV’);
final company = box.get(‘company’);
print(‘Company: $company);

in_app_review

User feedback can be an integral part of the app development process, so we’re including the in_app_review Flutter package on our list. Developers can prompt users for an app store review within the app.


InAppReview.instance.openStoreListing(appStoreId: '...', microsoftStoreId: '...');

membrane ✨

Membrane is a helpful package for generating code from Rust to Dart. With an emphasis on performance and strict typing, it’s a reliable way to port code over into Dart.

modal_bottom_sheet ✨

Maintained by our teammate Jaime Blasco, modal_bottom_sheet makes it simple to implement a modal bottom sheet that is both performant and looks at home on any native mobile device. It includes support for scrolling, dragging, and other customizations.

pana

pana is a handy Dart package that lets you analyze the health and quality of other packages that you’re using in your application. It evaluates the packages across multiple categories:

  • Follows Dart conventions
  • Provides documentation
  • Supports multiple platforms
  • Passes static analysis
  • Supports up-to-date dependencies

To get started, simply install pana from pub.dev.


dart pub global activate pana

Then, specify either a package or a local directory to analyze.


pana --hosted {published package name} [{version}]
pana {local directory}


recase ✨

Recase is a small but mighty package to easily change the case of input text into snake_case, dot.case, path/case, PascalCase, and more.

purchases_flutter ✨

Purchases_flutter is a helpful package by RevenueCat for implementing in-app purchases with StoreKit and Google Play Billing in your Flutter apps. Get purchase tracking, in-app subscriptions, and analytics all in one place.

url_launcher

True to its name, the url_launcher Flutter package is a convenient way to launch external URLs from your application with many URL schemes supported. Use this package when you want to rely on the underlying platform to handle opening the URL for you.


const url = ‘https://verygood.ventures/blog’;
if (await canLaunch(url)) {
  await launch(url);
}

Top VGV packages

flow_builder

flow_builder is a Flutter package that simplifies the use of navigation stacks following the new Navigator 2.0 API. Simply create a flow state and flow_builder will be able to generate a new navigation stack based on changes to the flow state. For more information be sure to check out our article on incorporating flow_builder into your project.

flutter_bloc

We prefer to use the flutter_bloc package for state management. A Flutter Favorite, flutter_bloc is a simple, predictable, and easily testable solution to state management, which fits in perfectly with the development practices here at VGV. We even wrote an article that takes an in depth look at why we use flutter_bloc.

mocktail

Automated testing is a key component of our development workflow to ensure that our applications perform as expected. One go-to package for writing automated tests is mocktail. mocktail, inspired by mockito, allows users to stub and verify method behavior by creating mocks without relying on code generation in null safe codebases.


// A Real Dog Class
class Dog{
  String bark() => 'woof!';
}

// A Mock Dog Class
class MockDog extends Mock implements Dog {}

void main() {
  final dog = MockDog();
  final sound = ‘bark’;
  // Stub the `bark` method.
  when(() => dog.bark()).thenReturn(sound);
  // Interact with the mock dog instance.
  expect(dog.bark(), equals(sound));
  // Verify the interaction occurred.
  verify(() => dog.bark()).called(1);
}

mocktail also works in tandem with our new mockingjay package, which allows users to mock, test, and verify navigation behavior. Stay tuned for more about this new package!

mason

The mason Dart package is a key tool in increasing efficiency through automation. With mason, you can create and customize reusable code templates in the form of bricks. Here is an article with tutorials on how to use mason.

formz

At VGV, we use the formz package, which heavily simplifies form representation and validation in an easily understandable format. Simply extend FormzInput and provide the input and error type.


// Define input validation errors
enum NameInputError { empty }

class NameInput extends FormzInput {
  // Call super.pure to represent an unmodified form input.
  const NameInput.pure() : super.pure('');

  // Call super.dirty to represent a modified form input.
  const NameInput.dirty({String value = ''}) : super.dirty(value);

  // Override validator to handle validating a given input value.
  @override
  NameInputError validator(String value) {
    return value?.isNotEmpty == true ? null : NameInputError.empty;
  }
}

Interacting with the NameInput class defined above is simple and intuitive.


final name = NameInput.pure();
print(name.value); // ''
print(name.valid); // false
print(name.status); // FormzInputStatus.pure
print(name.error); // NameInputError.empty

final joe = NameInput.dirty(value: 'joe');
print(joe.value); // 'joe'
print(joe.valid); // true
print(joe.status); // FormzInputStatus.valid
print(joe.error); // null
print(joe.toString()); // NameInput('joe', true);

very_good_analysis

Linting tools are great for ensuring high-quality, consistent code by checking for stylistic errors. We created the very_good_analysis package to combine the rules from the (now deprecated) pedantic package, as well as some additional options that we use at VGV. Read more about very_good_analysis.

very_good_cli ✨

very_good_cli is a command line tool that can be used to generate a number of opinionated templates, including: Very Good Core, our opinionated Flutter starter application, Flutter package, Dart package, and federated plugin. We created Very Good CLI to make it easier to start new projects — whether a multi-platform application or Flutter package — and ensure our best practices are implemented out of the box.

very_good_workflows ✨

GitHub workflows can help you standardize the steps that are run as part of your CI process — we typically use them on each PR before merging. We created very_good_workflows to open source the workflows we use to check for opinionated best practices at VGV. Learn more about customizing workflows in this blog.


While this list isn’t exhaustive, we wanted to showcase the top packages that we consistently use in both our VGV work and personal Flutter projects. Check out pub.dev for the full catalog of Flutter and Dart packages.

Read our other blogs on open source topics here.
Additional Contributors

NOTE: This article has been updated in April 2022 with additional packages. Changes have been made to enhance readability, including adding a table of contents and organizing the lists alphabetically.

More Stories