From 5af6b059470205817c8a0445b7b49a40e09cb132 Mon Sep 17 00:00:00 2001 From: Felipe Date: Tue, 31 Oct 2023 17:09:24 -0500 Subject: [PATCH] =?UTF-8?q?ocultar=20boton=20cambiar=20contrase=C3=B1a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/screens/profile.dart | 56 +++++++++++++++++--------------- lib/src/screens/profile_web.dart | 56 +++++++++++++++++--------------- 2 files changed, 58 insertions(+), 54 deletions(-) diff --git a/lib/src/screens/profile.dart b/lib/src/screens/profile.dart index a5087f0..565a323 100644 --- a/lib/src/screens/profile.dart +++ b/lib/src/screens/profile.dart @@ -590,34 +590,36 @@ class _ProfileScreenState extends State { padding: const EdgeInsets.only(bottom: 30), child: Column( children: [ - ElevatedButton( - onPressed: () { - Navigator.push( - context, - CupertinoPageRoute( - builder: (BuildContext context) { - return NewPasswordScreen(); + _email != null + ? ElevatedButton( + onPressed: () { + Navigator.push( + context, + CupertinoPageRoute( + builder: (BuildContext context) { + return NewPasswordScreen(); + }, + ), + ); }, - ), - ); - }, - style: ElevatedButton.styleFrom( - backgroundColor: const Color(0xFF2BA4EC), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(50), - ), - elevation: 0, - minimumSize: const Size(300, 45), - ), - child: const Text( - 'Cambiar Contraseña', - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 17, - ), - ), - ), + style: ElevatedButton.styleFrom( + backgroundColor: const Color(0xFF2BA4EC), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(50), + ), + elevation: 0, + minimumSize: const Size(300, 45), + ), + child: const Text( + 'Cambiar Contraseña', + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 17, + ), + ), + ) + : SizedBox(height: 20), const SizedBox(height: 60), ElevatedButton( onPressed: () async { diff --git a/lib/src/screens/profile_web.dart b/lib/src/screens/profile_web.dart index ff60b43..95a128d 100644 --- a/lib/src/screens/profile_web.dart +++ b/lib/src/screens/profile_web.dart @@ -551,34 +551,36 @@ class _ProfileWebScreenState extends State { padding: const EdgeInsets.only(bottom: 30), child: Column( children: [ - ElevatedButton( - onPressed: () { - Navigator.push( - context, - CupertinoPageRoute( - builder: (BuildContext context) { - return NewPasswordScreen(); + _email != null + ? ElevatedButton( + onPressed: () { + Navigator.push( + context, + CupertinoPageRoute( + builder: (BuildContext context) { + return NewPasswordScreen(); + }, + ), + ); }, - ), - ); - }, - style: ElevatedButton.styleFrom( - backgroundColor: const Color(0xFF2BA4EC), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(50), - ), - elevation: 0, - minimumSize: const Size(300, 45), - ), - child: const Text( - 'Cambiar Contraseña', - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 17, - ), - ), - ), + style: ElevatedButton.styleFrom( + backgroundColor: const Color(0xFF2BA4EC), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(50), + ), + elevation: 0, + minimumSize: const Size(300, 45), + ), + child: const Text( + 'Cambiar Contraseña', + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 17, + ), + ), + ) + : const SizedBox(height: 20), const SizedBox(height: 60), ElevatedButton( onPressed: () async {