title: Getting weather of some other location, even after passing correct latitude and longitude
body: <p>I am using this weather API which requires latitude and longitude to get weather. I am able to get latitude and longitude of my location(tried printing them and they are correct) but when I enter them in my API link, it shows weather of some other latitude and longitude. I have tried putting lats and longs of my location manually in the link, and it works absolutely fine. What is the issue?</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:clima/services/location.dart';
  import 'package:http/http.dart' as http;
  import 'dart:convert';
  
  double key;
  
  class LoadingScreen extends StatefulWidget {
    @override
    _LoadingScreenState createState() =&gt; _LoadingScreenState();
  }
  
  class _LoadingScreenState extends State&lt;LoadingScreen&gt; {
    var lati;
    var longi;
  
    @override
    void initState() {
      super.initState();
    }
  
    void getData() async {
      http.Response r = await http.get('http://api.weatherstack.c'
          'om/current?access_key=41eb36e0c5f82e3ddce66ef01af877a1&amp;query=$lati,$longi');
      String s = r.body;
      var data1 = jsonDecode(s)['location']['lat'];
      var data2 = jsonDecode(s)['location']['lon'];
      print(data1);
      print(data2);
      print(lati);
      print(longi);
    }
  
    void getlocation() async {
      location a = location();
      await a.getclocation();
      lati = a.lat;
      longi = a.long;
    }
  
    Widget build(BuildContext context) {
      getlocation();
      getData();
      return Scaffold();
    }
  }
  </code></pre>
  <p><strong>Another class named location</strong></p>
  <pre><code>import 'package:geolocator/geolocator.dart';
  class location{
  
    double lat;
    double long;
  
  
    Future&lt;void&gt; getclocation() async{
  // this function is defined in another class
     Position position = await Geolocator().getCurrentPosition(desiredAccuracy: LocationAccuracy.low);
    lat=position.latitude;
    long=position.longitude;
  
  
      }
  
  
  
  }
  </code></pre>
  <p><strong>Outputs are</strong></p>
  <p>41.250</p>
  <p>1.300</p>
  <p>28.7041</p>
  <p>77.1025</p>