title: Flutter FutureBuilder, Future.wait with Geolocator Future and another future not fetching data
body: <p>It is already a week since I started struggling with the problem so I am totally at a loss.
  In my code - please see below - I need to resolve two futures to build the page. One - from Geolocator package to get user location for the map, the other is a list of jobs /activities available for the user in the location. The activity / job future also relies on getting location of the user and then fetches the data form API.</p>
  <p>The problem I am facing and have tried several ways (both Location and Geolocator packages) but the problem I get is that the futureSnapshot connection completes (goes to 'done') but the location part of the future is null.
  Even though I created a Future method based on Pieter's advice I still get</p>
  <blockquote>
  <p>&quot;W/Geolocator(12158): Location permissions not part of permissions
  send to onRequestPermissionsResult method.
  W/IInputConnectionWrapper(12158): reportFullscreenMode on inexistent
  InputConnection&quot;</p>
  </blockquote>
  <p>The Future created is and now it is used by fetchJobsFuture as well as provided to the MapCard widget</p>
  <pre><code>import 'package:geolocator/geolocator.dart';
  
  Future&lt;Position&gt; getUserPosition() async {
    var _permissionGranted = await Geolocator.checkPermission();
  
    if (_permissionGranted != LocationPermission.always ||
        _permissionGranted != LocationPermission.whileInUse) {
      await Geolocator.requestPermission();
    }
  
    final position = await Geolocator.getCurrentPosition();
    return position;
  }
  </code></pre>
  <p>And this is the entire code for the page:</p>
  <pre><code>class HomePage extends StatefulWidget {
        @override
        _HomePageState createState() =&gt; _HomePageState();
      }
      
      class _HomePageState extends State&lt;HomePage&gt; {
        static const double _desiredSplit =
            0.6; // ONLY one after the decimal point!!!
        double currentSplit = _desiredSplit;
        static const double _minMapFragment = 0.04;
        double listTopBarHeight = 42.0;
      
        Future&lt;JobList&gt; fetchJobsFuture;
        JobList currentListOfJobs;
      
        Future&lt;Position&gt; userPositionFuture;
        Position userPosition;
      
        @override
        void initState() {
          super.initState();
        }
      
        @override
        Widget build(BuildContext context) {
          currentListOfJobs = Provider.of&lt;JobList&gt;(context, listen: false);
      
          getUserPosition().then((value) =&gt; userPosition = value).then((_) {
            fetchJobsFuture = currentListOfJobs.getCurrentJobList();
          });
      
          return Scaffold(
            backgroundColor: Colors.white,
            body: FutureBuilder(
                future: fetchJobsFuture,
                builder: (context, AsyncSnapshot&lt;JobList&gt; futureSnaphot) {
                  if (!futureSnaphot.hasData) {
                    return Center(
                      child: CircularProgressIndicator(),
                    );
                  } else {
                    return Column(
                      mainAxisSize: MainAxisSize.max,
                      mainAxisAlignment: MainAxisAlignment.start,
                      children: [
                        SizedBox(
                          height: 200,
                          child: Container(
                            child: MapCard(
                              latitude: userPosition.latitude,
                              longitude: userPosition.longitude,
                            ),
                          ),
                        ),
                        SizedBox(
                          height: 300,
                          child: ListCard(
                            jobList: futureSnaphot.data,
                          ),
                        ),
                      ],
                    );
                  }
                }),
          );
        }
      }
  </code></pre>
  <p>Any ideas or advice would be much appreciated -  Thanks! Cheers!</p>