{"id":32281175,"url":"https://github.com/youngcet/shared_preferences_wrapper","last_synced_at":"2025-10-23T00:54:56.787Z","repository":{"id":203492628,"uuid":"709717531","full_name":"youngcet/shared_preferences_wrapper","owner":"youngcet","description":"A Flutter package that provides a simple wrapper for working with shared preferences. This package simplifies the process of storing and retrieving various data types, including strings, integers, doubles, booleans, lists, and maps in shared preferences.","archived":false,"fork":false,"pushed_at":"2025-01-29T15:11:32.000Z","size":353,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T00:54:52.344Z","etag":null,"topics":["prefs","sharedpreferences","sharedpreferences-manager","sharedpreferences-wrapper"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/youngcet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-25T08:58:12.000Z","updated_at":"2025-08-10T20:07:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"f124e9ae-3da3-47e1-a307-361280376706","html_url":"https://github.com/youngcet/shared_preferences_wrapper","commit_stats":null,"previous_names":["youngcet/shared_preferences_wrapper"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/youngcet/shared_preferences_wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngcet%2Fshared_preferences_wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngcet%2Fshared_preferences_wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngcet%2Fshared_preferences_wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngcet%2Fshared_preferences_wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youngcet","download_url":"https://codeload.github.com/youngcet/shared_preferences_wrapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youngcet%2Fshared_preferences_wrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280540649,"owners_count":26347724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["prefs","sharedpreferences","sharedpreferences-manager","sharedpreferences-wrapper"],"created_at":"2025-10-23T00:54:51.430Z","updated_at":"2025-10-23T00:54:56.780Z","avatar_url":"https://github.com/youngcet.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e    \n    \u003ca href=\"https://github.com/youngcet/shared_preferences_wrapper\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/youngcet/shared_preferences_wrapper?style=social\" alt=\"Repo stars\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/youngcet/shared_preferences_wrapper/commits/master\"\u003e\u003cimg src=\"https://img.shields.io/github/last-commit/youngcet/shared_preferences_wrapper/master?logo=git\" alt=\"Last Commit\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/youngcet/shared_preferences_wrapper/pulls\"\u003e\u003cimg src=\"https://img.shields.io/github/issues-pr/youngcet/shared_preferences_wrapper\" alt=\"Repo PRs\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/youngcet/shared_preferences_wrapper/issues?q=is%3Aissue+is%3Aopen\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/youngcet/shared_preferences_wrapper\" alt=\"Repo issues\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/youngcet/shared_preferences_wrapper/graphs/contributors\"\u003e\u003cimg src=\"https://badgen.net/github/contributors/youngcet/shared_preferences_wrapper\" alt=\"Contributors\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/youngcet/shared_preferences_wrapper/blob/master/LICENSE\"\u003e\u003cimg src=\"https://badgen.net/github/license/youngcet/shared_preferences_wrapper\" alt=\"License\"\u003e\u003c/a\u003e\n    \u003cbr\u003e       \n    \u003ca href=\"https://app.codecov.io/gh/youngcet/shared_preferences_wrapper\"\u003e\u003cimg src=\"https://img.shields.io/codecov/c/github/youngcet/shared_preferences_wrapper?logo=codecov\u0026logoColor=white\" alt=\"Coverage Status\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# SharedPreferences Wrapper\n\nA Flutter package that provides a simple wrapper for working with shared preferences. This package simplifies the process of storing and retrieving various data types, including strings, integers, doubles, booleans, lists, and maps in shared preferences.\n\n[![Pub Version](https://img.shields.io/pub/v/shared_preferences_wrapper)](https://pub.dev/packages/shared_preferences_wrapper)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/youngcet/shared_preferences_wrapper/blob/main/LICENSE)\n\u003ca href=\"https://pub.dev/packages/shared_preferences_wrapper\"\u003e\u003cimg src=\"https://badgen.net/pub/popularity/shared_preferences_wrapper\" alt=\"Pub popularity\"\u003e\u003c/a\u003e\n\n## Features\n\n- Store and retrieve data types like strings, integers, doubles, booleans, lists, and maps in shared preferences.\n- Set default values for **string, bool, double, int** data types.\n- Easily update values within a map stored in shared preferences.\n- Check for the existence of keys in shared preferences.\n- Remove specific keys or clear all data from shared preferences.\n- Retrieve all shared preferences as a map.\n- Check if shared preferences are empty.\n- Encrypt/Decrypt sensitive data stored in shared preferences.\n- Add or update multiple key-value pairs in a single batch operation.\n- Add or remove listeners for shared preference changes.\n- Organize preferences based on specific groups or categories.\n- Namespace Support: Implement namespaces for easier management of different sets of preferences.\n- A fluent API for chaining multiple operations in a more readable manner.\n- A caching manager that allows storing and managing data in shared preferences with  expiration times. \n\n## Supported Data Types\n- **String**\n- **int**\n- **double**\n- **bool**\n- **String List**\n- **Map**\n\n## Installation\n\nTo use this package, add it to your `pubspec.yaml` file:\n\n```yaml\ndependencies:\n  shared_preferences_wrapper: ^your_version_here\n```\n\n## Usage\n\nHere's how to use the `SharedPreferencesWrapper` to work with shared preferences:\n\n### Using single functions to set and retrieve data\n```dart\nimport 'package:shared_preferences_wrapper/shared_preferences_wrapper.dart';\n\n// set a string value\nawait SharedPreferencesWrapper.setValue('name', 'Yung');\n// retrieving a value by key\nfinal val = await SharedPreferencesWrapper.getValue('name');\nprint(val); // output Yung\n\n// setting different data types\n// set an int value\nawait SharedPreferencesWrapper.setValue('qty', 10);\nfinal qty = await SharedPreferencesWrapper.getValue('qty');\n\n// set a double value\nawait SharedPreferencesWrapper.setValue('amount', 4.5);\nfinal amount = await SharedPreferencesWrapper.getValue('amount');\n\n// set a bool value\nawait SharedPreferencesWrapper.setValue('processed', true);\nfinal processed = await SharedPreferencesWrapper.getValue('processed');\n\n// set a string list\nawait SharedPreferencesWrapper.setValue('items', ['item 1', 'item 2']);\nfinal items = await SharedPreferencesWrapper.getValue('items');\n\n// set a map\nawait SharedPreferencesWrapper.setValue('user', {'name': 'Yung', 'lname': 'Cet'});\nfinal user = await SharedPreferencesWrapper.getValue('user');\n```\n\n### `setValue` Method\nThe setValue method is a versatile utility to store different types of data into your persistent storage or cache. It allows you to store String, int, double, bool, List\u003cString\u003e, and Map\u003cString, dynamic\u003e values. Additionally, it supports an optional expiration time for cached data, so that the stored value can automatically be removed after the specified duration.\n\n### Storing Data With Expiration\n```dart \n// The data will expire after 7 days\nawait setValue('user_name', 'John Doe', expirationDuration: Duration(days: 7));\n// The data will expire after 24 hours\nawait setValue('user_isLoggedIn', true, expirationDuration: Duration(hours: 24));\n```\n\n### Setting a default value in getValue()\nYou can specify a default value for when a key does not exist in shared preferences instead of returning null. This can be set for any of the supported data types above.\n```dart\nfinal name = await SharedPreferencesWrapper.getValue('name', defaultValue: '');\n```\n\n### Using specific functions based on data type\n```dart\nimport 'package:shared_preferences_wrapper/shared_preferences_wrapper.dart';\n\n// storing values\n// note: refer to the methods section for methods that store other data types\nawait SharedPreferencesWrapper.addString('key', 'value'); // storing strings\nawait SharedPreferencesWrapper.addInt('int', 100);    // storing int\nawait SharedPreferencesWrapper.addDouble('double', 10.0);   // storing double\nawait SharedPreferencesWrapper.addBool('bool', true);   // storing bool\nawait SharedPreferencesWrapper.addStringList('list', ['item 1', 'item 2', 'item 3']);   // storing lists\nawait SharedPreferencesWrapper.addMap('map', {'key': 'value'});   // storing map\n\n// Retrieve a string from shared preferences\n// note: refer to the methods section for methods that store other data types\nString? retrievedValue = await SharedPreferencesWrapper.getString('key');\nint? intValue = await SharedPreferencesWrapper.getInt('int');\ndouble? value = await SharedPreferencesWrapper.getDouble('key');\nbool? value = await SharedPreferencesWrapper.getBool('key');\nList\u003cString\u003e value = await SharedPreferencesWrapper.getStringList('key');\nMap\u003cString, dynamic\u003e? value = await SharedPreferencesWrapper.getMap('key');\n```\n\n## Setting default values\nYou can set default values that should be returned instead of null for **string, int, bool, double** data types.\n\n```dart\n// returns empty string instead of null\nString? stringValue = await SharedPreferencesWrapper.getString('myKey', defaultValue: '');\n\n// returns 0 instead of null\nint? intValue = await SharedPreferencesWrapper.getInt('myKey', defaultValue: 0);\n\n// returns 0.0 instead of null\ndouble? doubleValue = await SharedPreferencesWrapper.getDouble('myKey', defaultValue: 0.0);\n\n// returns false instead of null\nbool? boolValue = await SharedPreferencesWrapper.getBool('myKey', defaultValue: false);\n```\n\n## Using Namespaces\nImplementing namespace support in the `shared_preferences_wrapper` package can help you organize and manage different sets of preferences more effectively. This is simmiliar to groups.\n\n```dart\n// create the namespace\nfinal userPrefs = SharedPreferencesWrapper.createNamespace('user');\n\n// set the value in the namespace, NOTICE that the value is set in userPrefs and not 'SharedPreferencesWrapper'\nawait userPrefs.setValue('name', 'John Doe'); // the value can be any of the supported data types\n\n// get the value, NOTICE that the value is retrieved in userPrefs and not 'SharedPreferencesWrapper'\nString? userName = await userPrefs.getValue('name');\nprint('name: $userName');\n\n// to get clear the namespace\nawait userPrefs.clearNamespace();\n\n// create another namespace\nfinal appPrefs = SharedPreferencesWrapper.createNamespace('app');\nawait appPrefs.setValue('dark_mode', true);\n\nbool? mode = await appPrefs.getValue('dark_mode');\nprint('mode: $mode');\n```\n\n## Method Chaining\nImplement a builder for chaining multiple operations in a more readable manner.\n\n```dart\n// create the builder and chain methods together\nawait SharedPreferencesWrapper.getBuilder().then((builder) =\u003e {\n  builder\n      .addBool('is_logged_in', true)\n      .addDouble('amount', 10.0)\n      .addString('account', 'Prestige')\n      .addInt('quantity', 100)\n      .addMap('users', {'name': 'Yung','lname': 'Cet'})\n      .addStringList('items', ['item 1', 'item 2'])\n});\n\n// to get the value above, you can use the specific method for the data type or getValue()\nfinal is_logged_in =\n          await SharedPreferencesWrapper.getValue('is_logged_in');\n      print('is_logged_in: $is_logged_in');\n```\n\n### Checking if a key exists\nChecks if a key exists in shared preferences\n```dart\nbool? exists = await SharedPreferencesWrapper.keyExists('key');\nif (exists){\n  print('key exists');\n}else{\n  print('key does not exist');\n}\n```\n\n### Clearing all preferences\nThis clears all the stored shared preferences\n```dart\nawait SharedPreferencesWrapper.clearAll();\n```\n\n### Checking if shared preferences are empty\n```dart\nbool? isEmpty = await SharedPreferencesWrapper.isSharedPreferencesEmpty();\nif (isEmpty){\n  print('shared preferences are not empty');\n}else{\n  print('shared preferences are empty');\n}\n```\n\n### Removing a key\n```dart\nawait SharedPreferencesWrapper.removeAtKey('key');\n```\n\n### Retrieving all preferences stored\nThis returns all preferences stored\n```dart\nMap\u003cString, dynamic\u003e allPreferences = await SharedPreferencesWrapper.getAllSharedPreferences();\nprint(allPreferences);\n```\n\n## Working with Maps\n### Storing a map\n```dart\nawait SharedPreferencesWrapper.addMap('mapKey', {\n      'name': 'Yung',\n      'age': 30,\n      'isStudent': true,\n    });\n```\n\n### Retrieving a map\n```dart\nMap\u003cString, dynamic\u003e? value = await SharedPreferencesWrapper.getMap('mapKey');\nprint(value);\n```\n\n### Retrieve a value from the map on a specific key\n```dart\ndynamic value = await SharedPreferencesWrapper.getMapKey('mapKey', 'name');\nprint('value'); // output: Yung\n```\n\n### Updating a map\nYou can update an existing map by adding new items to it\n```dart\nawait SharedPreferencesWrapper.updateMap('mapKey', {'surname': 'Cet'});\n```\n\nThe updated map now looks like this\n```dart\n{\n  'name': 'Yung',\n  'age': 30,\n  'isStudent': true,\n  'surname': 'Cet'  // new item added\n}\n```\n\n### Updating a value inside a map with a specific key\nYou can update a value inside a map for a specific key\n```dart\n// this updates the age value to 40\nawait SharedPreferencesWrapper.updateMapKey('mapKey', 'age', 40);\n```\n\n### Checking if a key inside a map exists\n```dart\nfinal value = await SharedPreferencesWrapper.mapContainsKey('mapKey', 'mapKeyToCheck');\nif (value){\n  print('key exists');\n}else{\n  print('key does not exist');\n}\n```\n\n### Removing a key inside a map\n```dart\nawait SharedPreferencesWrapper.removeMapKey('mapKey', 'mapKeyToRemove');\n```\n\n## Single Batch Operation\nAdd or update multiple key-value pairs in a single batch operation\n\n```dart\n// Adding multiple preferences at once\nMap\u003cString, dynamic\u003e dataToAdd = {\n  'key1': 'value1',\n  'key2': 42,\n  'key3': true,\n  'key4': ['item1', 'item2'],\n  'key5': {'nestedKey': 'nestedValue'},\n  // Add more key-value pairs as needed\n};\n\nawait SharedPreferencesWrapper.addBatch(dataToAdd);\n\n// access the batch data normally as you would, \n//take note of the data type stored to call the correct corresponding method\nbool boolValue = await SharedPreferencesWrapper.getBool('key3');\nint intValue = await SharedPreferencesWrapper.getInt('key2');\n\n// Updating existing preferences in batch\nMap\u003cString, dynamic\u003e dataToUpdate = {\n  'key3': false,\n  'key2': 100,\n  // Update other keys as needed\n};\nawait SharedPreferencesWrapper.updateBatch(dataToUpdate);\n```\n\n## Working with Listeners\nListeners serve as the intermediaries that facilitate communication between different parts of a system, allowing components to react and respond to changes without direct coupling between them.\n\nThere are two ways to add listeners.\n\n1) Using **addListener()** method\n```dart\n// define a function to handle the preference change\nvoid handleChangeListener() {\n  print(\"Listener triggered!\");\n}\n\n@override\n  void initState() {\n    WidgetsBinding.instance?.addPostFrameCallback((_) async {\n      // Registering Listeners with callback function for when a shared preference changes\n      SharedPreferencesWrapper.addListener('key', handleChangeListener);\n    });\n}\n```\n\nYou can also define a callback function inline as below, however, if you're planning on removing the listener at some point it is better to define a callback function as shown above to ensure that the function signatures are the same.\n\n```dart\nSharedPreferencesWrapper.addListener('key', () {\n  print(\"Preference with key changed!\");\n});\n```\n\nRemoving a listener from **addListener()**\n```dart\n// define a function to handle the preference change\nvoid handleChangeListener() {\n  print(\"Listener triggered!\");\n}\n\n@override\n  void initState() {\n    WidgetsBinding.instance?.addPostFrameCallback((_) async {\n      SharedPreferencesWrapper.removeListener('key', handleChangeListener);\n    });\n}\n```\n\n2) Using **addObserver()** method\n```dart\n// Function to observe changes\nFunction(String, dynamic) handleObserverChanges = (String key, dynamic newValue) {\n  print(\"Observer triggered with data: key=$key value=$newValue\");\n};\n\n@override\n  void initState() {\n    WidgetsBinding.instance?.addPostFrameCallback((_) async {\n        // Add an observer\n      SharedPreferencesWrapper.addObserver('observer', handleObserverChanges);\n    });\n}\n```\n\nRemoving listeners from **addObserver()**\n```dart\nSharedPreferencesWrapper.removeObserver('observer', handleObserverChanges);\n```\n\n## Shared Preferences Wrapper Encryption\nShared preferences wrapper encryption allows encrypting and decrypting of sensetive data using a secret key. This can only be applied to `String` data types.\n\nThere are two types of encryption to choose from:\n\n- **AES**\n- **Salsa20**\n\n### AES Encryption\n```dart\n// import the encryption library\nimport 'package:shared_preferences_wrapper/shared_preferences_wrapper_encryption.dart';\n\n// encrypt\nString key = 'pin';\nString value = '123456';\nString secretKey16Char = 'my16CharacterKey';\n\nawait SharedPreferencesWrapper.addString(key, value,\n  aesEncryption: \n    AESEncryption( // encryption type\n        encryptionKey: secretKey16Char, // the encryption key\n));\n\n// to get the decrypted value\nString? mypin = await SharedPreferencesWrapper.getString(key,\n        aesDecryption: // decryption type\n            AESDecryption(\n              encryptionKey: encryptionKey // the encryption key\n));\n\nprint(mypin); // output 123456\n```\n\n### Salsa20 Encryption\n```dart\n// import the encryption library\nimport 'package:shared_preferences_wrapper/shared_preferences_wrapper_encryption.dart';\n\n// encrypt\nString key = 'pin';\nString value = '123456';\nString secretKey16Char = 'my16CharacterKey';\n\nawait SharedPreferencesWrapper.addString(key, value,\n  salsa20Encryption: \n    Salsa20Encryption( // encryption type\n        encryptionKey: secretKey16Char, // the encryption key\n));\n\n// to get the decrypted value\nString? mypin = await SharedPreferencesWrapper.getString(key,\n        salsa20Decryption: // decryption type\n            Salsa20Decryption(\n              encryptionKey: encryptionKey // the encryption key\n));\n\nprint(mypin); // output 123456\n```\n\n## Grouping Preferences\nOrganize preferences based on specific groups or categories\n\n```dart\n// Add preferences to a specific group\nawait SharedPreferencesWrapper.addToGroup('UserSettings', 'username', 'JohnDoe');\nawait SharedPreferencesWrapper.addToGroup('UserSettings', 'email', 'john@example.com');\n\nawait SharedPreferencesWrapper.addToGroup('AppSettings', 'darkMode', true);\nawait SharedPreferencesWrapper.addToGroup('AppSettings', 'language', 'English');\n\n// Retrieve preferences from a specific group\nMap\u003cString, dynamic\u003e? userSettings = await SharedPreferencesWrapper.getGroup('UserSettings');\nMap\u003cString, dynamic\u003e? appSettings = await SharedPreferencesWrapper.getGroup('AppSettings');\nprint('userSettings: $userSettings');\nprint('appSettings: $appSettings');\n```\n\nPlease refer to the example code provided in the package repository for more usage examples.\n\n## Caching Data\n`SharedPreferencesWrapper` allows caching of data with automatic expiration times. The cached data is stored for a specific duration and is automatically removed once the data expires. The data cached can be any of the supported data listed above.\n\n  ```dart\n  // data expires after 1 hour\n  await SharedPreferencesWrapper.cacheData('sessionToken', '123abc', Duration(hours: 1));\n\n  // get cached data\n  var data = await SharedPreferencesWrapper.getCachedData('sessionToken');\n\n  // manually clear the cached data\n  await SharedPreferencesWrapper.clearCache('sessionToken');\n```\n\n## Methods\n\n- **addString(String key, String value)**: Adds a string to shared preferences.\n- **addInt(String key, int value)**: Adds an int to shared preferences.\n- **addDouble(String key, double value)**: Adds a double to shared preferences.\n- **addBool(String key, bool value)**: Adds a bool to shared preferences.\n- **addStringList(String key, List\u003cString\u003e myList)**: Adds a list of strings to shared preferences.\n- **addMap(String key, Map\u003cString, dynamic\u003e value)**: Adds a map to shared preferences.\n- **getString(String key)**: Gets a string from shared preferences.\n- **getBool(String key)**: Gets a bool from shared preferences.\n- **getInt(String key)**: Gets an int from shared preferences.\n- **getDouble(String key)**: Gets a double from shared preferences.\n- **getStringList(String key)**: Gets a list of strings from shared preferences.\n- **getMap(String key)**: Gets a map from shared preferences.\n- **getMapKey(String key, String mapKey)**: Gets a key-value pair from a map in shared preferences.\n- **updateMapKey(String key, String mapKey, dynamic value)**: Updates a key-value pair in a map in shared preferences.\n- **updateMap(String key, Map\u003cString, dynamic\u003e newMap)**: Updates a map in shared preferences.\n- **mapContainsKey(String key, String mapKey)**: Checks if a key exists in a map in shared preferences.\n- **removeMapKey(String key, String mapKey)**: Removes a key-value pair from a map in shared preferences.\n- **keyExists(String key)**: Checks if a key exists in shared preferences.\n- **removeAtKey(String key)**: Removes a key from shared preferences.\n- **clearAll()**: Clears all shared preferences.\n- **getAllSharedPreferences()**: Gets all shared preferences.\n- **isSharedPreferencesEmpty()**: Checks if shared preferences is empty.\n- **addListener(String key, void Function() listener)**: Adds listeners for shared preference changes.\n- **removeListener(String key, VoidCallback listener)**: Removes listeners for shared preference changes.\n- **addObserver(String key, Function(String, dynamic) callback)**: Add observers for shared preference changes.\n- **removeObserver(String key, Function(String, dynamic) callback)**: Remove observers for shared preference changes.\n- **addBatch(Map\u003cString, dynamic\u003e data)**: Add multiple key-value pairs in a single batch operation.\n- **updateBatch(Map\u003cString, dynamic\u003e data)**: Update multiple key-value pairs in a single batch.\n- **addToGroup(String groupName, String key, dynamic value)** Organize preferences based on specific groups or categories.\n- **getGroup(String groupName)** Get preferences based on specific groups or categories.\n- **setValue(String key, dynamic value, {Duration expirationDuration})** Sets a value in SharedPreferences.\n- **getValue(String key, {dynamic defaultValue})** Retrieves a value from SharedPreferences.\n- **getBuilder()** Chains methods together.\n- **createNamespace(String namespace)** Create a namespace.\n- **clearNamespace()** Clears the namespace.\n- **removeWhereKeyStartsWith(String keyPrefix)** Removes preferences where key starts with the given prefix.\n\n## Contributing\n\nIf you have ideas or improvements for this package, we welcome contributions. Please open an issue or create a pull request on our [GitHub repository](https://github.com/youngcet/shared_preferences_wrapper).\n\n## License\n\nThis package is available under the [MIT License](https://github.com/youngcet/shared_preferences_wrapper/blob/main/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoungcet%2Fshared_preferences_wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoungcet%2Fshared_preferences_wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoungcet%2Fshared_preferences_wrapper/lists"}