hive_flutter
1.1.0, released 5 years ago by hivedb.dev
Flutter extension for Hive providing easy initialization and adapters for common types.
Quiet but busy
What it does
Adds Flutter-specific helpers to Hive, such as Hive.initFlutter() and adapters for Color and TimeOfDay. It also exports the core Hive API for seamless use in Flutter apps.
AI-written summary of version 1.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a lightweight, NoSQL key‑value store in a Flutter app
- You want to store simple objects with minimal boilerplate
- You need platform‑agnostic storage across mobile, web, and desktop
Skip it when
- You require relational queries or complex joins
- You need encrypted storage out of the box
Strengths
- Fast pure‑Dart performance
- Works on all Flutter platforms
- Provides ready‑made adapters for common Flutter types
Weaknesses
- No built‑in encryption (needs extra package)
- Limited query capabilities compared to SQL databases
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
import 'package:hive_flutter/hive_flutter.dart';
Future<void> main() async {
await Hive.initFlutter();
var box = await Hive.openBox('myBox');
await box.put('key', 'value');
print(box.get('key'));
}Alternatives
Packages that do the same job and could replace hive_flutter.
- shared_preferences
For simple primitive key‑value storage without needing Hive's box system
97Compare - flutter_secure_storage
When you need encrypted key‑value storage
93Compare - sqflite
If you need relational SQL queries
96Compare
Works with
Packages commonly used together with hive_flutter: ones it builds on, ones built on it, and its own family.
- path_providerhive_flutter depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- hivehive_flutter depends on itFast, pure Dart key-value store with optional AES-256 encryption
- hive_generatorSame familyGenerates Hive TypeAdapter code for Dart classes automatically.
- amity_sdkBuilt on hive_flutterClient SDK for Amity Social Cloud to add social features like feeds, groups, and profiles.
- hive_uiBuilt on hive_flutterA UI explorer and management tool for Hive databases.
- dio_cache_plusBuilt on hive_flutterAdvanced Dio interceptor that adds flexible caching, expiry and deduplication.
- localize_and_translateBuilt on hive_flutterFlutter localization library to manage translations from local assets or remote networks.