coordernadas

This commit is contained in:
Juan Felipe Duarte
2023-06-16 15:42:07 -05:00
parent b7b246b03a
commit f69201e0dd
4 changed files with 93 additions and 30 deletions
@@ -176,6 +176,20 @@ class AuthenticationRepository extends GetxController {
return city;
}
Future<String> getCoordsOfCity(String uid) async {
String coords = '';
try {
final snapshot =
await FirebaseFirestore.instance.collection('users').doc(uid).get();
final Map<String, dynamic>? data = snapshot.data();
coords = data?['coordsOfCity'] ?? '';
} catch (e) {
print('Error getting coords of city: $e');
}
print('Error getting coords of city: $coords');
return coords;
}
Future<String> getAddress(String uid) async {
String address = '';
try {