shared_preferences_explorer 0.3.0

SDKflutter
Platformandroidioswindowslinuxmacosweb

A Flutter package for on-screen viewing of shared_preferences. Supports SharedPreferences, SharedPreferencesAsync, and SharedPreferencesWithCache.

shared_preferences_explorer

A Flutter package for on-screen viewing of shared_preferences.
Supports SharedPreferences, SharedPreferencesAsync, and SharedPreferencesWithCache.

Usage

1. Floating button widget2. Screen widget
SharedPreferencesSharedPreferencesExplorerSharedPreferencesExplorerScreen
SharedPreferencesAsyncSharedPreferencesAsyncExplorerSharedPreferencesExplorerAsyncScreen
SharedPreferencesWithCacheSharedPreferencesAsyncExplorer (cache is ignored)SharedPreferencesExplorerAsyncScreen (cache is ignored)

1. Floating button widget

Wrap your app's root widget with SharedPreferencesExplorer or SharedPreferencesAsyncExplorer, and tap the floating button to open.

void main() {
  runApp(
    SharedPreferencesExplorer(
      // /*Optional*/ instance:
      // /*Optional*/ initialFloatingButtonAlignment: 
      child: YourApp(),
    ),
  );
}
  • The floating button is draggable, and the initial position can be set using initialFloatingButtonAlignment parameter.

2. Screen widget

Use SharedPreferencesExplorerScreen or SharedPreferencesExplorerAsyncScreen anywhere in your app.

Navigator.of(context).push(
  MaterialPageRoute<void>(
    builder: (context) =>
        const SharedPreferencesExplorerScreen(
            // /*Optional*/ instance:
            ),
  ),
);

Note

  • Any cache settings in SharedPreferencesWithCache will be ignored and the latest value is always retrieved.

  • You can optionally provide an instance to the instance parameter. If not provided, SharedPreferences.getInstance() or SharedPreferencesAsync() will be used.