title: Async function not working in WorkManager
body: <p>I am using a package WorkManager to perform some background tasks.(updating user's location).
  <a href="https://pub.dev/packages/workmanager" rel="nofollow noreferrer">https://pub.dev/packages/workmanager</a></p>
  <p>Here is my top level function.</p>
  <pre><code>void callbackDispatcher() {
    Workmanager.executeTask((task, inputData) {
      _HomeScreenState().updateUserLoc();
  
      return Future.value(true);
    });
  }
  </code></pre>
  <p>Here is my initstate, where i initialised the workmanager.</p>
  <pre><code>void initState() {
      super.initState();
  
      
      Workmanager.initialize(
        callbackDispatcher,
        isInDebugMode: true,
      );
  
      Workmanager.registerPeriodicTask(
        &quot;1&quot;,
  &quot;h&quot;
   
        frequency: Duration(minutes: 15),
      );
  </code></pre>
  <p>here is my updateUserLoc() function.</p>
  <pre><code>updateUserLoc() async {
      await GetusersLocation();
  
      GeoFirePoint point = geo.point(latitude: lat, longitude: long);
      _firestore.collection('locations').document(widget.userid).setData(
        {'position': point.data},
        merge: true, 
      );
  
      print(&quot;executing the updateUserLoc&quot;);
    }
  </code></pre>
  <p>This does not work,</p>
  <p>when i place &quot;print(&quot;executing the updateUserLoc&quot;);&quot; just below the function, it gets printed, but when below, it does not.</p>
  <p>What am i doing wrong here.
  please help.</p>