firestore_ui 1.2.0

  • Example
  • Installing
  • Versions
  • 88

firestore_ui #

This project started as a Pull Request to the official cloud_firestore plugin, but unfortunately they are still polishing the main features and this had to be postponed.

But fear not, my fellow Cloud Firestore users, this is a package that extracted the main code from that PR and now it's available to use!

Check out the example for more info, it should be pretty straight forward since it's just a port of firebase_database's version.

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

[1.2.0] - 2019-02-08

  • Bump cloud_firestore dependency version to 0.9.0

[1.1.1] - 2019-01-14

  • Updated setState calls, should be faster to show values

[1.1.0] - 2019-01-03

  • Added onLoaded callback to FirestoreList
  • Fixed flashing of emptyChild when setted
  • Minor general fixes, better debugging if debug is set true

[1.0.1] - 2018-10-09

  • Fixed some errors on the README and package description

[1.0.0] - 2018-10-09


// Copyright 2017, the Chromium project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';

import 'package:firebase_core/firebase_core.dart'
    show FirebaseApp, FirebaseOptions;
import 'package:flutter/material.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firestore_ui/animated_firestore_list.dart';

final String title = 'firestore_ui example';

Future<void> main() async {
  final FirebaseApp app = await FirebaseApp.configure(
    name: 'test',
    options: const FirebaseOptions(
      googleAppID: '1:79601577497:ios:5f2bcc6ba8cecddd',
      gcmSenderID: '79601577497',
      apiKey: 'AIzaSyArgmRGfB5kiQT6CunAOmKRVKEsxKmy6YI-G72PVU',
      projectID: 'flutter-firestore',
  final Firestore firestore = Firestore(app: app);

  runApp(MaterialApp(title: title, home: MyHomePage(firestore: firestore)));

class MessageItem extends StatelessWidget {
  final int index;
  final DocumentSnapshot document;
  final Function(DocumentSnapshot) onTap;

  const MessageItem({
    Key key,
  }) : super(key: key);

  Widget build(BuildContext context) {
    return ListTile(
      title: Text(document['message'] ?? '<No message retrieved>'),
      subtitle: Text('Message ${this.index + 1}'),
      onTap: () => onTap(this.document),

class MyHomePage extends StatelessWidget {
  final Firestore firestore;
  CollectionReference get messages => firestore.collection('messages');

  Future<Null> _addMessage() async {
    final DocumentReference document = messages.document();
    document.setData(<String, dynamic>{
      'message': 'Hello world!',

  Future<Null> _removeMessage(DocumentSnapshot snapshot) async {
    await firestore.runTransaction((transaction) async {
      await transaction.delete(snapshot.reference).catchError(
          (exception, stacktrace) => print("Couldn't remove item: $exception"));

  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(title),
      body: FirestoreAnimatedList(
        query: firestore.collection('messages').snapshots(),
        itemBuilder: (
          BuildContext context,
          DocumentSnapshot snapshot,
          Animation<double> animation,
          int index,
        ) {
          return FadeTransition(
            opacity: animation,
            child: MessageItem(
              index: index,
              document: snapshot,
              onTap: _removeMessage,
      floatingActionButton: FloatingActionButton(
        onPressed: _addMessage,
        tooltip: 'Increment',
        child: const Icon(Icons.add),

Use this package as a library

1. Depend on it

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

  firestore_ui: ^1.2.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:firestore_ui/firestore_ui.dart';
Version Uploaded Documentation Archive
1.2.0 Feb 9, 2019 Go to the documentation of firestore_ui 1.2.0 Download firestore_ui 1.2.0 archive
1.1.1 Jan 14, 2019 Go to the documentation of firestore_ui 1.1.1 Download firestore_ui 1.1.1 archive
1.1.0 Jan 3, 2019 Go to the documentation of firestore_ui 1.1.0 Download firestore_ui 1.1.0 archive
1.0.1 Oct 9, 2018 Go to the documentation of firestore_ui 1.0.1 Download firestore_ui 1.0.1 archive
1.0.0 Oct 9, 2018 Go to the documentation of firestore_ui 1.0.0 Download firestore_ui 1.0.0 archive
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 Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13
  • Flutter: 1.2.0


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

The package description is too short. (-10 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.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
cloud_firestore ^0.9.0 0.9.0+1
firebase_core ^0.3.0 0.3.0+1
flutter 0.0.0
meta ^1.1.6 1.1.6 1.1.7
Transitive dependencies
collection 1.14.11
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies