Skip to content
Branch: master
Find file History
collinjackson Merge pull request #3 from collinjackson/docs2
Update READMEs and homepage links to reflect new repository location
Latest commit 7153c28 Aug 23, 2019

README.md

Firebase Cloud Storage for Flutter

pub package

A Flutter plugin to use the Firebase Cloud Storage API.

For Flutter plugins for other Firebase products, see README.md.

Note: This plugin is still under development, and some APIs might not be available yet. Feedback and Pull Requests are most welcome!

Usage

To use this plugin, add firebase_storage as a dependency in your pubspec.yaml file.

Logging

If you wish to see status events for your upload tasks in your logs, you should listen to the StorageUploadTask.events stream.
This could look like the following if you are using StorageReference.putData:

final StorageReference storageReference = FirebaseStorage().ref().child(path);

final StorageUploadTask uploadTask = storageReference.putData(data);

final StreamSubscription<StorageTaskEvent> streamSubscription = uploadTask.events.listen((event) {
  // You can use this to notify yourself or your user in any kind of way.
  // For example: you could use the uploadTask.events stream in a StreamBuilder instead
  // to show your user what the current status is. In that case, you would not need to cancel any
  // subscription as StreamBuilder handles this automatically.

  // Here, every StorageTaskEvent concerning the upload is printed to the logs.
  print('EVENT ${event.type}');
});

// Cancel your subscription when done.
await uploadTask.onComplete;
streamSubscription.cancel();

Getting Started

See the example directory for a complete sample app using Firebase Cloud Storage.

You can’t perform that action at this time.