{"id":13684169,"url":"https://github.com/mix1009/ffcache","last_synced_at":"2025-08-02T12:09:31.100Z","repository":{"id":55057705,"uuid":"188235759","full_name":"mix1009/ffcache","owner":"mix1009","description":"ffcache(Flutter File Cache) is a file based key value store for caching.","archived":false,"fork":false,"pushed_at":"2021-10-26T08:29:31.000Z","size":193,"stargazers_count":14,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T10:21:36.785Z","etag":null,"topics":["cache","dart","file","flutter"],"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/mix1009.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}},"created_at":"2019-05-23T13:05:07.000Z","updated_at":"2024-03-20T06:02:18.000Z","dependencies_parsed_at":"2022-08-14T10:30:43.204Z","dependency_job_id":null,"html_url":"https://github.com/mix1009/ffcache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mix1009/ffcache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mix1009%2Fffcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mix1009%2Fffcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mix1009%2Fffcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mix1009%2Fffcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mix1009","download_url":"https://codeload.github.com/mix1009/ffcache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mix1009%2Fffcache/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268385862,"owners_count":24242105,"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-08-02T02:00:12.353Z","response_time":74,"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":["cache","dart","file","flutter"],"created_at":"2024-08-02T14:00:30.394Z","updated_at":"2025-08-02T12:09:31.071Z","avatar_url":"https://github.com/mix1009.png","language":"Dart","funding_links":[],"categories":["Dart"],"sub_categories":[],"readme":"# ffcache\n\n[![pub package](https://img.shields.io/pub/v/ffcache.svg)](https://pub.dartlang.org/packages/ffcache)\n\nffcache(Flutter File Cache) is a file based key value store. It stores cache in iOS/Android app's temporary folder. Cache automatically expires after expiration time. Web platform is also supported (uses idb_shim package).\n\n## Usage\n\nMost methods are asynchronous. So you should use await from an async function.\n\n```\nvoid testFFCache() async {\n\n  final cache = FFCache();\n\n  // initialize. most methods call init() internally if not initialized.\n  // For web platform calling init() is required.\n  await cache.init();\n\n  // insert 'key':'value' pair\n  await cache.setString('key', 'value');\n\n  // get value for 'key'\n  final value = await cache.getString('key');\n\n  // check if 'key' exists\n  if (await cache.has('key')) {\n\n    // remove cache for 'key'\n    await cache.remove('key');\n  }\n\n  // cache expires after Duration.\n  await cache.setStringWithTimeout('key', 'value', Duration(hours: 3));\n\n  // remove all cache\n  await cache.clear();\n\n  // setBytes \u0026 getBytes\n  {\n    final str = 'string data';\n    List\u003cint\u003e bytes = utf8.encode(str);\n\n    await cache.setBytes('bytes', bytes);\n    final rBytes = await cache.getBytes('bytes');\n  }\n\n  // setJSON \u0026 getJSON\n  {\n    final jsonData = json.decode('''[{\"id\":1,\"data\":\"string data\",\"nested\":{\"id\":\"hello\",\"flutter\":\"rocks\"}}]''');\n    await cache.setJSON('json', jsonData);\n\n    final rJsonData = await cache.getJSON('json');\n  }\n}\n```\n\n\n## API\n\nAvailable from https://pub.dev/documentation/ffcache/latest/ffcache/FFCache-class.html\n\n\n## How it works\nCache files are stored in the temporary directory of the app. It uses path_provider's getTemporaryDirectory(). Files in temporary directory can be deleted by the OS at any time. So, FFCache is not for general purpose key value store.\n\nOld cache entries are deleted when FFCache is initialized. By default, cache expires after 1 day.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmix1009%2Fffcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmix1009%2Fffcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmix1009%2Fffcache/lists"}