From f65bbfeb16446e576f467e37593cff282b9fad68 Mon Sep 17 00:00:00 2001 From: Shreya Bhatia Date: Fri, 19 Jul 2024 21:19:42 +0530 Subject: [PATCH] confirmation added on login profile --- .../profile_screen/profile_screen.dart | 54 +++++++++++++++++-- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/lib/new_ui/screens/profile_screen/profile_screen.dart b/lib/new_ui/screens/profile_screen/profile_screen.dart index 38909805..72628128 100644 --- a/lib/new_ui/screens/profile_screen/profile_screen.dart +++ b/lib/new_ui/screens/profile_screen/profile_screen.dart @@ -349,9 +349,57 @@ class _ProfilePageState extends ConsumerState { Icons.arrow_forward, color: Colors.white, ), - onPressed: () async { - bool changesSaved = await saveChanges(ref); - if (changesSaved) GoRouter.of(context).go('/main'); + onPressed: () { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + content: SizedBox( + height: 180, + child: Container( + padding: const EdgeInsets.all(20.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + text: 'Are you in division ', + style: Theme.of(context).textTheme.bodyLarge?.copyWith( + color: Colors.white, + ), + children: [ + TextSpan(text: div, style: const TextStyle(fontWeight: FontWeight.bold)), + const TextSpan(text: ' and batch '), + TextSpan(text: batch, style: const TextStyle(fontWeight: FontWeight.bold)), + const TextSpan(text: ' ? Please check your details once.'), + ], + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: const Text("Cancel") + ), + TextButton( + onPressed: () async { + bool changesSaved = await saveChanges(ref); + if (changesSaved) GoRouter.of(context).go('/main'); + }, + child: const Text("Proceed") + ), + ], + ), + ], + ), + ), + ), + ); + } + ); }, ), ),