cloud_firestore_web 0.1.1+2

  • Readme
  • Changelog
  • Installing
  • 93

cloud_firestore_web #

The web implementation of cloud_firestore.

Usage #

Import the package #

This package is the endorsed implementation of cloud_firestore for the web platform since version 0.13.2, so it gets automatically added to your application by depending on cloud_firestore: ^0.13.2.

No further modifications to your pubspec.yaml should be required in a recent enough version of Flutter (>=1.12.13+hotfix.4):

  cloud_firestore: ^0.13.2

Update index.html #

Due to this bug in dartdevc, you will need to manually add the Firebase JavaScript files to your index.html file.

In your app directory, edit web/index.html to add the following:

        <script src=""></script>
        <script src=""></script>
        <!-- Other firebase SDKs/config here -->
        <script src="main.dart.js"></script>

Initialize Firebase #

If your app is using the "default" Firebase app (this means that you're not doing any package:firebase_core initialization yourself), you'll need to initialize it now, following the steps in the Firebase Web Setup docs.

Specifically, you'll want to add the following lines to your web/index.html file:

  <!-- Previously loaded Firebase SDKs -->

  <!-- ADD THIS BEFORE YOUR main.dart.js SCRIPT -->
    // TODO: Replace the following with your app's Firebase project configuration.
    // See:
    var firebaseConfig = {
      apiKey: "...",
      authDomain: "[YOUR_PROJECT]",
      databaseURL: "https://[YOUR_PROJECT]",
      projectId: "[YOUR_PROJECT]",
      storageBucket: "[YOUR_PROJECT]",
      messagingSenderId: "...",
      appId: "1:...:web:...",
      measurementId: "G-..."
    // Initialize Firebase

  <script src="main.dart.js"></script>

Use the plugin #

Once you have modified your web/index.html file, you should be able to use package:cloud_firestore as normal. Refer to the cloud_firestore documentation for more details.

0.1.1+2 #

  • Ensure QueryWeb correctly encodes values passed in to [start|end][At|Before](Document?) methods.

0.1.1+1 #

  • Ensure FieldValueFactoryWeb correctly encodes parameters for arrayRemove/arrayUnion FieldValues.

0.1.1 #

  • Support equality comparison of field values.
  • FieldValueWeb no longer extends FieldValuePlatform.
  • Updated platform interface dependency.

0.1.0+4 #

  • Make the pedantic dev_dependency explicit.

0.1.0+3 #

  • Removed unit test that was only testing dart-lang behavior.

0.1.0+2 #

  • Update documentation about this package being the endorsed platform for web.

0.1.0+1 #

  • Fix fileName prop in pubspec.yaml

0.1.0 #

  • Initial release

Use this package as a library

1. Depend on it

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

  cloud_firestore_web: ^0.1.1+2

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

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

  • Dart: 2.8.2
  • pana: 0.13.8-dev
  • Flutter: 1.17.1

Health suggestions

Fix lib/src/transaction_web.dart. (-1.49 points)

Analysis of lib/src/transaction_web.dart reported 3 hints:

line 24 col 5: 'await' applied to 'Transaction', which is not a 'Future'.

line 45 col 5: 'await' applied to 'Transaction', which is not a 'Future'.

line 56 col 5: 'await' applied to 'Transaction', which is not a 'Future'.

Maintenance suggestions

The package description is too short. (-19 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

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

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
cloud_firestore_platform_interface ^1.1.0 1.1.2
firebase ^7.0.0 7.3.0
firebase_core ^0.4.3+1 0.4.5
flutter 0.0.0
flutter_web_plugins 0.0.0
http_parser ^3.1.3 3.1.4
js ^0.6.1 0.6.1+1
meta ^1.1.7 1.1.8
Transitive dependencies
charcode 1.1.3
collection 1.14.12
http 0.12.1
matcher 0.12.6
path 1.7.0
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
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
firebase_core_platform_interface ^1.0.0 1.0.4
firebase_core_web ^0.1.1 0.1.1+2
mockito ^4.1.1
pedantic ^1.8.0 1.9.0