A new Flutter project.
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
class ExpenseList extends StatelessWidget { @override Widget build(BuildContext context) { return new StreamBuilder( stream: Firestore.instance.collection("expenses").snapshots, builder: (BuildContext context, AsyncSnapshot snapshot) { if (!snapshot.hasData) return new Text("There is no expense"); return new ListView(children: getExpenseItems(snapshot)); }); }
getExpenseItems(AsyncSnapshot snapshot) { return snapshot.data.documents .map((doc) => new ListTile(title: new Text(doc["name"]), subtitle: new Text(doc["amount"].toString()))) .toList(); } }