title: Flutter - Looping through a list of latitude and longitude from rest api to get distance between two coordinates
body: <p>In my code being able to successfully get the distance between the two coordinate  (lAT and LNG)  but my listview returns the value for only one of the list of values. Kindly find my code below.</p>
  
  <pre><code>String lat = "";
  String lng = "";
  Double distanceInKilometers = "";
  
  Future getDistance() async {
  
      distanceInMeters = await Geolocator().distanceBetween(
          currentLocation.latitude, currentLocation.longitude, double.parse(lat), double.parse(lng));
  
      distanceInKilometers = distanceInMeters.toInt() / 1000;
  
      }
  
  
  ListView.separated( itemCount: content.length,
                       itemBuilder: (context, position) {
                                        lat = content[position].lat;
                                        lng = content[position].lng;
  
                        return Container(
  child: Column(
  children: &lt;Widget&gt;[
  new Text(distanceInKilometers.toString())
  
  ],),
  
  ))
  
  
  </code></pre>