Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when setting up Storage, uploading/downloading files, managing metadata, handling errors, or applying security rules.
.claude/skills/evanca-firebase-storage/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | -24% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 112% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 2% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 83% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 119% | 0% |
This skill defines how to correctly use Firebase Cloud Storage in Flutter applications.
Use this skill when:
flutter pub add firebase_storagedartimport 'package:firebase_storage/firebase_storage.dart'; final storage = FirebaseStorage.instance; // Or specify a bucket explicitly: // final storage = FirebaseStorage.instanceFor(bucket: "gs://BUCKET_NAME");
flutterfire configure to update your Firebase config with the default Storage bucket name.> Security note: By default, a Cloud Storage bucket requires Firebase Authentication for any action. Configuring public access may also make App Engine files publicly accessible — restrict access again when you set up Authentication.
Create a reference:
dartfinal storageRef = FirebaseStorage.instance.ref(); final fileRef = storageRef.child("uploads/file.jpg");
Upload:
dartfinal uploadTask = fileRef.putFile(file); final snapshot = await uploadTask; final downloadUrl = await snapshot.ref.getDownloadURL();
Download (in-memory):
dartfinal data = await fileRef.getData();
Download URL:
dartfinal downloadUrl = await fileRef.getDownloadURL();
Delete:
dartawait fileRef.delete();
Get metadata:
dartfinal metadata = await fileRef.getMetadata(); print('Content type: ${metadata.contentType}'); print('Size: ${metadata.size}');
Update metadata:
dartfinal newMetadata = SettableMetadata( contentType: "image/jpeg", customMetadata: {'uploaded_by': 'user123'}, ); await fileRef.updateMetadata(newMetadata);
Use custom metadata to store additional key/value pairs with your files.
Use try-catch with FirebaseException. Key error codes:
| Code | Meaning | |---|---| | storage/object-not-found | File doesn't exist at the reference | | storage/bucket-not-found | No bucket configured for Cloud Storage | | storage/project-not-found | No project configured for Cloud Storage | | storage/quota-exceeded | Storage quota exceeded | | storage/unauthenticated | User needs to authenticate | | storage/unauthorized | User lacks permission | | storage/retry-limit-exceeded | Operation timeout exceeded |
quota-exceeded on the Spark plan, upgrade to Blaze.Monitor upload progress:
dartfinal uploadTask = fileRef.putFile(file); uploadTask.snapshotEvents.listen((TaskSnapshot snapshot) { print('Progress: ${(snapshot.bytesTransferred / snapshot.totalBytes) * 100}%'); });
uploadTask.cancel().uploadTask.pause() and uploadTask.resume().Other measured skills in the registry, with their headline benchmark lift.