I have a streambuilder, within, I want to calculate the distance for each different card of the streambuilder. It calculates the distance if I print it in the terminal, but on the screen it shows: Instance of future < String >. Is there a fix for this? I tried making a variable and run set state, but the value has to be different for each card of the streambuilder.
Future<String> distanceInMeters({double uLat, double uLong}) async {
if (uLat == null && uLong == null) {
return "";
} else {
double distanceInMeters =
await Geolocator().distanceBetween(uLat, uLong, 52.3546274, 4.8285838);
String distance = distanceInMeters.toString();
return "$distance";
}
}