title: Flutter Send a post request while waiting for gps data
body: <p>I'm stuck on my flutter project, I want to send the gps coordinate every time the user open the app to check if its position is on specific place referenced on my base (if yes it send a notification). I have two futures, one of which is dependent on the other (sending needs gps data).</p>
  <pre><code>  import 'package:http/http.dart' as http;
    import 'package:location/location.dart';
    import 'dart:convert';
  
    class Islandmenu extends StatelessWidget {
    Widget build(BuildContext context) {
    ......
   }
  
    Future&lt;void&gt;getgpscoordinates() async{
      final locdata = await Location().getLocation();
      List&lt;double&gt; gps= [locdata.latitude,locdata.longitude];
      return gps;
     }
  
    Future&lt;void&gt;checkUser(gps) async{
      const String userurl=&quot;*********/input_dbco.php&quot;;
      final response = await http.post(userurl, body:jsonEncode({
        &quot;id&quot;: &quot;&quot;,
        &quot;gps&quot;:[gps[0],gps[1]],
        &quot;dateco&quot;: &quot;&quot;,
      }));
      return response;
    }
  }//end of class 
  </code></pre>
  <p>but it's make my VM crash so i guess i do it in the wrong way ^^.</p>