shared_preferences_explorer
A Flutter package for on-screen viewing of shared_preferences.
Supports SharedPreferences, SharedPreferencesAsync, and SharedPreferencesWithCache.
![]() |
![]() |
|---|
APIs
| 1. Floating button widget | 2. Screen widget | |
|---|---|---|
| SharedPreferences | SharedPreferencesExplorer | SharedPreferencesExplorerScreen |
| SharedPreferencesAsync | SharedPreferencesAsyncExplorer | SharedPreferencesExplorerAsyncScreen |
| SharedPreferencesWithCache | SharedPreferencesAsyncExplorer (cache is ignored) | SharedPreferencesExplorerAsyncScreen (cache is ignored) |
Usage
1. Floating button widget
Wrap your app's root widget with SharedPreferencesExplorer or SharedPreferencesAsyncExplorer, and tap the floating button to open.
You can access it from anywhere in your app.
void main() {
runApp(
SharedPreferencesExplorer(
// /*Optional*/ instance:
// /*Optional*/ initialFloatingButtonAlignment:
child: YourApp(),
),
);
}
- The floating button is draggable, and the initial position can be set using
initialFloatingButtonAlignmentparameter.
2. Screen widget
Use SharedPreferencesExplorerScreen or SharedPreferencesExplorerAsyncScreen in places like your app's debug menu.
Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (context) =>
const SharedPreferencesExplorerScreen(
// /*Optional*/ instance:
),
),
);
Note
-
Any cache settings in
SharedPreferencesWithCachewill be ignored and the latest value is always retrieved. -
You can optionally provide an instance to the
instanceparameter. If not provided,SharedPreferences.getInstance()orSharedPreferencesAsync()will be used.

