firebase_storage_mocks 0.1.0

  • Readme
  • Changelog
  • Installing
  • 63

Mocks for Firebase Storage. Use this package to write unit tests involving Firebase Storage.

Usage #

A simple usage example:

import 'package:firebase_storage_mocks/firebase_storage_mocks.dart';

main() {
  final storage = MockFirebaseStorage();
  final StorageReference storageRef = storage.ref().child(filename);
  final image = File(filename);
  final task = storageRef.putFile(image);
  await task.onComplete;
  // Prints 'gs://some-bucket//someimage.png'.
  print(await getGsLink(storageRef));
}

Future<String> getGsLink(StorageReference storageRef) async {
  return 'gs://' + await storageRef.getBucket() + '/' + storageRef.path;
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.1.0 #

  • Initial version

Use this package as a library

1. Depend on it

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


dependencies:
  firebase_storage_mocks: ^0.1.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_mocks/firebase_storage_mocks.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
31
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
85
Overall:
Weighted score of the above. [more]
63
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and firebase_storage_mocks.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Homepage URL is insecure. (-5 points)

Update the homepage field and use a secure (https) URL.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
firebase_storage ^3.0.6 3.1.5
flutter 0.0.0
mockito ^4.1.0 4.1.1
Transitive dependencies
async 2.4.1
boolean_selector 2.0.0
charcode 1.1.3
collection 1.14.11 1.14.12
firebase 7.2.1
firebase_core 0.4.4+3
firebase_core_platform_interface 1.0.4
firebase_core_web 0.1.1+2
flutter_web_plugins 0.0.0
http 0.12.0+4
http_parser 3.1.4
js 0.6.1+1
matcher 0.12.6
meta 1.1.8
path 1.6.4
plugin_platform_interface 1.0.2
quiver 2.1.3
sky_engine 0.0.99
source_span 1.7.0
stack_trace 1.9.3
stream_channel 2.0.0
string_scanner 1.0.5
term_glyph 1.1.0
test_api 0.2.15
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test
pedantic ^1.0.0 1.9.0
test ^1.0.0