storage_inspector

Creator: coderz1093

Last updated:

Add to Cart

Description:

storage inspector

Flutter local storage inspector #



This library allows you to inspect your apps local storage at runtime. During development, use the "Local storage inspector" plugin in your IntelliJ based IDE to inspect
and modify the local files, databases, models, ... of your app
Features #

Plugin for shared preferences
Plugin for secure storage
Plugin for local files (based on dart:io)
Plugin for drift databases

Getting started #
The local storage inspector can handle any number of server instances you pass to it. To start, create the storage inspector driver:

final driver = StorageServerDriver(
bundleId: 'com.example.test', //Used for identification
port: 0, //Default 0, use 0 to automatically use a free port
icon: '...' //Optional icon to visually identify the server. Base64 png or plain svg string
);
copied to clipboard
Adding servers #
Once the driver is created, you can register the individual servers you wish to expose.
These servers come as plugin packages to this package.
Eg:

files: file_local_storage_inspector
preferences: preferences_local_storage_inspector
secure storage: secure_storage_local_storage_inspector

final preferencesServer =
PreferencesKeyValueServer(preferences, 'Base Preferences');

final secureStorageServer =
SecureStorageKeyValueServer(secureStorage, 'Super secret storage');

final fileServer = DefaultFileServer('<cache dir path>', "Cache files");

driver.addKeyValueServer(preferencesServer);
driver.addKeyValueServer(secureStorageServer);
driver.addFileServer(fileServer);
copied to clipboard
Start inspector #
Once all the servers have been configured, you can start the driver to start the inspector and announcement server for the plugin:
await driver.start();
copied to clipboard
Shutdown #
If so required, you can shut down the server:
await driver.stop();
copied to clipboard
Advanced usage #
Pausing #
If you want to instrument some local storage before the application fully starts, you can start the driver with the paused: true argument. This will ensure that
await driver.start(paused: true) only returns when the inspector plugin/API sends the resume signal. The server does handle requests before this signal, allowing you to change
initial values on the fly.
Writing custom integrations #
To write your own integration into the system (eg: modify pure in-memory key value store, ...), simply implement the correct server interface that most closely matches your
requirements.
abstract class KeyValueServer{} //Most generic key-value server. Supports arbitrary key and value types

abstract class SimpleKeyValueServer{} //Simpler variant of the key value server, supports only string keys and values

abstract class FileServer{} //Server that server hierarchical storage of binary data
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.