is there any way I can add more value to the ListTile in the code as I am trying to use ListTile to call the value of data in FireCloud. As for now, I can only call 2 of the data that is in the document. Any help would be much appreciated on how to call multiple data in FireCloud and display it.
return Container(
child: Card(
child: ListTile(
title: Text(widget.post.data["Address"]),
subtitle: Image.network(widget.post.data["Picture"],
),
),
),
);
Use ListView.builder constructor , this will help you fetch the total data from the FireCloud
. You can use it like this:
Two major things required, these are:
FireCloud
. Store the coming data into a list, and then pass it into this keyitemCount
Reference:
ListView.builder(
itemCount: listItems.length,
itemBuilder: (BuildContext ctxt, int index){
// your_view
}
)
For more reference, please refer to this Medium Article on how to get started: Flutter: Displaying Content using ListView.builder
Check out this example that will work for you :
ListView.builder(
itemCount: /* snapshot.data.length */,
itemBuilder: (_, index) {
return GestureDetector(
onTap: (){
//navigateToDetail(snapshot.data[index]),
},
child: Card(
child: Column(
children: <Widget>[
Text('your address'),
Text('you and another data')
],
),
),
);
}),
You ca align it in the way you want.
Let me know if it works
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.