firebase_storage_image 0.4.0

firebase_storage_image #

pub package

Flutter's ImageProvider for images in Firebase Cloud Storage.

Getting Started #

FirebaseStorageImage implements ImageProvider. So you can use this directly for Image, CircleAvatar, ImageIcon, and something like that.

Example #

import 'package:flutter/material.dart';
import 'package:firebase_storage_image/firebase_storage_image.dart';

class YourCircleAvatar extends StatelessWidget {
  @override
  Widget build(BuildContext context) => const CircleAvatar(
        backgroundImage: FirebaseStorageImage(
          'gs://project-12345.appspot.com/path/to/avatar_image.png',
        ),
      );
}

License #

MIT

Contribution #

I need your help improving this package with leaving Pull Requests and Issues!

[0.4.0] - 2019-05-30

  • Changed code for Flutter 1.6+ compatibility (#9)

[0.3.0] - 2019-05-30

  • Update dependencies (#7)

[0.2.1] - 2018-12-31

  • Make all the code formatted by Dart's linter

[0.2.0] - 2018-12-23

  • Breaking changes
    • Add a new option of constructor: firebaseApp
    • Change type of the first argument from Uri to String

[0.1.0] - 2018-12-23

  • Breaking changes
    • Make the FirebaseStorageImage‚Äôs default constructor const
    • Change default allocated size from 2MB to 1MB

[0.0.4] - 2018-12-23

  • Correcting pubspec.yaml

[0.0.3] - 2018-12-23

  • Added document to code.

[0.0.2] - 2018-12-23

  • Only correcting pubspec.yaml

[0.0.1] - 2018-12-23

  • Initial release, should be polished. I want your help with an issue!

example/example.dart

import 'package:flutter/material.dart';
import 'package:firebase_storage_image/firebase_storage_image.dart';

class YourImage extends StatelessWidget {
  @override
  Widget build(BuildContext context) => const Image(
        image: FirebaseStorageImage(
          'gs://project-12345.appspot.com/path/to/image.png',
        ),
      );
}

class YourCircleAvatar extends StatelessWidget {
  @override
  Widget build(BuildContext context) => const CircleAvatar(
        backgroundImage: FirebaseStorageImage(
          'gs://project-12345.appspot.com/path/to/avatar_image.png',
        ),
      );
}

class YourImageIcon extends StatelessWidget {
  @override
  Widget build(BuildContext context) => const ImageIcon(
        FirebaseStorageImage(
          'gs://project-12345.appspot.com/path/to/icon_image.png',
        ),
      );
}

Use this package as a library

1. Depend on it

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


dependencies:
  firebase_storage_image: ^0.4.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub 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_image/firebase_storage_image.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
71
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
85
Learn more about scoring.

We analyzed this package on Sep 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/firebase_storage_image.dart. (-1 points)

Analysis of lib/firebase_storage_image.dart reported 2 hints:

line 50 col 3: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

line 80 col 3: The class 'Future' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
firebase_core ^0.4.0+1 0.4.0+9
firebase_storage ^3.0.0 3.0.6
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test