From 3a46c6cee9d93d2c89ee237a9e4ec95207e53726 Mon Sep 17 00:00:00 2001 From: Felipe Date: Sat, 29 Jul 2023 10:47:54 -0500 Subject: [PATCH] mejora de mensajes para usuario --- lib/src/screens/profession.dart | 88 ++++++++++++--------- lib/src/screens/professional_profile.dart | 29 ++++++- lib/src/screens/professional_revision.dart | 7 +- lib/src/screens/request_sent.dart | 91 ++++++++++++++-------- 4 files changed, 136 insertions(+), 79 deletions(-) diff --git a/lib/src/screens/profession.dart b/lib/src/screens/profession.dart index d8353d2..8110bbb 100644 --- a/lib/src/screens/profession.dart +++ b/lib/src/screens/profession.dart @@ -103,47 +103,59 @@ class _ProfessionScreenState extends State { var professions = filteredProfessions!; return SafeArea( - child: Scaffold( - appBar: PopAppbar( - onPressed: () { - Navigator.pop(context); - }, - label: 'Seleccione su profesión', - ), - body: Column( - children: [ - Padding( - padding: const EdgeInsets.only(left: 10, right: 10, top: 10), - child: TextField( - controller: searchController, - decoration: const InputDecoration( - hintText: 'Buscar su profesión', - prefixIcon: Icon(Icons.assignment_ind_rounded), + child: Scaffold( + appBar: PopAppbar( + onPressed: () { + Navigator.pop(context); + }, + label: 'Seleccione su profesión', + ), + body: Column( + children: [ + Container( + padding: const EdgeInsets.all(10), + child: const Text( + 'Si no ves tu profesión, ¡contáctanos en la sección de soporte y la agregaremos para ti!', + style: TextStyle( + fontSize: 16.0, + color: Colors.blue, + ), + textAlign: TextAlign.center, ), ), - ), - Expanded( - child: ListView.builder( - itemCount: professions.length, - itemBuilder: (BuildContext context, int index) { - return ListTile( - title: Text( - professions[index], - style: const TextStyle( - fontSize: 18.0, - color: Colors.black, - ), - ), - onTap: () { - updateProfession(professions[index]); - Navigator.pop(context, professions[index]); - }, - ); - }, + Padding( + padding: const EdgeInsets.only(left: 10, right: 10, top: 0), + child: TextField( + controller: searchController, + decoration: const InputDecoration( + hintText: 'Buscar su profesión', + prefixIcon: Icon(Icons.assignment_ind_rounded), + ), + ), ), - ), - ], + Expanded( + child: ListView.builder( + itemCount: professions.length, + itemBuilder: (BuildContext context, int index) { + return ListTile( + title: Text( + professions[index], + style: const TextStyle( + fontSize: 18.0, + color: Colors.black, + ), + ), + onTap: () { + updateProfession(professions[index]); + Navigator.pop(context, professions[index]); + }, + ); + }, + ), + ), + ], + ), ), - )); + ); } } diff --git a/lib/src/screens/professional_profile.dart b/lib/src/screens/professional_profile.dart index 4ef2e4b..c662639 100644 --- a/lib/src/screens/professional_profile.dart +++ b/lib/src/screens/professional_profile.dart @@ -373,6 +373,25 @@ class ProfessionalProfileScreenState extends State { } } + void _showCustomSnackBar(BuildContext context, String message) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Container( + height: 50, + child: Center( + child: Text( + message, + style: TextStyle(fontSize: 18), + ), + ), + ), + duration: Duration(seconds: 3), + backgroundColor: Colors.red, // Personaliza el color de fondo + behavior: SnackBarBehavior.floating, + ), + ); + } + Future sendInfo() async { final String cedula = _cedulaController.text.trim(); final String especializacion = _especializacionController.text.trim(); @@ -380,17 +399,19 @@ class ProfessionalProfileScreenState extends State { especializacion.split(',').map((e) => e.trim()).toList(); if (cedula.isEmpty) { - showSnackBar('Ingrese una cedula válida'); + _showCustomSnackBar(context, 'Por favor, ingrese el número de cédula.'); return; } if (image_cedula == null) { - showSnackBar('Ingrese la imagen de la cedula'); + _showCustomSnackBar( + context, 'Por favor, adjunte el documento PDF de su cédula.'); return; } if (image_certificado == null) { - showSnackBar('Ingrese la imagen de su certificado'); + _showCustomSnackBar(context, + 'Por favor, adjunte el documento PDF de su certificado. ¡Gracias por su colaboración!'); return; } @@ -730,7 +751,7 @@ class ProfessionalProfileScreenState extends State { SizedBox(width: 15), Expanded( child: Text( - 'Para añadir mas de una especialidad, envie mas fotos y separe por comas (,).', + '¡Importante! Solo aceptamos archivos en formato PDF. Si desea agregar más de una especialidad, envíe archivos adicionales separados por comas (,). ¡Gracias!', style: TextStyle(color: Colors.black, fontSize: 14), ), ) diff --git a/lib/src/screens/professional_revision.dart b/lib/src/screens/professional_revision.dart index 753217b..9727353 100644 --- a/lib/src/screens/professional_revision.dart +++ b/lib/src/screens/professional_revision.dart @@ -69,14 +69,9 @@ class _ProfessionalRevisionScreenState width: 350, child: Row( children: [ - Icon( - Icons.info_outline, - size: 20, - ), - SizedBox(width: 15), Expanded( child: Text( - 'Su información, esta en revisión, una vez aprobada podrá acceder, al perfil profesional.', + 'Gracias por proporcionar su información. Actualmente, estamos revisando sus datos y una vez aprobados, podrá acceder al perfil profesional sin problemas. Le notificaremos tan pronto como su cuenta esté lista. ¡Gracias por su paciencia!.', style: TextStyle( fontSize: 14, ), diff --git a/lib/src/screens/request_sent.dart b/lib/src/screens/request_sent.dart index ad98d21..dfe409a 100644 --- a/lib/src/screens/request_sent.dart +++ b/lib/src/screens/request_sent.dart @@ -8,37 +8,66 @@ class RequestSentScreen extends StatelessWidget { @override Widget build(BuildContext context) { return SafeArea( - child: Scaffold( - appBar: PopAppbar( - onPressed: () { - Navigator.pushReplacementNamed(context, '/servicio'); - }, - label: 'Solicitud enviada', - ), - body: Center( - child: Column( - children: [ - const Padding( - padding: EdgeInsets.only(top: 90, bottom: 40), - child: Icon( - Icons.check_circle_outline, - size: 50, - color: Color(0xFF35A8ED), - ), - ), - const Padding( - padding: EdgeInsets.only(bottom: 350), - child: Text('Información enviada con éxito.', - style: - TextStyle(color: Color(0xFF2BA4EC), fontSize: 20)), - ), - PrimaryButtom( - onPressed: () { - Navigator.pushReplacementNamed(context, '/servicio'); - }, - label: 'Inicio'), - ], + child: Scaffold( + appBar: PopAppbar( + onPressed: () { + Navigator.pushReplacementNamed(context, '/servicio'); + }, + label: 'Solicitud enviada', + ), + body: Center( + child: Column( + children: [ + const Padding( + padding: EdgeInsets.only(top: 90, bottom: 40), + child: Icon( + Icons.check_circle_outline, + size: 50, + color: Color(0xFF35A8ED), + ), ), - ))); + const Padding( + padding: EdgeInsets.only(bottom: 0), + child: Text('Información enviada con éxito.', + style: TextStyle(color: Color(0xFF2BA4EC), fontSize: 20)), + ), + Container( + margin: const EdgeInsets.only( + left: 40, right: 40, top: 50, bottom: 180), + padding: + const EdgeInsets.symmetric(horizontal: 20, vertical: 15), + decoration: BoxDecoration( + color: const Color(0xFFD6F4FF), + borderRadius: BorderRadius.circular(20), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 1, + blurRadius: 5, + offset: const Offset(1, 3), + ), + ], + ), + child: const Row( + children: [ + Expanded( + child: Text( + "¡Gracias por proporcionar tu información! Revisaremos los datos proporcionados y, una vez confirmados, podrás convertirte en un profesional registrado en nuestra aplicación. ¡Esperamos contar contigo pronto!", + style: TextStyle(color: Colors.black, fontSize: 14), + ), + ) + ], + ), + ), + PrimaryButtom( + onPressed: () { + Navigator.pushReplacementNamed(context, '/servicio'); + }, + label: 'Inicio'), + ], + ), + ), + ), + ); } }