shared_preferences_monitor 1.0.0 copy "shared_preferences_monitor: ^1.0.0" to clipboard
shared_preferences_monitor: ^1.0.0 copied to clipboard

outdated

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

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.

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
0
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

License

unknown (LICENSE)

Dependencies

flutter, shared_preferences

More

Packages that depend on shared_preferences_monitor