This commit is contained in:
Juan Felipe Duarte
2023-04-09 10:03:57 -05:00
parent 5d4d9fa779
commit 029164404a
5 changed files with 136 additions and 98 deletions
@@ -27,7 +27,9 @@ class AuthenticationRepository extends GetxController {
}
_setInitialScreen(User? user) {
user == null ? Get.offAll(LoginScreen()) : Get.offAll(WelcomeScreen());
user == null
? Get.offAll(const LoginScreen())
: Get.offAll(const WelcomeScreen());
}
Future<void> phoneAuthentication(String phoneNo) async {
@@ -156,4 +158,17 @@ class AuthenticationRepository extends GetxController {
}
return photo;
}
Future<String> getState(String uid) async {
String state = '';
try {
final snapshot =
await FirebaseFirestore.instance.collection('users').doc(uid).get();
final Map<String, dynamic>? data = snapshot.data();
state = data?['estado'] ?? '';
} catch (e) {
print('Error getting estado: $e');
}
return state;
}
}