fixing dashboard issue

merge-requests/334/head
hussam al-habibeh 3 years ago
parent 1ed76e91aa
commit 50d3a42743

@ -465,21 +465,30 @@ class _HomePageState extends State<HomePage> {
children: <Widget>[ children: <Widget>[
if (projectViewModel.havePrivilege(64)) if (projectViewModel.havePrivilege(64))
DashboardItem( DashboardItem(
onTap: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) onTap: (model.user != null && model.user.outSA == 1)
? () { ? () {}
: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: HomeHealthCarePage(), page: HomeHealthCarePage(),
), ),
); );
} },
: () {},
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) child: (model.user != null && model.user.outSA == 1)
? Column( ? Container(
width: double.infinity,
height: double.infinity,
color: Colors.grey.withOpacity(0.7),
child: Icon(
Icons.lock_outline,
size: 40,
),
)
: Column(
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/home_health_care_icon.png', 'assets/images/home_health_care_icon.png',
@ -497,15 +506,6 @@ class _HomePageState extends State<HomePage> {
fontSize: SizeConfig.textMultiplier * 1.55, 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, height: MediaQuery.of(context).size.width * 0.4,
@ -514,14 +514,22 @@ class _HomePageState extends State<HomePage> {
), ),
if (projectViewModel.havePrivilege(65)) if (projectViewModel.havePrivilege(65))
DashboardItem( DashboardItem(
onTap: () => (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) onTap: () =>
? getPharmacyToken(model) (model.user != null && model.user.outSA == 1) ? () {} : getPharmacyToken(model),
: () {},
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) child: (model.user != null && model.user.outSA == 1)
? Column( ? Container(
width: double.infinity,
height: double.infinity,
color: Colors.grey.withOpacity(0.7),
child: Icon(
Icons.lock_outline,
size: 40,
),
)
: Column(
children: <Widget>[ children: <Widget>[
// if (projectViewModel.user != null && model.isLogin && model.user.outSA == 1) // if (projectViewModel.user != null && model.isLogin && model.user.outSA == 1)
// Image.asset( // Image.asset(
@ -545,15 +553,6 @@ class _HomePageState extends State<HomePage> {
fontSize: SizeConfig.textMultiplier * 1.55, 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,21 +561,30 @@ class _HomePageState extends State<HomePage> {
), ),
if (projectViewModel.havePrivilege(67)) if (projectViewModel.havePrivilege(67))
DashboardItem( DashboardItem(
onTap: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) onTap: (model.user != null && model.user.outSA == 1)
? () { ? () {}
: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: CMCPage(), page: CMCPage(),
), ),
); );
} },
: () {},
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0) child: (model.user != null && model.user.outSA == 1)
? Column( ? Container(
width: double.infinity,
height: double.infinity,
color: Colors.grey.withOpacity(0.7),
child: Icon(
Icons.lock_outline,
size: 40,
),
)
: Column(
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/comprehensive_medical_checkup_logo.png', 'assets/images/comprehensive_medical_checkup_logo.png',
@ -594,17 +602,7 @@ class _HomePageState extends State<HomePage> {
fontSize: SizeConfig.textMultiplier * 1.55, 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, height: MediaQuery.of(context).size.width * 0.4,
color: HexColor("#747C80"), color: HexColor("#747C80"),

Loading…
Cancel
Save