shared_preferences_tools 1.0.3 shared_preferences_tools: ^1.0.3 copied to clipboard
DevTools extension for Flutter: Manage SharedPreferences efficiently. Edit, search, and view keys.
A DevTools extension for Flutter's shared_preferences package.
Features #
This package adds a new tool to Flutter's DevTools, utilizing the new devtools_extensions
framework. With this tool, you can:
- List all keys stored in your app's SharedPreferences.
- Search for specific keys.
- Edit values directly, with changes reflected in your app instantly.
It supports all data types available in SharedPreferences:
- String
- int
- double
- bool
- List
- noValue (this action removes the key)
Selecting a key | Editing a value |
---|---|
Getting started #
To add this package to your project, run:
flutter pub add shared_preferences_tools
Initialize the package before starting your app:
Future<void> main() async {
await SharedPreferencesToolsDebug.init();
runApp(const YourApp());
}
Note: The
init
function has no effect in release builds. Dart's tree shaking ensures that unused functions in theSharedPreferencesToolsDebug
class are removed. This guarantees that the package will not impact your production app's performance.
Contributing to this package #
- Run the example project (or any project that includes the
await SharedPreferencesToolsDebug.init();
call) and copy its debug service URL. - Run the
shared_preferences_tools_devtools_extension
project via VSCode or by running the following command:
flutter run -d chrome --dart-define=use_simulated_environment=true
For more information, see the devtools_extensions package documentation.