Skip to content

Repository files navigation

Mole

Local storage inspector for Flutter. Pass the storage instances your app already uses, get a floating bubble in debug, and inspect, edit, or delete stored values.

pub package license

Install

dependencies:
  mole: ^0.1.1
flutter pub get

Setup

1. Add config

Create lib/mole_config.dart:

import 'package:mole/mole.dart';

const moleConfig = MoleConfig(
  enabled: true,          // false = hide bubble, Mole does nothing
  enableInRelease: false, // keep false for production
);

2. Install in main.dart

import 'package:flutter/material.dart';
import 'package:mole/mole.dart';
import 'package:shared_preferences/shared_preferences.dart';

import 'mole_config.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  final prefs = await SharedPreferences.getInstance();

  Mole.install(
    config: moleConfig,
    sources: [
      MoleSharedPrefsSource(prefs),
      // Add only what your app uses:
      // MoleHiveSource(box),
      // MoleSecureStorageSource(secureStorage),
      // MoleCacheSource(),
    ],
    onStorageChanged: () {
      // Optional: reload your UI when Mole edits storage.
    },
  );

  runApp(const MyApp());
}

3. Attach to MaterialApp

MaterialApp(
  navigatorKey: Mole.navigatorKey,
  builder: Mole.builder,
  home: const HomePage(),
)

Tap the floating bubble to open the inspector.

Config

Option Default Description
enabled true Master switch. false turns Mole off completely.
enableInRelease false Allow Mole in release builds. Shows a console warning and red MOLE ACTIVE tag.
Build Mole runs when
Debug / profile enabled: true
Release enabled: true and enableInRelease: true

Sources

Register only the storage your app already created. Only registered sources appear in Mole.

Adapter Backend
MoleSharedPrefsSource(prefs) SharedPreferences
MoleHiveSource(box) Hive box
MoleSecureStorageSource(storage) flutter_secure_storage (masked until reveal)
MoleCacheSource() App temp/cache files

Edits in Mole write to the same instances you pass in. Use onStorageChanged if your UI should refresh after an edit.

What you get

  • Floating draggable bubble (hidden while the inspector is open)
  • Dashboard grouped by source with live entry counts
  • View, edit, delete, and clear per key or per source
  • Search by key or value
  • Off by default in release unless you opt in

Example app

git clone https://github.com/darkmintis/mole.git
cd mole/example
flutter run

Requirements

  • Flutter >=3.44.0
  • Dart ^3.12.1

License

MIT © Darkmintis

About

Local storage inspector for Flutter to inspect, edit, or delete stored values

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages