auth phone and re auth phone

This commit is contained in:
Felipe
2024-03-12 20:02:00 -05:00
parent 13896f2b6d
commit 312cc3d863
16 changed files with 1049 additions and 178 deletions
+25 -22
View File
@@ -9,30 +9,33 @@ class GeneralDrawerHeader extends StatelessWidget {
@override
Widget build(BuildContext context) {
final user = context.read<MyUserBloc>().state.user!;
return ListTile(
onTap: () {
// Navigator.pop(context);
Navigator.push(
context,
CupertinoPageRoute(
builder: (BuildContext context) {
return const ProfileScreen();
return BlocBuilder<MyUserBloc, MyUserState>(
builder: (context, state) {
if (state.status == MyUserStatus.success) {
final user = state.user!;
return ListTile(
onTap: () {
Navigator.push(
context,
CupertinoPageRoute(
builder: (BuildContext context) {
return const ProfileScreen();
},
),
);
},
),
);
title: Text(user.name ?? '',style: const TextStyle(fontWeight: FontWeight.bold)),
subtitle: Text(user.drawerLabel,style: const TextStyle(fontSize: 12)),
leading: pictureWidget(user.picture, context),
trailing: const Icon(Icons.keyboard_arrow_right, color: Colors.black),
contentPadding: const EdgeInsets.symmetric(vertical: 10, horizontal: 15),
);
} else if (state.status == MyUserStatus.failure) {
return const Text('Error obteniendo datos del usuario');
} else {
return const CircularProgressIndicator();
}
},
title: Text(
user.name ?? '',
style: const TextStyle(fontWeight: FontWeight.bold),
),
subtitle: Text(
user.drawerLabel,
style: const TextStyle(fontSize: 12),
),
leading: pictureWidget(user.picture, context),
trailing: const Icon(Icons.keyboard_arrow_right, color: Colors.black),
contentPadding: const EdgeInsets.symmetric(vertical: 10, horizontal: 15),
);
}