diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index b918d487..3f25217c 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -465,21 +465,30 @@ class _HomePageState extends State { children: [ if (projectViewModel.havePrivilege(64)) DashboardItem( - onTap: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) - ? () { + onTap: (model.user != null && model.user.outSA == 1) + ? () {} + : () { Navigator.push( context, FadePage( page: HomeHealthCarePage(), ), ); - } - : () {}, + }, child: Center( child: Padding( padding: const EdgeInsets.all(15.0), - child: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) - ? Column( + child: (model.user != null && model.user.outSA == 1) + ? Container( + width: double.infinity, + height: double.infinity, + color: Colors.grey.withOpacity(0.7), + child: Icon( + Icons.lock_outline, + size: 40, + ), + ) + : Column( children: [ Image.asset( 'assets/images/home_health_care_icon.png', @@ -497,15 +506,6 @@ class _HomePageState extends State { fontSize: SizeConfig.textMultiplier * 1.55, ) ], - ) - : Container( - width: double.infinity, - height: double.infinity, - color: Colors.grey.withOpacity(0.7), - child: Icon( - Icons.lock_outline, - size: 40, - ), )), ), height: MediaQuery.of(context).size.width * 0.4, @@ -514,14 +514,22 @@ class _HomePageState extends State { ), if (projectViewModel.havePrivilege(65)) DashboardItem( - onTap: () => (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) - ? getPharmacyToken(model) - : () {}, + onTap: () => + (model.user != null && model.user.outSA == 1) ? () {} : getPharmacyToken(model), child: Center( child: Padding( padding: const EdgeInsets.all(15.0), - child: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) - ? Column( + child: (model.user != null && model.user.outSA == 1) + ? Container( + width: double.infinity, + height: double.infinity, + color: Colors.grey.withOpacity(0.7), + child: Icon( + Icons.lock_outline, + size: 40, + ), + ) + : Column( children: [ // if (projectViewModel.user != null && model.isLogin && model.user.outSA == 1) // Image.asset( @@ -545,15 +553,6 @@ class _HomePageState extends State { fontSize: SizeConfig.textMultiplier * 1.55, ) ], - ) - : Container( - width: double.infinity, - height: double.infinity, - color: Colors.grey.withOpacity(0.7), - child: Icon( - Icons.lock_outline, - size: 40, - ), ), ), ), @@ -562,49 +561,48 @@ class _HomePageState extends State { ), if (projectViewModel.havePrivilege(67)) DashboardItem( - onTap: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) - ? () { + onTap: (model.user != null && model.user.outSA == 1) + ? () {} + : () { Navigator.push( context, FadePage( page: CMCPage(), ), ); - } - : () {}, + }, child: Center( child: Padding( - padding: const EdgeInsets.all(15.0), - child: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) - ? Column( - children: [ - Image.asset( - 'assets/images/comprehensive_medical_checkup_logo.png', - width: 50, - height: 50, - ), - SizedBox( - height: 10, + padding: const EdgeInsets.all(15.0), + child: (model.user != null && model.user.outSA == 1) + ? Container( + width: double.infinity, + height: double.infinity, + color: Colors.grey.withOpacity(0.7), + child: Icon( + Icons.lock_outline, + size: 40, ), - Texts( - TranslationBase.of(context).cmcHeading, - textAlign: TextAlign.center, - color: Colors.white, - fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, - ) - ], - ) - : Container( - width: double.infinity, - height: double.infinity, - color: Colors.grey.withOpacity(0.7), - child: Icon( - Icons.lock_outline, - size: 40, - ), - ), - ), + ) + : Column( + children: [ + Image.asset( + 'assets/images/comprehensive_medical_checkup_logo.png', + width: 50, + height: 50, + ), + SizedBox( + height: 10, + ), + Texts( + TranslationBase.of(context).cmcHeading, + textAlign: TextAlign.center, + color: Colors.white, + fontWeight: FontWeight.w700, + fontSize: SizeConfig.textMultiplier * 1.55, + ) + ], + )), ), height: MediaQuery.of(context).size.width * 0.4, color: HexColor("#747C80"),