Skip to content
pubscout

stash_hive

5.2.0, released 3 years ago by ivoleitao.dev

Hive storage extension for the stash caching API

WASM-readyRepository archived
$ flutter pub add stash_hive
Source repository

What it does

Provides support to store vaults and caches in the Hive database using binary msgpack serialization.

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

Use it when

  • You are using the stash caching API and want to use Hive as the persistent storage backend.
  • You need high-performing binary serialization for cached items or vaults.

Skip it when

  • You are looking for a standalone Hive database implementation without the stash API wrapper.
  • You do not need caching features.

Strengths

  • Integrates seamlessly with the stash caching ecosystem.
  • Relies on efficient msgpack binary serialization.

Weaknesses

  • Requires managing dependencies for both stash and Hive.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
4

Add stash_hive to pubspec.yaml and import the library along with stash.

import 'package:stash/stash_api.dart';
import 'package:stash_hive/stash_hive.dart';

void main() async {
  final store = await newHiveDefaultVaultStore(path: Directory.systemTemp.path);
  final vault = await store.vault<Task>(name: 'vault', fromEncodable: (json) => Task.fromJson(json));
}

Alternatives

Packages that do the same job and could replace stash_hive.

  • hive_ce

    If you want a standalone, community edition of Hive without the stash wrapper.

Works with

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