xray_shared_preferences_inspector

Key-value inspector for SharedPreferences.

Exposes SharedPreferences entries in the inspector UI, with support for reading, writing, and deleting values at runtime.

Installation

dependencies:
  xray_inspector: ^0.0.1
  xray_shared_preferences_inspector: ^0.0.1
  shared_preferences: ^2.0.0

Usage

import 'package:shared_preferences/shared_preferences.dart';
import 'package:xray_shared_preferences_inspector/xray_shared_preferences_inspector.dart';

final prefs = await SharedPreferences.getInstance();
final inspector = XRaySharedPreferencesInspector(prefs: prefs);

Then pass it to XRayInspectorServerConfig. See Quick Start for full server setup.

Capabilities

  • Read — lists all stored key-value pairs
  • Write — updates a value by key (stored as string)
  • Delete — removes a key
  • Refresh — re-reads all values on demand

Notes

  • All values are read and written as strings. Typed values (int, bool, etc.) stored by SharedPreferences will appear as their string representation.
  • The inspector title defaults to "SharedPreferences" and is shown in the remote UI.