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
+14 -1
View File
@@ -33,6 +33,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
var photoTemp = '';
var _ciudad = '...';
var _photo = '...';
var _estado = '...';
@override
void initState() {
@@ -68,6 +69,13 @@ class _ProfileScreenState extends State<ProfileScreen> {
_photo = s;
}));
}
if (_estado == '...') {
AuthenticationRepository.instance
.getState(uid.toString())
.then((String s) => setState(() {
_estado = s;
}));
}
}
Future<void> updateImage(image) async {
@@ -320,6 +328,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
final User? user = FirebaseAuth.instance.currentUser;
String city = _ciudad.toString();
String state = _estado.toString();
return SafeArea(
child: Scaffold(
@@ -508,7 +517,11 @@ class _ProfileScreenState extends State<ProfileScreen> {
SizedBox(width: 5),
ElevatedButton(
onPressed: () {
Navigator.pushNamed(context, '/profesionalRevision');
if (state == 'pendiente') {
Navigator.pushNamed(context, '/profesionalProfile');
} else if (state == 'revision') {
Navigator.pushNamed(context, '/profesionalRevision');
}
},
child: Text(
'Modo profesional',