firestore_serialized 0.1.3

firestore_serialized #

Thin layer on top of Firestore to serialize/deserialize document's data.

Quickstart #

TypedFirestore.instance.register<User>(User.fromJson, User.toJson);

Then use the Typed... alternatives from original firestore types.

final user = TypedFirestore.instance.collection<User>("users").document("john");
final snapshot = await user.get();
print(snapshot.value.lastname);

Roadmap #

  • Transactions
  • Batches

Use this package as a library

1. Depend on it

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


dependencies:
  firestore_serialized: ^0.1.3

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

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

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/src/document.dart. (-2.48 points)

Analysis of lib/src/document.dart reported 5 hints:

line 36 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 47 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 55 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 61 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 74 col 3: The class 'Stream' wasn't exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

Fix lib/src/collection.dart. (-1 points)

Analysis of lib/src/collection.dart reported 2 hints:

line 3 col 8: Unused import: 'package:firestore_serialized/src/firestore.dart'.

line 43 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.

Fix lib/src/query.dart. (-1 points)

Analysis of lib/src/query.dart reported 2 hints:

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

line 20 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.

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/firestore_serialized.dart (Run flutter format to format lib/firestore_serialized.dart.)
  • lib/src/document_change.dart (Run flutter format to format lib/src/document_change.dart.)
  • lib/src/firestore.dart (Run flutter format to format lib/src/firestore.dart.)
  • lib/src/query_snapshot.dart (Run flutter format to format lib/src/query_snapshot.dart.)

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (cloud_firestore).

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 firestore_serialized.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.0.0-dev.68.0 <3.0.0
cloud_firestore ^0.8.2+3 0.8.2+3 0.12.10
flutter 0.0.0
meta ^1.1.6 1.1.7 1.1.8
Transitive dependencies
collection 1.14.11 1.14.12
firebase_core 0.2.5+1 0.4.1+5
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8