How can I display future value in a Text widget in listview.builder(loop)?. I am calculating distance for each property and want to display in a text widget.
Text('${ _calculateDistance(model, store)' }
Which returns an "Instance of Future"
Future<double> _calculateDistance(MainModel model, Store store) async {
double distanceInMeters = await Geolocator().distanceBetween(
model.postion.latitude,
model.postion.longitude,
store.position.latitude,
store.position.longitude);
return distanceInMeters / 1000;}
For a single post I know I can use setstate, but I am caluclatinng distance for each post.