Hive Inspector

Hive Inspector is a lightweight Flutter DevTool that helps developers inspect, search, and debug Hive / hive_ce boxes at runtime. It is designed for debug and development builds to quickly view local database data without creating custom UI.

โœจ Features

  • ๐Ÿ“‚ View all opened Hive boxes
  • ๐Ÿ” Search keys and values inside a box
  • ๐Ÿ—‘ Delete individual entries
  • ๐Ÿ“Š View box metadata (name & item count)
  • โšก Works with hive_ce
  • ๐Ÿงช Safe for debug builds
  • ๐Ÿงฉ Simple plug-and-play widget

Screenshot

1768773390522

๐Ÿ“ฆ Installation

Add this to your pubspec.yaml:

dependencies:
hive_inspector: ^0.0.1

Then Run

flutter pub get

โš™๏ธ Requirements

  • Flutter 3.x+
  • hive_ce
  • hive_ce_flutter (for Flutter apps)

๐Ÿš€ Usage (Basic)

1๏ธโƒฃ Initialize Hive

import 'package:hive_ce_flutter/hive_ce_flutter.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Hive.initFlutter();
}

2๏ธโƒฃ Open boxes using HiveService

โ— Important: Inspector can only see boxes opened via HiveService.openBox()

import 'package:hive_inspector/src/services/hive_service.dart';
final demoBox = await HiveService.openBox('demoBox');
demoBox.put('name', 'Bookz');
demoBox.put('count', 5);

3๏ธโƒฃ Launch Hive Inspector

import 'package:hive_inspector/hive_inspector.dart'; runApp(const HiveInspector());

๐Ÿงช Full Example App

This is exactly how the example app inside the package works.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:hive_ce_flutter/hive_ce_flutter.dart';
import 'package:hive_inspector/hive_inspector.dart';
import 'package:hive_inspector/src/services/hive_service.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Hive.initFlutter();
final demoBox = await HiveService.openBox('demoBox');
await HiveService.openBox('userBox');
demoBox.put('name', 'Bookz');
demoBox.put('count', 5);
demoBox.put('data', {'a': 1, 'b': true});
runApp(const HiveInspector());
}

Run example:

flutter run

Do not ship inspector in production builds.

import 'package:flutter/foundation.dart';
if (kDebugMode) {
runApp(const HiveInspector());
}

โš ๏ธ Important Notes

  • Hive does not provide a public API to list all boxes
  • This package tracks boxes opened via HiveService
  • Avoid using in release builds
  • Do not store secrets in Hive during debugging

โŒ Limitations

  • Closed boxes are not auto-discovered
  • Editing values is not supported (yet)
  • Read-only debugging tool (safe by design)

๐Ÿงญ Roadmap

  • โœ๏ธ Edit values
  • ๐Ÿ“ค Export box to JSON
  • โž• Open box by name from UI
  • ๐Ÿ”’ Password-protected inspector
  • ๐Ÿงฉ Flutter DevTools extension

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome! Feel free to open a PR or issue.

๐Ÿ“„ License

MIT License ยฉ 2026 Free to use in personal and commercial projects.

โญ Support

If you find this package useful, please give it a โญ on GitHub and share feedback to help improve it.

Libraries

hive_inspector