Reputation: 41
I want to Display a ListView with Cards from FirebaseFirestore. Also, I want to show how many Cards there are at all:
int Length = 0; //?
How to get length of a iterable .toList() list?
Column(
children: snapshot.data!.docs
.map(
(doc) =>
Card(
title: doc["title"],)
.toList(
growable: true,
),
),
),
Upvotes: 1
Views: 609
Reputation: 852
Column(
...snapshot.data!.docs
.asMap().map((index, value) => MapEntry(index, Card(
title: value["title"],)))
.values.toList(
growable: true,
),
),
Upvotes: 2