Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import 'package:flutter/material.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
class ChatScreen extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
body: StreamBuilder(
stream: Firestore.instance
builder: (ctx, streamSnapshot) {
final documents =;
return ListView.builder(
itemBuilder: (ctx, index) =>
Container(child: Text('CHAT!'), padding: EdgeInsets.all(8)),
itemCount: documents.length,
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add),
onPressed: () {
.listen((data) {
data.documents.forEach((element) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.