Last updated:
0 purchases
shared preferences monitor
Package created to make it easy to see the state of the shared preferences of your app. I always find myself in a hard spot
when trying to see the current state of my preferences. This package come to manage your preferences in an easy way.
How to use #
void main() async {
await SharedPreferencesMonitor.init();
SharedPreferencesMonitor.setKey(GlobalKey<NavigatorState>());
runApp(MyApp());
}
copied to clipboard
To use it you only have to init the monitor calling the SharedPreferencesMonitor.init() method and set
a global key to the monitor so it can handle navigation.
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
navigatorKey: SharedPreferencesMonitor.getKey(),
title: 'Flutter Shared Preferences Monitor',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
copied to clipboard
And the last step to configure is to pass the monitor key to the material app navigatorKey: SharedPreferencesMonitor.getKey()
and you are ready to go.
Navigating to the monitor page is easy, just call:
SharedPreferencesMonitor.showPage();
copied to clipboard
The monitor looks like this:
You can add new preferences or delete them.
You can at anytime call SharedPreferencesMonitor.getKeyValueInfo() and it will return a Map with your keys
and values of the current state of the shared preferences.
{pref2: 2, pref1: 1, pref4: 4, pref3: 3}
copied to clipboard
Important #
The mainly idea of the package is to be used ONLY on development. You will never want your users messing up their
preferences.
Todo #
❌ Tests
Features and Bugs #
Please sugest new features and report bugs on issue tracker.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.