firebase_helpers 0.1.11

  • Readme
  • Changelog
  • Installing
  • 90

firebase_helpers #

A package that provides various Google Firebase related services helpers. Provides helpers to perform queries on firestore, firebase auth etc.

Publish

Getting Started #

Installation #

Add to pubspec.yaml:

dependencies:
  firebase_helpers: latest

Using firestore service #

import 'package:firebase_helpers/firebase_helpers';

class Note {
  final String title;
  final String id;
  final String description;
  final DateTime createdAt;
  final String userId;
  Note({this.title, this.id, this.description, this.createdAt, this.userId});
  Note.fromDS(String id, Map<String, dynamic> data)
      : id = id,
        title = data['title'],
        description = data['description'],
        userId = data['user_id'],
        createdAt = data['created_at']?.toDate();
  Map<String, dynamic> toMap() => {
        "title": title,
        "description": description,
        "created_at": createdAt,
        "user_id": userId,
      };
}

DatabaseService<Note> notesDb = DatabaseService<Note>("notes",fromDS: (id,data) =>  Note.fromDS(id,data), toMap:(note) => note.toMap() );

Note note = Note(
    title: "Hello Note",
    description: "This is notes description",
);
notesDb.createItem(note); //this function will add our note item to the firestore database

0.1.11 #

  • Fix query cursor errors

0.1.10 #

  • Now supports query cursors

0.1.9 #

  • Now supports create new item using map instead of model create(Map<String,dynamic> data, {String id})

0.1.8 #

  • Now supports all kinds of query parameters check QueryArgsV2 class for more details

0.1.7 #

  • fixed collection getter

0.1.6 #

  • collection path can be modified -> to make easier for sub collection queries
  • Breaking change -> Update item is no longer available
  • DatabaseItem class is depricated and it is no longer required for you to extend your model with it.

0.1.5 #

  • streamQueryList now supports limit and startAfter

0.1.4 #

  • Storage service upload method

0.1.3 #

  • fix error when document not found on streamSingle

0.1.2 #

  • updateData(String id, Map<String,dynamic> data) new function added

0.1.1 #

  • Fix readme error

0.1.0 #

  • Firestore helper DatabaseService generic class

Use this package as a library

1. Depend on it

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


dependencies:
  firebase_helpers: ^0.1.11

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_helpers/firebase_helpers.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
86
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
90
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because:

  • package:firebase_helpers/firebase_helpers.dart that imports:
  • package:firebase_storage/firebase_storage.dart that declares support for platforms: android, ios, macos

Package does not support Flutter platform web

Because:

  • package:firebase_helpers/firebase_helpers.dart that imports:
  • package:firebase_storage/firebase_storage.dart that declares support for platforms: android, ios, macos

Package does not support Flutter platform windows

Because:

  • package:firebase_helpers/firebase_helpers.dart that imports:
  • package:firebase_storage/firebase_storage.dart that declares support for platforms: android, ios, macos

Package not compatible with SDK dart

Because:

  • firebase_helpers that is a package requiring null.

Health issues and suggestions

Document public APIs. (-1 points)

47 out of 47 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/firestore_service.dart. (-0.50 points)

Analysis of lib/src/firestore_service.dart reported 1 hint:

line 77 col 11: Avoid empty statements.

Format lib/firebase_helpers.dart.

Run flutter format to format lib/firebase_helpers.dart.

Format lib/src/firebase_storage_service.dart.

Run flutter format to format lib/src/firebase_storage_service.dart.

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_helpers.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
cloud_firestore ^0.13.7 0.13.7
firebase_storage ^3.1.6 3.1.6
flutter 0.0.0
Transitive dependencies
charcode 1.1.3
cloud_firestore_platform_interface 1.1.2
cloud_firestore_web 0.1.1+2
collection 1.14.12 1.14.13
firebase 7.3.0
firebase_core 0.4.5
firebase_core_platform_interface 1.0.4
firebase_core_web 0.1.1+2
flutter_web_plugins 0.0.0
http 0.12.1
http_parser 3.1.4
js 0.6.2
matcher 0.12.8
meta 1.1.8 1.2.2
path 1.7.0
pedantic 1.9.0 1.9.2
plugin_platform_interface 1.0.2
quiver 2.1.3
sky_engine 0.0.99
source_span 1.7.0
stack_trace 1.9.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test