update
This commit is contained in:
@@ -133,27 +133,27 @@ class AuthenticationRepository extends GetxController {
|
||||
}
|
||||
|
||||
Future<String> getName(String uid) async {
|
||||
String city = 'error';
|
||||
CollectionReference collectionUsers =
|
||||
FirebaseFirestore.instance.collection('users');
|
||||
DocumentSnapshot snapshot = await collectionUsers.doc(uid).get();
|
||||
|
||||
final Map<String, dynamic> doc = snapshot.data() as Map<String, dynamic>;
|
||||
if (doc['name'] != null) {
|
||||
city = doc['name'];
|
||||
String name = '...';
|
||||
try {
|
||||
final snapshot =
|
||||
await FirebaseFirestore.instance.collection('users').doc(uid).get();
|
||||
final Map<String, dynamic>? data = snapshot.data();
|
||||
name = data?['name'] ?? '...';
|
||||
} catch (e) {
|
||||
print('Error getting name: $e');
|
||||
}
|
||||
return city;
|
||||
return name;
|
||||
}
|
||||
|
||||
Future<String> getCity(String uid) async {
|
||||
String city = 'error';
|
||||
CollectionReference collectionUsers =
|
||||
FirebaseFirestore.instance.collection('users');
|
||||
DocumentSnapshot snapshot = await collectionUsers.doc(uid).get();
|
||||
|
||||
final Map<String, dynamic> doc = snapshot.data() as Map<String, dynamic>;
|
||||
if (doc['city'] != null) {
|
||||
city = doc['city'];
|
||||
String city = '...';
|
||||
try {
|
||||
final snapshot =
|
||||
await FirebaseFirestore.instance.collection('users').doc(uid).get();
|
||||
final Map<String, dynamic>? data = snapshot.data();
|
||||
city = data?['city'] ?? '...';
|
||||
} catch (e) {
|
||||
print('Error getting city: $e');
|
||||
}
|
||||
return city;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user