5 Useful Flutter Libraries πŸ‘‘ πŸ’ͺ

Today I will show you 5 useful Flutter libraries that you can use in your applications: Isar for efficient data storage, Cached Network Image for faster image processing, Modal Bottom Sheet for UI interaction, Logger for convenient logging and Flutter dotenv for handling environmental variables.

5 Useful Flutter Libraries πŸ‘‘ πŸ’ͺ

In this short guide, you will learn how these 5 useful tools will improve your application development in Flutter.

1. Isar

isar | Dart Package
Extremely fast, easy to use, and fully async NoSQL database for Flutter.

Isar

Isar, a NoSQL database for Flutter, provides an efficient and flexible way to manage local data storage. It is optimized for performance and allows for easy integration with Flutter applications, providing optimized query capabilities and easy-to-use data models for local storage needs.

To learn more about ISAR, check out my Building a Flutter application with a local ISAR database blog post:

Building a Flutter application with a local ISAR database
ISAR is a high-performance, fully async NoSQL, and schema first database for Flutter. Isar was started as a replacement for Hive. By incorporating ISAR into your Flutter project, you’ll be able to manage and manipulate data with queries, multi-entry indexes and JSON support.

Building a Flutter application with a local ISAR database

2. Cached Network Image

cached_network_image | Flutter Package
Flutter library to load and cache network images. Can also be used with placeholder and error widgets.

Cached network image

For most apps, proper handling of images is important. Cached Network Image optimizes image loading and caching, vastly improving the user experience. It handles the task of taking and storing network images with ease, reducing load times and bandwidth consumption.

With that library you can control the error condition, display placeholder or loading indicator. An example implementation looks like this:

CachedNetworkImage(
        imageUrl: <IMAGE_URL>,
        placeholder: (BuildContext context, String url) => CircularProgressIndicator(),
        errorWidget: (BuildContext context, String url, dynamic error) => Icon(Icons.error),
     ),

Sample CachedNetworkImage code

3. Modal Bottom Sheet

modal_bottom_sheet | Flutter Package
Create awesome and powerful modal bottom sheets. Material, Cupertino iOS 13 or create your own style

Modal Bottom Sheet

Modal Bottom Sheet can be very useful. This library makes it easy to create awesome and powerful modal bottom sheets in your app, providing a simple, modern user experience. It’s a great way to display new content or actions without cluttering up the main UI.

Here's a simple implementation of Modal Bottom Sheet:

showMaterialModalBottomSheet(
  context: context,
  builder: (BuildContext context) => Container(),
);

Sample Modal Bottom Sheet code

4. Logger

logger | Dart Package
Small, easy to use and extensible logger which prints beautiful logs.

Logger

The Logger package simplifies the logging process in your Flutter application. It provides multiple log levels, custom formatting, and the ability to move logs to different locations, which speeds up debugging and monitoring. Because of its features, it is a valuable tool for understanding behavior and identifying issues.

The simple implementation can look like this:

Logger logger = Logger();

logger.t("Trace log");

logger.d("Debug log");

logger.i("Info log");

logger.w("Warning log");

logger.e("Error log", error: 'Test Error');

Sample implementation of Logger

4. Easy localization

easy_localization | Flutter Package
Easy and Fast internationalizing and localization your Flutter Apps, this package simplify the internationalizing process .

Easy localization

Easy localization simplifies the process of managing app translations and internationalization in Flutter. It provides a simple yet powerful solution to implement multiple languages ​​and locale specific formatting in your application, enabling smooth localization with minimal effort.

5. Flutter dotenv

flutter_dotenv | Flutter Package
Easily configure any flutter application with global variables using a `.env` file.

Flutter dontenv

The flutter_dotenv library provides a simple way of the management of environment variables in Flutter projects. This is particularly useful for storing configuration details, sensitive information like API keys, database credentials, or any parameters that might change between environments (such as development, testing, and production).

The configuration is simple:

Future main() async {
  await dotenv.load(fileName: ".env");
  //...runapp
}

Flutter dotenv sample configuration

And the usage:

dotenv.env['ENV_NAME']

Flutter dotenv sample usage


Thanks for reading β™₯️β™₯️