firebase_storage 0.0.2

  • Example
  • Installing
  • Versions
  • 50

Firebase Cloud Storage for Flutter #

pub package

A Flutter plugin to use the Firebase Cloud Storage API.

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.

Getting Started #

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

0.0.2 #

  • Bumped buildToolsVersion to 25.0.3
  • Updated README

0.0.1 #

  • Initial Release


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 {
    Directory systemTempDir = Directory.systemTemp;
    File file = await new File('${systemTempDir.path}/foo.txt').create();
    assert(await file.readAsString() == kTestString);
    String rand = "${new Random().nextInt(10000)}";
    StorageReference ref = FirebaseStorage.instance.ref().child("foo$rand.txt");
    StorageUploadTask uploadTask = ref.put(file);
    Uri downloadUrl = (await uploadTask.future).downloadUrl;
    http.Response downloadData = await http.get(downloadUrl);
    setState(() {
      _fileContents = downloadData.body;

  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('Flutter Storage Example'),
      body: new Center(
        child: new Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            _fileContents == null ?
            new 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),

Use this package as a library

1. Depend on it

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

  firebase_storage: ^0.0.2

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 flutter 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
2.1.0+1 Feb 25, 2019 Go to the documentation of firebase_storage 2.1.0+1 Download firebase_storage 2.1.0+1 archive
2.1.0 Feb 21, 2019 Go to the documentation of firebase_storage 2.1.0 Download firebase_storage 2.1.0 archive
2.0.1+1 Feb 15, 2019 Go to the documentation of firebase_storage 2.0.1+1 Download firebase_storage 2.0.1+1 archive
2.0.1 Feb 8, 2019 Go to the documentation of firebase_storage 2.0.1 Download firebase_storage 2.0.1 archive
2.0.0 Jan 28, 2019 Go to the documentation of firebase_storage 2.0.0 Download firebase_storage 2.0.0 archive
1.1.0+1 Jan 28, 2019 Go to the documentation of firebase_storage 1.1.0+1 Download firebase_storage 1.1.0+1 archive
1.1.0 Jan 25, 2019 Go to the documentation of firebase_storage 1.1.0 Download firebase_storage 1.1.0 archive
1.0.4 Oct 12, 2018 Go to the documentation of firebase_storage 1.0.4 Download firebase_storage 1.0.4 archive
1.0.3 Oct 4, 2018 Go to the documentation of firebase_storage 1.0.3 Download firebase_storage 1.0.3 archive
1.0.2 Aug 21, 2018 Go to the documentation of firebase_storage 1.0.2 Download firebase_storage 1.0.2 archive

All 37 versions...

Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.


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