{"id":32275799,"url":"https://github.com/nesquikm/the_storage","last_synced_at":"2026-07-19T09:35:58.739Z","repository":{"id":219904809,"uuid":"750215592","full_name":"nesquikm/the_storage","owner":"nesquikm","description":"A fast and secure storage library for Flutter.","archived":false,"fork":false,"pushed_at":"2026-04-07T13:22:25.000Z","size":834,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-07T15:23:07.415Z","etag":null,"topics":["flutter","package","security","storage"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/the_storage","language":"JavaScript","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/nesquikm.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":"2024-01-30T07:58:54.000Z","updated_at":"2026-04-07T13:22:29.000Z","dependencies_parsed_at":"2025-10-22T23:55:10.837Z","dependency_job_id":"c5758f38-fe66-4fe6-ad37-e9c0ccb27faf","html_url":"https://github.com/nesquikm/the_storage","commit_stats":null,"previous_names":["nesquikm/the_storage"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nesquikm/the_storage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nesquikm%2Fthe_storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nesquikm%2Fthe_storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nesquikm%2Fthe_storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nesquikm%2Fthe_storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nesquikm","download_url":"https://codeload.github.com/nesquikm/the_storage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nesquikm%2Fthe_storage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35649096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-19T02:00:06.923Z","response_time":112,"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":["flutter","package","security","storage"],"created_at":"2025-10-22T23:55:04.915Z","updated_at":"2026-07-19T09:35:58.729Z","avatar_url":"https://github.com/nesquikm.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TheStorage\n\n[![Analyze and test all][analyze_and_test_badge]][analyze_and_test_link]\n[![coverage][coverage_badge]][coverage_link]\n[![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link]\n\nA fast and secure storage library for Flutter.\n\n## Features\n\n- Fast and efficient storage operations\n- Secure data encryption\n- Easy-to-use API\n\n## Getting started\n\nTo use this package, add `the_storage` as a [dependency in your pubspec.yaml file](https://flutter.dev/docs/development/packages-and-plugins/using-packages).\n\n## Usage\n\nImport the package:\n\n```dart\nimport 'package:the_storage/the_storage.dart';\n```\n\nGet an instance of the storage and initialize it:\n\n```dart\nTheStorage.i().init();\n```\n\nTheStorage is a singleton, so you can get the same instance anywhere in your app:\n\n```dart\nfinal instance = TheStorage.i();\n```\n\nYou can specify file name for storage:\n\n```dart\nTheStorage.i().init(dbName: 'my_storage.db');\n```\n\nThis should be done as early as possible in your app, and only once. Before calling `init()` second time, you should call `dispose()` method.\n\nTo write key-value pair to storage, use the `set()` method:\n\n```dart\nTheStorage.i().set('myKey', 'myValue');\n```\n\nTo read value from storage, use the `get()` method:\n\n```dart\nfinal value = await TheStorage.i().get('myKey');\n```\n\nYou can use domains to separate your data. To write key-value pair to storage with domain, use the `domain` argument:\n\n```dart\nawait TheStorage.i().set('myKey', 'myValue', domain: 'myDomain');\nfinal data = await TheStorage.i().get('myKey', domain: 'myDomain');\n```\n\nAdditionally you can delete key-value pair from storage:\n\n```dart\nawait TheStorage.i().delete(\n  'myKey',\n  domain: 'myDomain',\n);\n```\n\nAlso you can use batch operations to write multiple key-value pairs in domain, specify domain and whether to overwrite existing values:\n\n```dart\nawait TheStorage.i().setDomain(\n  {\n    'myKey': 'myValue',\n    'myKey2': 'myValue2',\n  },\n  domain: 'myDomain',\n  overwrite: false,\n);\n```\n\nRead all key-value pairs or only keys from domain:\n\n```dart\nfinal domain = await TheStorage.i().getDomain(\n  domain: 'myDomain',\n);\n\nfinal domainKeys = await TheStorage.i().getDomainKeys(\n  domain: 'myDomain',\n);\n```\n\nAnd delete data from domain:\n\n```dart\nawait TheStorage.i().deleteDomain(\n  [\n    'myKey',\n    'myKey2',\n  ],\n  domain: 'myDomain',\n);\n```\n\nYou can clear all data from storage:\n\n```dart\nawait TheStorage.i().clear();\n```\n\nFor debugging purposes you can reset storage, it will delete storage file and dispose storage instance. So, you should call `init()` method again after reset:\n\n```dart\nawait TheStorage.i().reset();\n```\n\n## Reactiveness\n\nTheStorage provides a reactive way to listen to changes in storage. You can use `stream` versions of `get`, `getDomain` and `getDomainKeys` methods to listen to changes in storage:\n\n```dart\nfinal valueStream = await TheStorage.i().subscribe('myKey', domain: 'myDomain');\nfinal domainStream = await TheStorage.i().subscribeDomain('myDomain');\nfinal domainKeysStream = await TheStorage.i().subscribeDomainKeys('myDomain');\n```\n\nThese methods have the same arguments as their non-stream versions plus boolean `keepAlive` which specifies whether to keep the stream alive the last subscriber unsubscribes, so the data will stay in memory instead of being reacquired from the storage when a new subscriber subscribes. In other hand this can cause more memory usage. By default, `keepAlive` is `true`.\n\n## Encryption\n\nTheStorage stores key and initial vector using [flutter_secure_storage](https://pub.dev/packages/flutter_secure_storage) package. Every record key is encrypted using AES with 256-bit key and 128-bit initial vector. To encrypt the record data, the same 256-bit key and a unique (for each record) 128-bit seed vector are used, which is stored with the encrypted data. So, every record has its own initial vector. This approach makes impossible replay attacks by comparing encrypted data with already known source data.\n\n## Storage\n\nTheStorage uses [sqflite](https://pub.dev/packages/sqflite) package to store data. This is a fast and reliable solution for storing data on the device. TheStorage uses a single table to store all data and indexes to speed up data search.\n\n## Testing\n\nThis package includes several unit tests for its features. To run the tests, use the following command:\n\n```bash\nflutter test\n```\n\n[analyze_and_test_badge]: https://github.com/nesquikm/the_storage/actions/workflows/analyze-and-test.yaml/badge.svg\n[analyze_and_test_link]: https://github.com/nesquikm/the_storage/actions/workflows/analyze-and-test.yaml\n[coverage_badge]: https://nesquikm.github.io/the_storage/coverage_badge.svg\n[coverage_link]: https://nesquikm.github.io/the_storage/html\n[very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg\n[very_good_analysis_link]: https://pub.dev/packages/very_good_analysis\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnesquikm%2Fthe_storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnesquikm%2Fthe_storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnesquikm%2Fthe_storage/lists"}