shared_preferences_monitor 2.0.0+3 copy "shared_preferences_monitor: ^2.0.0+3" to clipboard
shared_preferences_monitor: ^2.0.0+3 copied to clipboard

A simple monitor for the Shared Preferences of your app. With it you can manage your preferences and add and delete preferences.

Buy Me A Coffee

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());
}

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(),
    );
  }
}

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();

The monitor looks like this:

monitor

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}

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.

3
likes
90
pub points
0%
popularity

Publisher

verified publisherrodrigobastos.dev

A simple monitor for the Shared Preferences of your app. With it you can manage your preferences and add and delete preferences.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, shared_preferences

More

Packages that depend on shared_preferences_monitor