{"id":15554990,"url":"https://github.com/camus-design/simple_shared_preferences","last_synced_at":"2025-07-22T05:03:34.965Z","repository":{"id":65735737,"uuid":"598035237","full_name":"camus-design/simple_shared_preferences","owner":"camus-design","description":"A simple wrapper for [SharedPreferences] that supports string, int, double, bool, List\u003cString\u003e, and Map\u003cString, dynamic\u003e types.","archived":false,"fork":false,"pushed_at":"2023-07-05T13:14:31.000Z","size":237,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-23T19:52:15.107Z","etag":null,"topics":["android","dart","dartlang","flutter","flutter-plugin","flutter-widget","ios","linux","localstorage","plugin","sharedpreference","sharedpreferences","web","widget","windows"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/simple_shared_preferences","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/camus-design.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}},"created_at":"2023-02-06T08:59:49.000Z","updated_at":"2024-09-28T11:58:26.000Z","dependencies_parsed_at":"2025-04-23T19:59:00.871Z","dependency_job_id":null,"html_url":"https://github.com/camus-design/simple_shared_preferences","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/camus-design/simple_shared_preferences","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camus-design%2Fsimple_shared_preferences","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camus-design%2Fsimple_shared_preferences/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camus-design%2Fsimple_shared_preferences/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camus-design%2Fsimple_shared_preferences/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/camus-design","download_url":"https://codeload.github.com/camus-design/simple_shared_preferences/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camus-design%2Fsimple_shared_preferences/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266430671,"owners_count":23927165,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["android","dart","dartlang","flutter","flutter-plugin","flutter-widget","ios","linux","localstorage","plugin","sharedpreference","sharedpreferences","web","widget","windows"],"created_at":"2024-10-02T15:05:32.484Z","updated_at":"2025-07-22T05:03:34.956Z","avatar_url":"https://github.com/camus-design.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Shared Preferences\n\n[![pub package](https://img.shields.io/pub/v/simple_shared_preferences.svg)](https://pub.dev/packages/simple_shared_preferences)\n\nA simple wrapper for [SharedPreferences](https://pub.dev/packages/shared_preferences)\n\nSupported data types are `int`, `double`, `bool`, `String` and `List\u003cString\u003e`.\n\n|             | Android | iOS  | Linux | macOS  | Web | Windows     |\n|-------------|---------|------|-------|--------|-----|-------------|\n| **Support** | SDK 16+ | 9.0+ | Any   | 10.11+ | Any | Any         |\n\n## Usage\n\nTo use this package, add `simple_shared_preferences` as a dependency in your pubspec.yaml file.\n\n### Examples\n\nHere are small examples that show you how to use the API.\n\n```dart\nimport 'package:simple_shared_preferences/simple_shared_preferences.dart';\n\nfinal simplePreference = await SimpleSharedPreferences.getInstance();\n\nawait simplePreference.set('name': 'simple shared preferences');\nawait simplePreference.set('age': 1);\nawait simplePreference.set('isDeveloper': true);\nawait simplePreference.set('height': 1.75);\nawait simplePreference.set('list': [1, 2, 3]);\nawait simplePreference.set('map': {'name': 'simple shared preferences'});\n\nfinal String name = simplePreference.get('name');\nfinal int age = simplePreference.get('age');\nfinal bool isDeveloper = simplePreference.get('isDeveloper');\nfinal double height = simplePreference.get('height');\nfinal List\u003cint\u003e list = simplePreference.get('list');\nfinal Map\u003cString, dynamic\u003e map = simplePreference.get('map');\n```\n\n### Use like SharedPreferences\n\n[SharedPreferences Doc](https://pub.dev/packages/shared_preferences)\n\n#### Write data\n\n```dart\n// Obtain shared preferences.\nfinal simplePreference = await SimpleSharedPreferences.getInstance();\n\n// Save an integer value to 'counter' key.\nawait simplePreference.setValue\u003cint\u003e('counter', 10);\n// Save an boolean value to 'repeat' key.\nawait simplePreference.setValue\u003cbool\u003e('repeat', true);\n// Save an double value to 'decimal' key.\nawait simplePreference.setValue\u003cdouble\u003e('decimal', 1.5);\n// Save an String value to 'action' key.\nawait simplePreference.setValue\u003cString\u003e('action', 'Start');\n// Save an list of strings to 'items' key.\nawait simplePreference.setValue\u003cList\u003cString\u003e\u003e('items', \u003cString\u003e['Earth', 'Moon', 'Sun']);\n\n// Save an map - simple preference\nawait simplePreference.setValue\u003cMap\u003cString, dynamic\u003e\u003e('map', \u003cString, dynamic\u003e{\n  'name': 'simple shared preferences',\n  'age': 1,\n  'isDeveloper': true,\n  'height': 1.75,\n  'list': [1, 2, 3],\n});\n```\n\n#### Read data\n\n```dart\n// Try reading data from the 'counter' key. If it doesn't exist, returns null.\nfinal int? counter = simplePreference.getValue\u003cint\u003e('counter');\n// Try reading data from the 'repeat' key. If it doesn't exist, returns null.\nfinal bool? repeat = simplePreference.getValue\u003cbool\u003e('repeat');\n// Try reading data from the 'decimal' key. If it doesn't exist, returns null.\nfinal double? decimal = simplePreference.getValue\u003cdouble\u003e('decimal');\n// Try reading data from the 'action' key. If it doesn't exist, returns null.\nfinal String? action = simplePreference.getValue\u003cString\u003e('action');\n// Try reading data from the 'items' key. If it doesn't exist, returns null.\nfinal List\u003cString\u003e? items = simplePreference.getValue\u003cList\u003cString\u003e\u003e('items');\n\n// Try reading data from the 'map' key. If it doesn't exist, returns null\nfinal Map\u003cString, dynamic\u003e? map = simplePreference.getValue\u003cMap\u003cString, dynamic\u003e\u003e('map');\n```\n\n#### Remove an entry\n\n```dart\n// Remove data for the 'counter' key.\nfinal success = await simplePreference.remove('counter');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamus-design%2Fsimple_shared_preferences","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcamus-design%2Fsimple_shared_preferences","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamus-design%2Fsimple_shared_preferences/lists"}