fixing dashboard issue

merge-update-with-lab-changes
hussam al-habibeh 5 years ago
parent d5c76b5400
commit 1ed76e91aa

@ -81,85 +81,81 @@ class _HomePageState extends State<HomePage> {
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Visibility( child: Container(
visible: model.user.outSA == 1 ? false : true, height: 125,
padding: EdgeInsets.all(5),
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/new-design/covid_bg_transparent.png"),
fit: BoxFit.fill,
),
color: Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all(Radius.circular(5))),
child: Container( child: Container(
height: 125, child: Column(
padding: EdgeInsets.all(5), children: <Widget>[
margin: EdgeInsets.all(5), Texts(
decoration: BoxDecoration( TranslationBase.of(context).covidTest,
image: DecorationImage( color: Colors.white,
image: fontWeight: FontWeight.w700,
AssetImage("assets/images/new-design/covid_bg_transparent.png"),
fit: BoxFit.fill,
), ),
color: Colors.white.withOpacity(0.3), Row(
borderRadius: BorderRadius.all(Radius.circular(5))), mainAxisAlignment: MainAxisAlignment.spaceAround,
child: Container( children: <Widget>[
child: Column( Container(
children: <Widget>[ margin: EdgeInsets.only(
Texts( top: 15.0,
TranslationBase.of(context).covidTest,
color: Colors.white,
fontWeight: FontWeight.w700,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Container(
margin: EdgeInsets.only(
top: 15.0,
),
child: SvgPicture.asset(
'assets/images/new-design/covid-19-car.svg',
width: 45.0,
height: 45.0),
), ),
Container( child: SvgPicture.asset(
margin: EdgeInsets.only(top: 5.0), 'assets/images/new-design/covid-19-car.svg',
child: Column( width: 45.0,
children: <Widget>[ height: 45.0),
Texts( ),
TranslationBase.of(context).driveThru, Container(
fontWeight: FontWeight.w700, margin: EdgeInsets.only(top: 5.0),
color: Colors.white, child: Column(
children: <Widget>[
Texts(
TranslationBase.of(context).driveThru,
fontWeight: FontWeight.w700,
color: Colors.white,
),
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
), ),
ButtonTheme( minWidth: MediaQuery.of(context).size.width * 0.15,
shape: RoundedRectangleBorder( height: 25.0,
borderRadius: BorderRadius.circular(5.0), child: RaisedButton(
), color: Colors.red[800],
minWidth: MediaQuery.of(context).size.width * 0.15, textColor: Colors.white,
height: 25.0, disabledTextColor: Colors.white,
child: RaisedButton( disabledColor: new Color(0xFFbcc2c4),
color: Colors.red[800], onPressed: () {
textColor: Colors.white, navigateToCovidDriveThru();
disabledTextColor: Colors.white, },
disabledColor: new Color(0xFFbcc2c4), child: Center(
onPressed: () {
navigateToCovidDriveThru();
},
child: Center( child: Center(
child: Center( child: Center(
child: Center( child: Center(
child: Center( child: Texts(
child: Texts( TranslationBase.of(context).bookNow,
TranslationBase.of(context).bookNow, fontWeight: FontWeight.w700,
fontWeight: FontWeight.w700, color: Colors.white,
color: Colors.white,
),
), ),
), ),
), ),
), ),
), ),
), ),
], ),
), ],
), ),
], ),
), ],
], ),
), ],
), ),
), ),
), ),
@ -462,121 +458,161 @@ class _HomePageState extends State<HomePage> {
if (projectViewModel.havePrivilege(64) || if (projectViewModel.havePrivilege(64) ||
projectViewModel.havePrivilege(65) || projectViewModel.havePrivilege(65) ||
projectViewModel.havePrivilege(67)) projectViewModel.havePrivilege(67))
if (model.user.outSA == 0) Container(
Container( margin: EdgeInsets.only(left: 15, right: 15),
margin: EdgeInsets.only(left: 15, right: 15), child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, 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: () { ? () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: HomeHealthCarePage(), page: HomeHealthCarePage(),
),
);
},
child: Center(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
children: <Widget>[
Image.asset(
'assets/images/home_health_care_icon.png',
width: 50,
height: 50,
),
SizedBox(
height: 10,
), ),
Texts( );
TranslationBase.of(context).homeHealthCare, }
textAlign: TextAlign.center, : () {},
color: Colors.white, child: Center(
fontWeight: FontWeight.w700, child: Padding(
fontSize: SizeConfig.textMultiplier * 1.55,
)
],
),
),
),
height: MediaQuery.of(context).size.width * 0.4,
imageName: 'home_healthcare_service_bg.png',
opacity: 0.5,
),
if (projectViewModel.havePrivilege(65))
DashboardItem(
onTap: () => getPharmacyToken(model),
child: Center(
child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: Column( child: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0)
children: <Widget>[ ? Column(
Image.asset( children: <Widget>[
'assets/images/pharmacy_logo.png', Image.asset(
width: 40, 'assets/images/home_health_care_icon.png',
height: 40, width: 50,
), height: 50,
SizedBox( ),
height: 20, SizedBox(
), height: 10,
Texts( ),
TranslationBase.of(context).onlinePharmacy, Texts(
textAlign: TextAlign.center, TranslationBase.of(context).homeHealthCare,
color: Colors.white, textAlign: TextAlign.center,
fontWeight: FontWeight.w700, color: Colors.white,
fontSize: SizeConfig.textMultiplier * 1.55, 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,
),
)),
),
height: MediaQuery.of(context).size.width * 0.4,
imageName: 'home_healthcare_service_bg.png',
opacity: 0.5,
),
if (projectViewModel.havePrivilege(65))
DashboardItem(
onTap: () => (projectViewModel.user != null && model.isLogin && model.user.outSA == 0)
? getPharmacyToken(model)
: () {},
child: Center(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0)
? Column(
children: <Widget>[
// if (projectViewModel.user != null && model.isLogin && model.user.outSA == 1)
// Image.asset(
// 'assets/images/lock_icon.png',
// width: 50,
// height: 50,
// ),
Image.asset(
'assets/images/pharmacy_logo.png',
width: 40,
height: 40,
),
SizedBox(
height: 20,
),
Texts(
TranslationBase.of(context).onlinePharmacy,
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,
),
),
), ),
height: MediaQuery.of(context).size.width * 0.4,
imageName: 'al-habib_onlne_pharmacy_bg.png',
), ),
if (projectViewModel.havePrivilege(67)) height: MediaQuery.of(context).size.width * 0.4,
DashboardItem( imageName: 'al-habib_onlne_pharmacy_bg.png',
onTap: () { ),
Navigator.push( if (projectViewModel.havePrivilege(67))
context, DashboardItem(
FadePage( onTap: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0)
page: CMCPage(), ? () {
), Navigator.push(
); context,
}, FadePage(
child: Center( page: CMCPage(),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
children: <Widget>[
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, child: Center(
fontWeight: FontWeight.w700, child: Padding(
fontSize: SizeConfig.textMultiplier * 1.55, padding: const EdgeInsets.all(15.0),
child: (projectViewModel.user != null && model.isLogin && model.user.outSA == 0)
? Column(
children: <Widget>[
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,
)
],
) )
], : 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,
color: HexColor("#747C80"),
imageName: 'emergency_service_image.png',
), ),
], height: MediaQuery.of(context).size.width * 0.4,
), color: HexColor("#747C80"),
imageName: 'emergency_service_image.png',
),
],
), ),
),
SizedBox( SizedBox(
height: 8, height: 8,
), ),

Loading…
Cancel
Save