firebase_storage 0.1.4

  • Example
  • Installing
  • Versions
  • 94

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

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


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

Getting Started

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


  • Enabled use in Swift projects.


  • Added StorageReference path getter to retrieve the path component for the storage node.


  • Added StorageReference delete function to remove files from Firebase.


  • Simplified and upgraded Android project template to Android SDK 27.
  • Updated package description.


  • Breaking change. Upgraded to Gradle 4.1 and Android Studio Gradle plugin 3.0.1. Older Flutter projects need to upgrade their Gradle setup as well in order to use this version of the plugin. Instructions can be found here.
  • Relaxed GMS dependency to [11.4.0,12.0[


  • Added FLT prefix to iOS types
  • Change GMS dependency to 11.4.+


  • Change GMS dependency to 11.+


  • Added StorageReference getData function to download files into memory.


  • Aligned author name with rest of repo.


  • Updated to Firebase SDK to always use latest patch version for 11.0.x builds
  • Fix crash when encountering upload failure


  • Updated to Firebase SDK Version 11.0.1


  • Suppress unchecked warnings


  • Bumped buildToolsVersion to 25.0.3
  • Updated README


  • Initial Release


// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:async';
import 'dart:io';
import 'dart:math';

import 'package:flutter/material.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:http/http.dart' as http;

void main() {
  runApp(new MyApp());

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Storage Example',
      home: new MyHomePage(),

class MyHomePage extends StatefulWidget {
  _MyHomePageState createState() => new _MyHomePageState();

const String kTestString = "Hello world!";

class _MyHomePageState extends State<MyHomePage> {
  String _fileContents;

  Future<Null> _uploadFile() async {
    final Directory systemTempDir = Directory.systemTemp;
    final File file = await new File('${systemTempDir.path}/foo.txt').create();
    assert(await file.readAsString() == kTestString);
    final String rand = "${new Random().nextInt(10000)}";
    final StorageReference ref =
    final StorageUploadTask uploadTask = ref.put(file);
    final Uri downloadUrl = (await uploadTask.future).downloadUrl;
    final http.Response downloadData = await http.get(downloadUrl);
    setState(() {
      _fileContents = downloadData.body;

  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: const Text('Flutter Storage Example'),
      body: new Center(
        child: new Column(
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            _fileContents == null
                ? const Text('Press the button to upload a file')
                : new Text(
                    'Success!\n\nFile contents: "$_fileContents"',
                    style: const TextStyle(
                        color: const Color.fromARGB(255, 0, 155, 0)),
      floatingActionButton: new FloatingActionButton(
        onPressed: _uploadFile,
        tooltip: 'Upload',
        child: new Icon(Icons.file_upload),

1. Depend on it

Add this to your package's pubspec.yaml file:

  firebase_storage: "^0.1.4"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:firebase_storage/firebase_storage.dart';
Version Uploaded Documentation Archive
0.1.4 Feb 15, 2018 Go to the documentation of firebase_storage 0.1.4 Download firebase_storage 0.1.4 archive
0.1.3 Feb 8, 2018 Go to the documentation of firebase_storage 0.1.3 Download firebase_storage 0.1.3 archive
0.1.2 Jan 26, 2018 Go to the documentation of firebase_storage 0.1.2 Download firebase_storage 0.1.2 archive
0.1.1 Jan 12, 2018 Go to the documentation of firebase_storage 0.1.1 Download firebase_storage 0.1.1 archive
0.1.0 Dec 20, 2017 Go to the documentation of firebase_storage 0.1.0 Download firebase_storage 0.1.0 archive
0.0.8 Dec 14, 2017 Go to the documentation of firebase_storage 0.0.8 Download firebase_storage 0.0.8 archive
0.0.7 Oct 17, 2017 Go to the documentation of firebase_storage 0.0.7 Download firebase_storage 0.0.7 archive
0.0.6 Sep 15, 2017 Go to the documentation of firebase_storage 0.0.6 Download firebase_storage 0.0.6 archive
0.0.5 Jul 7, 2017 Go to the documentation of firebase_storage 0.0.5 Download firebase_storage 0.0.5 archive
0.0.4 Jun 20, 2017 Go to the documentation of firebase_storage 0.0.4 Download firebase_storage 0.0.4 archive

All 12 versions...


This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • tool failures on Feb 15, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1
  • Flutter: 0.0.22


Describes how popular the package is relative to other packages. [more]
98 / 100
Code health derived from static analysis. [more]
100 / 100
Reflects how tidy and up-to-date the package is. [more]
76 / 100
Overall score:
Weighted score of the above. [more]


Detected platforms: unsure

Error(s) prevent platform classification.


  • Fix dependencies in pubspec.yaml.

    Running flutter packages pub upgrade failed with the following output:

    ERR: Invalid argument(s): Minimum version ("2.0.0-dev.23.0") must be less than maximum ("2.0.0-dev.16.0").
    ERR: package:pub_semver/src/version_range.dart 59         new VersionRange
     package:pub/src/pubspec.dart 366                     Pubspec._ensureEnvironment
     package:pub/src/pubspec.dart 331                     Pubspec.dartSdkConstraint
     package:pub/src/solver/backtracking_solver.dart 511  BacktrackingSolver._checkPubspecMatchesSdkConstraint
     package:pub/src/solver/backtracking_solver.dart 474  BacktrackingSolver._checkVersion
     ===== asynchronous gap ===========================
     package:pub/src/solver/backtracking_solver.dart 432  BacktrackingSolver._findValidVersion.<fn>
     ===== asynchronous gap ===========================
     dart:async                                           Future.doWhile
     package:pub/src/solver/backtracking_solver.dart 430  BacktrackingSolver._findValidVersion
     package:pub/src/solver/backtracking_solver.dart 337  BacktrackingSolver._versionQueueFor
     ===== asynchronous gap ===========================
     package:pub/src/solver/backtracking_solver.dart 290  BacktrackingSolver._solve.<fn>
     ===== asynchronous gap ===========================
     dart:async                                           _completeOnAsyncReturn
     package:pub/src/solver/backtracking_solver.dart 315  BacktrackingSolver._solve.<fn>
     dart:async                                           _completeOnAsyncReturn
     package:pub/src/solver/version_selection.dart 64
     dart:async                                           _completeOnAsyncReturn
     package:pub/src/solver/version_selection.dart 91     VersionSelection._addDependencies
     dart:async                                           _completeOnAsyncReturn
     package:pub/src/solver/version_selection.dart 91     VersionSelection._addDependencies
    ERR: This is an unexpected error. Please run
         pub --trace upgrade --verbosity io --no-precompile
     and include the logs in an issue on
  • Fix platform conflicts.

    Make sure none of the libraries use mutually exclusive dependendencies.

  • Fix issues reported by dartanalyzer.

    dartanalyzer reported 1 error(s) and 0 warning(s).

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0