dxganta / Contact-Tracing-App-TracerX

Prototype of a Contact Tracing App made using Flutter and Google's Nearby API.
MIT License
18 stars 7 forks source link

ArgumentError (Invalid argument: Instance of 'Future<LocationData>') #3

Closed uvineet53 closed 4 years ago

uvineet53 commented 4 years ago

Okay so, I updated the firebase dependencies, linking it to my account, but for some weird reason, whenever I'm testing out the app, I keep getting this Argument Error. To debug it, i also tried printing out the 'name' but with no luck. It keeps returning 'No Such Document'. issue

`void discovery() async { try { bool a = await Nearby().startDiscovery(loggedInUser.email, strategy, onEndpointFound: (id, name, serviceId) async { print('I saw id:$id with name:$name'); // the name here is an email

    var docRef =
        _firestore.collection('users').document(loggedInUser.email);

    //  When I discover someone I will see their email and add that email to the database of my contacts
    //  also get the current time & location and add it to the database
    docRef.collection('met_with').document(name).setData({
      'username': await getUsernameOfEmail(email: name),
      'contact time': DateTime.now(),
      'contact location': location.getLocation(),
    });
  }, onEndpointLost: (id) {
    print(id);
  });
  print('DISCOVERING: ${a.toString()}');
} catch (e) {
  print(e);
}

}`

ghost commented 4 years ago

This is for someone to use to develop. if you don't know how to fix that, how are you going to develop on this? A huge sigh and walks away....

dxganta commented 4 years ago

I have solved this issue. Please pull the repo and test again.