diff --git a/lib/src/screens/profile_web.dart b/lib/src/screens/profile_web.dart index 4ce2d54..7ffe1ce 100644 --- a/lib/src/screens/profile_web.dart +++ b/lib/src/screens/profile_web.dart @@ -253,67 +253,6 @@ class _ProfileWebScreenState extends State { } } - Future deleteAccount() async { - try { - final currentUser = _auth.currentUser; - - if (currentUser != null) { - final uid = currentUser.uid; - - await FirebaseFirestore.instance.collection('users').doc(uid).delete(); - - await currentUser.delete(); - - await _auth.signOut(); - - Get.snackbar( - 'Cuenta Eliminada', - 'Tu cuenta ha sido eliminada con éxito.', - snackPosition: SnackPosition.BOTTOM, - ); - } - } catch (e) { - Get.snackbar( - 'Error al Eliminar Cuenta', - 'Hubo un error al eliminar tu cuenta. Por favor, inténtalo de nuevo más tarde.', - snackPosition: SnackPosition.BOTTOM, - ); - } - } - - Future _showDeleteAccountConfirmationDialog( - BuildContext context) async { - return showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - title: const Text('Eliminar Cuenta'), - content: const Text( - '¿Estás seguro de que deseas eliminar tu cuenta? Esta acción no se puede deshacer.'), - actions: [ - TextButton( - onPressed: () { - Navigator.of(context).pop(); - }, - child: const Text('Cancelar'), - ), - TextButton( - onPressed: () { - deleteAccount(); - Navigator.of(context).pop(); - }, - child: const Text( - 'Eliminar', - style: - TextStyle(color: Colors.red, fontWeight: FontWeight.w600), - ), - ), - ], - ); - }, - ); - } - Future updateEmailAndPassword(String email, String password) async { final User? user = FirebaseAuth.instance.currentUser; if (user != null) { @@ -640,29 +579,6 @@ class _ProfileWebScreenState extends State { ), ), ), - const SizedBox(height: 15), - ElevatedButton( - onPressed: () { - _showDeleteAccountConfirmationDialog(context); - }, - style: ElevatedButton.styleFrom( - backgroundColor: - Colors.red, // Puedes elegir un color adecuado - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(50), - ), - elevation: 0, - minimumSize: const Size(300, 45), - ), - child: const Text( - 'Eliminar Cuenta', - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 17, - ), - ), - ), const SizedBox(height: 40), ElevatedButton( onPressed: () async {