Skip to content
pubscout

hive

2.2.3, released 4 years ago by isar.dev

Fast, pure Dart key-value store with optional AES-256 encryption

WASM-readyQuiet but busy
$ flutter pub add hive
Source repository

What it does

Hive is a lightweight NoSQL database that stores data as key-value pairs. It supports cross‑platform use (mobile, desktop, web) and can encrypt data on disk.

AI-written summary of version 2.2.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Need fast local storage for small to medium data sets
  • Require encryption without native dependencies
  • Want a simple API that works in Flutter and pure Dart
  • Need to store custom Dart objects with adapters

Skip it when

  • Working with large relational data sets
  • Need complex queries or joins
  • Require server‑side sync or offline sync features

Strengths

  • High read/write performance
  • No native dependencies, pure Dart
  • Built‑in AES‑256 encryption
  • Supports custom object adapters

Weaknesses

  • No query language or relational support
  • Requires manual adapter generation for custom types
  • Limited to key‑value access patterns

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2

Add hive and hive_flutter, call Hive.initFlutter(), register adapters with Hive.registerAdapter(), open boxes with Hive.openBox()

import 'package:hive/hive.dart';

var box = Hive.box('settings');
box.put('darkMode', true);
var dark = box.get('darkMode');

Alternatives

Packages that do the same job and could replace hive.

Works with

Packages commonly used together with hive: ones it builds on, ones built on it, and its own family.