{"id":15293139,"url":"https://github.com/marchdev-tk/cross_local_storage","last_synced_at":"2025-04-13T12:29:06.080Z","repository":{"id":56827446,"uuid":"246365561","full_name":"marchdev-tk/cross_local_storage","owner":"marchdev-tk","description":"SharedPreferences wrapper for both Mobile (Android/iOS), Web and Desktop (Windows, macOS, Linux).","archived":false,"fork":false,"pushed_at":"2023-09-27T20:47:05.000Z","size":370,"stargazers_count":10,"open_issues_count":0,"forks_count":5,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-27T03:34:43.118Z","etag":null,"topics":["android","dart","dart2","dartlang","flutter","flutter-package","flutter-plugin","ios","linux","localstorage","macos","macosx","nsuserdefaults","shared-preferences","sharedpreferences","storage","userdefaults","web","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marchdev-tk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-10T17:30:46.000Z","updated_at":"2023-09-27T20:38:33.000Z","dependencies_parsed_at":"2024-10-14T21:41:30.603Z","dependency_job_id":"b9160847-def1-430d-a0a8-fb8393610880","html_url":"https://github.com/marchdev-tk/cross_local_storage","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fcross_local_storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fcross_local_storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fcross_local_storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fcross_local_storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marchdev-tk","download_url":"https://codeload.github.com/marchdev-tk/cross_local_storage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248713794,"owners_count":21149776,"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","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","dart2","dartlang","flutter","flutter-package","flutter-plugin","ios","linux","localstorage","macos","macosx","nsuserdefaults","shared-preferences","sharedpreferences","storage","userdefaults","web","windows"],"created_at":"2024-09-30T16:39:57.755Z","updated_at":"2025-04-13T12:29:06.058Z","avatar_url":"https://github.com/marchdev-tk.png","language":"C++","readme":"# cross_local_storage\n\n![Build](https://github.com/marchdev-tk/cross_local_storage/workflows/build/badge.svg)\n[![Pub](https://img.shields.io/pub/v/cross_local_storage.svg)](https://pub.dartlang.org/packages/cross_local_storage)\n![GitHub](https://img.shields.io/github/license/marchdev-tk/cross_local_storage)\n![GitHub stars](https://img.shields.io/github/stars/marchdev-tk/cross_local_storage?style=social)\n\nWraps NSUserDefaults (on iOS and macOS), SharedPreferences (on Android), LocalStorage (on Web) and JSON file (on Windows and Linux), providing a persistent store for simple data.\nData is persisted to disk asynchronously.\nNeither platform can guarantee that writes will be persisted to disk after returning and this plugin must not be used for storing critical data.\n\n## Getting Started\n\nIn order to use this plugin, add dependency in the `pubspec.yaml`:\n\n```yaml\ncross_local_storage: any\n```\n\nor\n\n```yaml\ncross_local_storage:\n  git:\n    url: https://github.com/marchdev-tk/cross_local_storage\n```\n\nAdd an import to dart file:\n\n```dart\nimport 'package:cross_local_storage/cross_local_storage.dart';\n```\n\n### Example\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:cross_local_storage/cross_local_storage.dart';\n\nvoid main() {\n  runApp(MaterialApp(\n    home: Scaffold(\n      body: Center(\n      child: RaisedButton(\n        onPressed: _incrementCounter,\n        child: Text('Increment Counter'),\n        ),\n      ),\n    ),\n  ));\n}\n\n_incrementCounter() async {\n  LocalStorageInterface prefs = await LocalStorage.getInstance();\n  int counter = (prefs.getInt('counter') ?? 0) + 1;\n  print('Pressed $counter times.');\n  await prefs.setInt('counter', counter);\n```\n\n## Feature requests and Bug reports\n\nFeel free to post a feature requests or report a bug [here](https://github.com/marchdev-tk/cross_local_storage/issues).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarchdev-tk%2Fcross_local_storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarchdev-tk%2Fcross_local_storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarchdev-tk%2Fcross_local_storage/lists"}