Skip to content
pubscout

hive_ce

2.24.0, released today by iodesignteam.com

A lightweight and fast NoSQL key-value database written in pure Dart.

WASM-readyRock solid
$ flutter pub add hive_ce
Source repository

What it does

Hive CE provides a cross-platform NoSQL database solution built for Dart and Flutter. It allows developers to store data using simple key-value boxes with support for encryption, isolates, and type adapters.

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

Use it when

  • You need a fast, lightweight NoSQL database for key-value storage.
  • You need cross-platform support including mobile, desktop, and web.
  • You want built-in encryption and simple type adapter generation.

Skip it when

  • You require complex relational queries, foreign keys, or a full SQL engine.
  • You are using a Dart SDK older than version 3.

Strengths

  • Blazing fast performance with no native dependencies.
  • Built-in strong encryption support.
  • Cross-platform compatibility including mobile, desktop, and browser.

Weaknesses

  • Writes can be lost if the process is killed before the future completes and before a manual flush.
  • Lacks advanced relational database features like SQL joins.

Setup

Kind
Pure Dart
Effort
Low
Code generation
Yes (build_runner)
Direct dependencies
5

Requires Dart 3. Add the package to dependencies and initialize boxes as needed.

import 'package:hive_ce/hive_ce.dart';

void example() {
  final box = Hive.box('myBox');
  box.put('name', 'David');
  final name = box.get('name');
  print('Name: $name');
}

Alternatives

Packages that do the same job and could replace hive_ce.

  • shared_preferences

    Best for extremely simple key-value settings data on mobile platforms.

  • sqflite

    Best when you specifically need a relational SQLite database with SQL queries.

  • drift

    Best for type-safe reactive SQL databases with complex relational schemas.

Works with

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