From 75cd8e5c788ea6a0c71e94aabda8efb5a27126ad Mon Sep 17 00:00:00 2001 From: "hanie.khodkari" Date: Tue, 6 May 2025 17:02:02 +0330 Subject: [PATCH] Change some ui in home --- lib/pages/home_screen.dart | 84 +++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/lib/pages/home_screen.dart b/lib/pages/home_screen.dart index 004f360..6c0bcab 100755 --- a/lib/pages/home_screen.dart +++ b/lib/pages/home_screen.dart @@ -24,6 +24,7 @@ import 'TestPages/test_verify_screen.dart'; class HomePage extends StatelessWidget { @override Widget build(BuildContext context) { + final userData = Provider.of(context, listen: false).user; return SafeArea( child: Scaffold( drawer: Selector( @@ -130,6 +131,48 @@ class HomePage extends StatelessWidget { Divider( height: 15, ), + SelectionItem( + firstLine: 'TEST RESULTS', + secondLine: 'List, Details & Add a one', + firstLineColor: Colors.black, + secondLineColor: Colors.grey, + backgroundColor: kLightGreyBackground, + onTap: () => Navigator.push( + context, + MaterialPageRoute( + builder: (context) { + return Consumer( + builder: (ctx, auth, _) { + return TestResultScreen(); + }, + ); + }, + ), + ), + ), + if (!userData['roles'].contains('User')) + SelectionItem( + firstLine: 'TEST TO VERIFY', + secondLine: 'Verify and reject Test Results', + firstLineColor: Colors.black, + secondLineColor: Colors.grey, + backgroundColor: kLightGreyBackground, + onTap: () => Navigator.push( + context, + MaterialPageRoute( + builder: (context) { + return Consumer( + builder: (ctx, auth, _) { + return TestVerifyScreen(); + }, + ); + }, + ), + ), + ), + Divider( + height: 15, + ), SelectionItem( firstLine: 'ITEMS', secondLine: 'List, Details & Add a one', @@ -250,47 +293,6 @@ class HomePage extends StatelessWidget { ), ), ), - Divider( - height: 15, - ), - SelectionItem( - firstLine: 'TEST RESULTS', - secondLine: 'List, Details & Add a one', - firstLineColor: Colors.black, - secondLineColor: Colors.grey, - backgroundColor: kLightGreyBackground, - onTap: () => Navigator.push( - context, - MaterialPageRoute( - builder: (context) { - return Consumer( - builder: (ctx, auth, _) { - return TestResultScreen(); - }, - ); - }, - ), - ), - ), - SelectionItem( - firstLine: 'TEST TO VERIFY', - secondLine: 'Verify and reject Test Results', - firstLineColor: Colors.black, - secondLineColor: Colors.grey, - backgroundColor: kLightGreyBackground, - onTap: () => Navigator.push( - context, - MaterialPageRoute( - builder: (context) { - return Consumer( - builder: (ctx, auth, _) { - return TestVerifyScreen(); - }, - ); - }, - ), - ), - ), // Divider(height: 2), SizedBox( height: 5,