push ordenar por timestamp
This commit is contained in:
@@ -27,7 +27,6 @@ class DrawerMenu extends StatefulWidget {
|
||||
|
||||
class _DrawerMenuState extends State<DrawerMenu> {
|
||||
final uid = AuthenticationRepository.instance.getCurrentUserUid();
|
||||
UserModel? user;
|
||||
ScoresModel? scoresModel;
|
||||
|
||||
@override
|
||||
@@ -54,7 +53,7 @@ class _DrawerMenuState extends State<DrawerMenu> {
|
||||
Widget build(BuildContext context) {
|
||||
final userProvider = Provider.of<UserProvider>(context);
|
||||
|
||||
// final UserModel? user = userProvider.user;
|
||||
UserModel? user;
|
||||
|
||||
return Drawer(
|
||||
child: Column(
|
||||
@@ -68,7 +67,7 @@ class _DrawerMenuState extends State<DrawerMenu> {
|
||||
builder: (BuildContext context,
|
||||
AsyncSnapshot<UserModel> snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return Center(child: CircularProgressIndicator());
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (snapshot.hasError) {
|
||||
return Center(child: Text('Error: ${snapshot.error}'));
|
||||
} else {
|
||||
@@ -343,59 +342,77 @@ class _DrawerMenuState extends State<DrawerMenu> {
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
if (user?.name == '' ||
|
||||
user?.city == '' ||
|
||||
user?.phoneNumber == '' ||
|
||||
user?.phoneNumber == null) {
|
||||
Get.snackbar(
|
||||
'Completa tu perfil',
|
||||
'Para ser un profesional registrado, asegúrate de llenar todos los campos necesarios y no olvides guardar tus cambios para que surtan efecto.',
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
StreamBuilder<UserModel>(
|
||||
stream: userProvider.itemsStream,
|
||||
builder:
|
||||
(BuildContext context, AsyncSnapshot<UserModel> snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (snapshot.hasError) {
|
||||
return Center(child: Text('Error: ${snapshot.error}'));
|
||||
} else {
|
||||
if (user?.phoneNumber != user?.phoneNumber) {
|
||||
Get.snackbar(
|
||||
'Tu número de teléfono sigue sin cambios.',
|
||||
'Para guardar esta información, dirígete a tu perfil y selecciona la opción Guardar',
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
} else {
|
||||
if (user?.state == 'pendiente' || user?.state == null) {
|
||||
if (kIsWeb) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const ProfessionalProfileWebScreen()),
|
||||
UserModel? user = snapshot.data;
|
||||
|
||||
return ElevatedButton(
|
||||
onPressed: () {
|
||||
if (user?.name == '' ||
|
||||
user?.city == '' ||
|
||||
user?.phoneNumber == '' ||
|
||||
user?.phoneNumber == null) {
|
||||
Get.snackbar(
|
||||
'Completa tu perfil',
|
||||
'Para ser un profesional registrado, asegúrate de llenar todos los campos necesarios y no olvides guardar tus cambios para que surtan efecto.',
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
} else {
|
||||
Navigator.pushNamed(context, '/profesionalProfile');
|
||||
if (user?.phoneNumber != user?.phoneNumber) {
|
||||
Get.snackbar(
|
||||
'Tu número de teléfono sigue sin cambios.',
|
||||
'Para guardar esta información, dirígete a tu perfil y selecciona la opción Guardar',
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
} else {
|
||||
if (user?.state == 'pendiente' ||
|
||||
user?.state == null) {
|
||||
if (kIsWeb) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
const ProfessionalProfileWebScreen(),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
Navigator.pushNamed(
|
||||
context, '/profesionalProfile');
|
||||
}
|
||||
} else if (user?.state == 'revision') {
|
||||
Navigator.pushNamed(
|
||||
context, '/profesionalRevision');
|
||||
} else if (user?.state == 'activo') {
|
||||
Navigator.pushNamed(context, '/solicitud');
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (user?.state == 'revision') {
|
||||
Navigator.pushNamed(context, '/profesionalRevision');
|
||||
} else if (user?.state == 'activo') {
|
||||
Navigator.pushNamed(context, '/solicitud');
|
||||
}
|
||||
}
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF2BA4EC),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
elevation: 0,
|
||||
minimumSize: const Size(230, 45),
|
||||
),
|
||||
child: const Text(
|
||||
'Modo profesional',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF2BA4EC),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
),
|
||||
elevation: 0,
|
||||
minimumSize: const Size(230, 45),
|
||||
),
|
||||
child: const Text(
|
||||
'Modo profesional',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
ElevatedButton(
|
||||
|
||||
@@ -133,7 +133,7 @@ class _DrawerProfessionalState extends State<DrawerProfessional> {
|
||||
Navigator.of(context).push(
|
||||
CupertinoPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return const MyServicesProScreen();
|
||||
return MyServicesProScreen();
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user