I'm getting from the firestore database some data, with this data I create a ListView that show my data.
I want append at the bottom of this list 3 static items that are different from the generated ones.
my code for building the list is:
child: StreamBuilder<QuerySnapshot>(
stream: Firestore.instance
.collection('users').document(userAdminId)
.collection('events')
.where('operatore', isEqualTo: _user)
.snapshots(),
builder: (BuildContext context,
AsyncSnapshot<QuerySnapshot> snapshot) {
if (snapshot.hasError)
return Text('Error: ${snapshot.error}');
switch (snapshot.data) {
case null:
return Container();
default:
return ListView.builder(
itemCount: snapshot.data.documents.length,
itemBuilder: (context, index) {
final item = snapshot.data.documents[index];
final itemID =
snapshot.data.documents[index].documentID;
final list =
snapshot.data.documents;
return Card(
...
},
);
}
},
),
now it generates 2 cards, because I get 2 events from the database
What I want to do is to append 3 more cards at the bottom of this list,
that are more and less something like this:
Card(
child: Row(
children: <Widget>[
Icon(
Icons.camera_alt
),
Text('Camera')
],
),
)
Card(
child: Row(
children: <Widget>[
Icon(
Icons.folder
),
Text('Media')
],
),
)
Card(
child: Row(
children: <Widget>[
Icon(
Icons.users
),
Text('Friends')
],
),
)
no matter how many items it generates from the database, I want to append this 3 cards at the bottom
example:
if I get 3 events, my list should be:
[event1]
[event2]
[event3]
[camera]
[media]
[friends]
if I get just one event:
[event1]
[camera]
[media]
[friends]