firebase_storage_image 0.4.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 83

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]
81
Health:
Code health derived from static analysis. [more]
74
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
83
Learn more about scoring.

We analyzed this package on Jan 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health issues and suggestions

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

Analysis of lib/firebase_storage_image.dart failed with 1 error, 2 hints:

line 54 col 24: 'FirebaseStorageImage.load' ('ImageStreamCompleter Function(FirebaseStorageImage)') isn't a valid override of 'ImageProvider.load' ('ImageStreamCompleter Function(FirebaseStorageImage, Future

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.3+2
firebase_storage ^3.0.0 3.1.1
flutter 0.0.0
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.11 1.14.12
firebase 7.2.0
firebase_core_platform_interface 1.0.2
firebase_core_web 0.1.1+2
flutter_web_plugins 0.0.0
http 0.12.0+4
http_parser 3.1.3
js 0.6.1+1
matcher 0.12.6
meta 1.1.8
path 1.6.4
pedantic 1.9.0
quiver 2.1.2+1
sky_engine 0.0.99
source_span 1.6.0
stack_trace 1.9.3
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test