Good day to you programmer! As i have dart code for driver to update realtime location in firebase Firestone is there is a way so using user current location and database location i will find minimum time and distance and route for user end.
_getLocation() async {
try {
final loc.LocationData _locationResult = await location.getLocation();
await FirebaseFirestore.instance.collection('location').doc('${widget.title}').set({
'latitude': _locationResult.latitude,
'longitude': _locationResult.longitude,
'name': '${widget.title}'
}, SetOptions(merge: true));
} catch (e) {
print(e);
}
}