{"id":15293136,"url":"https://github.com/mattreid1/firebase_image","last_synced_at":"2025-04-09T13:10:12.294Z","repository":{"id":39543375,"uuid":"209667774","full_name":"mattreid1/firebase_image","owner":"mattreid1","description":"🔥 Cached Flutter ImageProvider for Firebase Cloud Storage","archived":false,"fork":false,"pushed_at":"2024-06-20T09:03:15.000Z","size":72,"stargazers_count":86,"open_issues_count":24,"forks_count":67,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-02T11:05:10.276Z","etag":null,"topics":["dart","dartlang","flutter","pub","widgets"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/firebase_image","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattreid1.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}},"created_at":"2019-09-19T23:50:51.000Z","updated_at":"2025-01-15T11:50:16.000Z","dependencies_parsed_at":"2023-01-21T23:03:45.874Z","dependency_job_id":"ac58a86e-9d2e-42b4-861d-dd89f0f3bca6","html_url":"https://github.com/mattreid1/firebase_image","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattreid1%2Ffirebase_image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattreid1%2Ffirebase_image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattreid1%2Ffirebase_image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattreid1%2Ffirebase_image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattreid1","download_url":"https://codeload.github.com/mattreid1/firebase_image/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045245,"owners_count":21038554,"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":["dart","dartlang","flutter","pub","widgets"],"created_at":"2024-09-30T16:39:56.428Z","updated_at":"2025-04-09T13:10:12.278Z","avatar_url":"https://github.com/mattreid1.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔥 Firebase Image Provider\n\n[![pub package](https://img.shields.io/pub/v/firebase_image.svg)](https://pub.dartlang.org/packages/firebase_image)\n\n\nA cached Flutter ImageProvider for Firebase Cloud Storage image objects.\n\n## How to use\n\nMake sure you already have [Firebase set up](https://firebase.google.com/docs/flutter/setup) on all platforms you want to use this on.\n\nSupply the `FirebaseImage` widget with the image's URI (e.g. `gs://bucket123/userIcon123.jpg`) and then put that in any widget that accepts an `ImageProvider` (most image related widgets will (e.g. `Image`, `ImageIcon`, etc.)). Please note that you do need the `gs://` prefix currently.\n\nSee the below for example code.\n\n## How does it work?\nThe code downloads the image (object) into memory as a byte array.\n\nUnless disabled using the `cacheRefreshStrategy: CacheRefreshStrategy.NEVER` option, it gets the object's last update time from metadata (a millisecond precision integer timstamp) and uses that as a defacto version number. Therefore, any update to that remote object will result in the new version being downloaded.\n\nThe image byte array in memory then gets saved to a file in the temporary directory of the app and that location is saved in a persistant database. The OS can clean up this directory at any time however.\n\nMetadata retrival is a 'Class B Operation' and has 50,000 free operations per month. After that, it is billed at $0.04 / 100,000 operations and so the default behaviour of `cacheRefreshStrategy: CacheRefreshStrategy.BY_METADATA_DATE` may incur extra cost if the object never changes. This makes this implementation a cost effective stratergy for caching as the entire object doesn't have to be transfered just to check if there have been any updates. Essentailly, any images will only need to be downloaded once per device.\n\n## Example\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:firebase_image/firebase_image.dart';\n\nclass IconImage extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(\n        title: Text('Firebase Image Provider example'),\n      ),\n      body: Image(\n        image: FirebaseImage('gs://bucket123/userIcon123.jpg'),\n        // Works with standard parameters, e.g.\n        fit: BoxFit.fitWidth,\n        width: 100,\n        // ... etc.\n      ),\n    );\n  }\n}\n```\n\n## To Do\n\n- [x] Add examples to [pub.dev](https://pub.dartlang.org/packages/firebase_image#-example-tab-)\n- [ ] Clear items from cache if they haven't been accessed after a certain amount of time (2 weeks?)\n- [ ] Add more documentation/comments\n- [ ] Create unit tests\n\n## Contributing\nIf you want to contribute, please fork the project and play around there!\n\nIf you're stuck for ideas, check [Issues](https://github.com/mattreid1/firebase_image/issues) or the above To Do list for inspiration.\n\nPlease check PRs and other peoples forks to see if anyone is working on something similiar to what you want to do.\n\nOnce you're ready, please submit a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattreid1%2Ffirebase_image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattreid1%2Ffirebase_image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattreid1%2Ffirebase_image/lists"}