dartpub.dev DartNative · beta
plugins / dartnative_hive
dh

dartnative_hive

v1.0.0 dartpub Free

Fast pure-Dart key-value database

Hive for DartNative — the fast, pure-Dart `hive_ce` key–value database with a one-line native init (`Hive.initDartNative`). The full Hive API: boxes, adapters, lazy boxes — the same on iOS and Android.

by DartNative/dartnative_hive · DartNative ≥ 3.0 · updated 3 weeks ago
Install
Free
pubspec.yaml
dependencies:
  dartnative_hive: ^1.0.0
Weekly installs
40
Active apps
4
Rating
0.0 · 0
Open issues
0

dartnative_hive

Hive for DartNative — a fast, pure-Dart key–value database with a one-line native init. Same API on iOS and Android (and anywhere Dart runs).

Why you'll like it

  • Pure-Dart speed — Hive (community edition), no platform channels.
  • One-line initHive.initDartNative(docsDir) and you're set.
  • The full Hive API — boxes, type adapters, lazy boxes — re-exported as-is.

Highlights

  • Hive.initDartNative(docsDirPath, {subDir}) — point Hive at a storage directory.
  • Hive.openBox(name) + box.put / box.get / box.delete — the usual Hive API.

Install

dependencies:
  dartnative_hive: ^1.0.0   # from dartpub.dev
dn pub get

Quick look

import 'package:dartnative_hive/dartnative_hive.dart';

// Point Hive at your app's documents directory, once at startup:
Hive.initDartNative(documentsPath);

final box = await Hive.openBox('settings');
await box.put('theme', 'dark');
final theme = box.get('theme'); // 'dark'

Platform setup

iOS

No native setup required.

Android

No native setup required.

Example

The example/ app opens a box and round-trips a value — borrow from it freely.

Run it:

cd example
dn pub get
dn run -d <device-id>

The example is an official demo — free to run, no license setup. Always use dn (not the underlying SDK CLI) for run/build/pub commands.

Credits & license

A thin facade over hive_ce, the community edition of Hive.

Commercial plugin distributed via dartpub.dev — file issues on the plugin's page.