shared_preferences_explorer 0.2.0
shared_preferences_explorer: ^0.2.0 copied to clipboard
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 #
There are two types of APIs.
Wrap your app's root widget with SharedPreferencesExplorer
, and tap the anchor button to open. #
If you are using SharedPreferencesAsync
or SharedPreferencesWithCache
in your app, use SharedPreferencesAsyncExplorer
instead.
void main() {
runApp(
SharedPreferencesExplorer(
// /*Optional*/ instance:
// /*Optional*/ initialAnchorAlignment:
child: YourApp(),
),
);
}
-
You can optionally provide a
SharedPreferences
instance to theinstance
parameter. If not provided,SharedPreferences.getInstance()
orSharedPreferencesAsync()
will be used. -
The anchor button is draggable, and the initial position can be set using
initialAnchorAlignment
parameter.
Or, use SharedPreferencesExplorerScreen
anywhere in your app. #
Or, use SharedPreferencesExplorerAsyncScreen
as well.
Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (context) =>
const SharedPreferencesExplorerScreen(
// /*Optional*/ instance:
),
),
);
Note #
- The cache feature of
SharedPreferencesWithCache
is ignored, and the latest value is always retrieved.