The 10 Best and Most Liked Flutter Packages

Increase your productivity and development speed today

Erik van Baaren
Aug 26 · 6 min read
Image for post
Image for post

Flutter is “Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.”

Flutter is based on the Dart programming language. It has a large and lively community on Dart.dev, offering both officially supported and third-party packages to make Flutter development even more productive.

This article lists the most promising and most popular packages to give you an idea of Flutter’s maturity as a platform.

If you haven’t done so already, read my introductory article first. It will get you set up and running with a basic Flutter project in no time. This allows you to try out the packages you like most quickly!


1. HTTP

URL: https://pub.dev/packages/http
Works on: iOS, Android, Web

Everything is web-based these days, so a robust HTTP library is a must-have. This Dart package contains a set of high-level functions and classes that make it easy to consume HTTP resources. It’s well developed and actively maintained by the Dart team. It has been around since 2012, so it should be rock-solid!

The library offers top-level functions that make it easy to work with HTTP:

import 'package:http/http.dart' as http;# Posting data
var url = 'https://example.com/whatsit/create';
var data = {'name': 'Jack', 'age': 38};
var response = await http.post(url, body: data);print('Response status: ${response.statusCode}');
print('Response body: ${response.body}');
# A simple GET request
print(await http.read('https://example.com/foobar.txt'));

2. flutter_slidable

URL: https://pub.dev/packages/flutter_slidable
Works on: iOS, Android, Web

Image for post
Image for post

The flutter_slidable plugin adds a feature-rich slider widget to your project. Sliders like this are often seen in scrollable lists. The Gmail app is a notable example, in which sliding list items offer a significant productivity enhancement.

This plugin is packed with features and ready for use, but also highly customizable if needed. Some of the listed features are:

  • Accepts primary (left/top) and secondary (right/bottom) widget lists as slide actions
  • Can be dismissed
  • Four built-in action panes
  • Two built-in slide action widgets
  • Built-in dismiss animation
  • Easily create custom layouts and animations
  • Closes when a slide action has been tapped (overridable)
  • Closes when the nearest Scrollable starts to scroll (overridable)
  • Option to disable the slide effect easily

3. Shared Preferences

URL: https://pub.dev/packages/shared_preferences
Works on: iOS, Android, Web, Linux

This package wraps platform-specific persistent storage libraries. It’s indented for simple data, like user preferences, and it uses:

  • NSUserDefaults on iOS and macOS
  • SharedPreferences on Android
  • LocalStorage on websites
  • A JSON file on the local filesystem for Linux

Data may be persisted to disk asynchronously, and there is no guarantee that writes will be persisted to disk after returning, so this plugin is not meant for storing critical data. For that look into sqflite (see below).


4. sqflite

URL: https://pub.dev/packages/sqflite
Works on: iOS, Android, MacOS

This is the SQLite plugin for Flutter. It supports iOS, Android, and MacOS. The web is not supported since there is no SQL-based persistence system in web browsers. Some of its features are:

  • Support for transactions and batches
  • Automatic version management
  • Helpers for insert/query/update/delete queries
  • Operations are executed in a background thread on iOS and Android to prevent the UI from locking up

If you need more than basic (shared_preferences) data storage, look no further.


5. url_launcher

URL: https://pub.dev/packages/url_launcher
Works on: iOS, Android, Web

This plugin helps you launch a URL. URLs can be of the following types:

Basic usage is very straightforward:

const url = 'https://flutter.dev';if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}

6. video_player

URL: https://pub.dev/packages/video_player
Works on: iOS, Android, Web

Image for post
Image for post

Many formats are supported, but it all depends on the platform you’re running. For example, the backing libraries differ for iOS and Android. Also, on the web, the supported formats depend on the browser you’re using.

Note that even though it’s called video_player, this plugin can also play audio. Since the plugin is pretty mature and has reached API stability, it’s not a bad idea to use this for audio over some of the alternatives.

This plugin can play video from a local file (assets) and a remote server (e.g., a website). For some example code, head over to this page.


7. crypto

Works on: All platforms

Comping from the Dart team itself, this is a set of cryptographic hashing functions implemented in pure Dart. This means you don’t need external libraries to make this work.

The following hashing algorithms are supported:

  • SHA-1
  • SHA-224
  • SHA-256
  • SHA-384
  • SHA-512
  • MD5
  • HMAC (i.e. HMAC-MD5, HMAC-SHA1, HMAC-SHA256)

Since this is not a GUI tool but simply a crypto library, it works on all supported platforms.


8. carousel_slider

URL: https://pub.dev/packages/carousel_slider
Works on: iOS, Android, Web

Image for post
Image for post

A carousel slider is part of many apps and websites. The carousel_slider plugin offers an excellent and customizable carousel that works on multiple platforms.

Because the carousel accepts widgets as content, you can slide anything that can be a widget.

For live examples, you can visit this website, which uses Flutter web to demo the plugin.

Here’s an example of how to create a carousel in your app:

CarouselSlider(
options: CarouselOptions(height: 400.0),
items: [1,2,3,4,5].map((i) {
return Builder(
builder: (BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 5.0),
decoration: BoxDecoration(
color: Colors.amber
),
child: Text('text $i', style: TextStyle(fontSize: 16.0),)
);
},
);
}).toList(),
)

The carousel has several configurable options, like:

  • the height and aspect ratio
  • enabling infinite scrolling
  • reversing the carousel
  • enabling autoplay with a configurable interval, animation duration
  • defining the scroll direction (vertical, horizontal)

9. path

URL: https://pub.dev/packages/path
Works on: iOS, Android, Web

Paths are both easy and incredibly complex because they differ from platform to platform. To make sure you don’t introduce bugs or security vulnerabilities in your code, always use the path library when dealing with paths. To join a directory and a file with the file separator for the current OS, use:

import 'package:path/path.dart' as p;
p.join('directory', 'file.txt');

10. location

URL: https://pub.dev/packages/location
Works on: iOS, Android, Web, MacOS

One of the great things about phones is their mobility combined with the ability to accurately track location. This has already given us many useful applications. The location plugin for Flutter makes it easy to get access to the current location. It provides callbacks when the location has changed. It also offers API endpoints to properly request access to a user’s location.

Image for post
Image for post

Better Programming

Advice for programmers.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight.

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox.

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month.

Get the Medium app