hide Covid19-driveThrow for patient out of KSA

merge-update-with-lab-changes
hussam al-habibeh 4 years ago
parent 1f52794185
commit 352cda4c70

@ -40,8 +40,7 @@ class HomePage extends StatefulWidget {
} }
class _HomePageState extends State<HomePage> { class _HomePageState extends State<HomePage> {
PharmacyModuleViewModel pharmacyModuleViewModel = PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
locator<PharmacyModuleViewModel>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -66,9 +65,7 @@ class _HomePageState extends State<HomePage> {
height: 210, height: 210,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: ExactAssetImage( image: ExactAssetImage('assets/images/dashboard_top_bg.png'), fit: BoxFit.cover),
'assets/images/dashboard_top_bg.png'),
fit: BoxFit.cover),
), ),
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
@ -77,131 +74,112 @@ class _HomePageState extends State<HomePage> {
left: 5, left: 5,
right: 5, right: 5,
child: Container( child: Container(
width: width: MediaQuery.of(context).size.width * 0.8,
MediaQuery.of(context).size.width * 0.8,
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Container( child: Container(
height: 125, height: 125,
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage( image:
"assets/images/new-design/covid_bg_transparent.png"), AssetImage("assets/images/new-design/covid_bg_transparent.png"),
fit: BoxFit.fill, fit: BoxFit.fill,
),
color:
Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all(
Radius.circular(5))),
child: Container(
child: Column(
children: <Widget>[
Texts(
TranslationBase.of(context)
.covidTest,
color: Colors.white,
fontWeight: FontWeight.w700,
), ),
Row( color: Colors.white.withOpacity(0.3),
mainAxisAlignment: borderRadius: BorderRadius.all(Radius.circular(5))),
MainAxisAlignment child: (model.user != null && model.user.outSA == 1)
.spaceAround, ? Container(
children: <Widget>[ width: double.infinity,
Container( height: double.infinity,
margin: EdgeInsets.only( color: Colors.grey.shade500.withOpacity(0.3),
top: 15.0, child: Icon(
), Icons.lock_outline,
child: SvgPicture.asset( size: 40,
'assets/images/new-design/covid-19-car.svg',
width: 45.0,
height: 45.0),
), ),
Container( )
margin: EdgeInsets.only( : Container(
top: 5.0), child: Column(
child: Column( children: <Widget>[
children: <Widget>[ Texts(
Texts( TranslationBase.of(context).covidTest,
TranslationBase.of( color: Colors.white,
context) fontWeight: FontWeight.w700,
.driveThru, ),
fontWeight: Row(
FontWeight.w700, mainAxisAlignment: MainAxisAlignment.spaceAround,
color: Colors.white, children: <Widget>[
), Container(
ButtonTheme( margin: EdgeInsets.only(
shape: top: 15.0,
RoundedRectangleBorder( ),
borderRadius: child: SvgPicture.asset(
BorderRadius 'assets/images/new-design/covid-19-car.svg',
.circular( width: 45.0,
5.0), height: 45.0),
), ),
minWidth: MediaQuery.of( Container(
context) margin: EdgeInsets.only(top: 5.0),
.size child: Column(
.width * children: <Widget>[
0.15, Texts(
height: 25.0, TranslationBase.of(context).driveThru,
child: RaisedButton( fontWeight: FontWeight.w700,
color: Colors color: Colors.white,
.red[800], ),
textColor: ButtonTheme(
Colors.white, shape: RoundedRectangleBorder(
disabledTextColor: borderRadius: BorderRadius.circular(5.0),
Colors.white, ),
disabledColor: minWidth: MediaQuery.of(context).size.width * 0.15,
new Color( height: 25.0,
0xFFbcc2c4), child: RaisedButton(
onPressed: () { color: Colors.red[800],
navigateToCovidDriveThru(); textColor: Colors.white,
}, disabledTextColor: Colors.white,
child: Center( disabledColor: new Color(0xFFbcc2c4),
child: Center( onPressed:
child: Center( (model.user != null && model.user.outSA == 1)
child: ? () {}
Center( : () {
child: navigateToCovidDriveThru();
Texts( },
TranslationBase.of(context) child: Center(
.bookNow, child: Center(
fontWeight: child: Center(
FontWeight.w700, child: Center(
color: Colors child: Texts(
.white, TranslationBase.of(context).bookNow,
fontWeight: FontWeight.w700,
color: Colors.white,
),
),
),
),
), ),
), ),
), ),
), ],
), ),
), ),
), ],
], ),
), ],
), ),
], )),
),
],
),
),
),
), ),
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () => Navigator.push(context, onTap: () => Navigator.push(context, FadePage(page: LiveCareHome())),
FadePage(page: LiveCareHome())),
child: Container( child: Container(
height: 125, height: 125,
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white color: Colors.white.withOpacity(0.3),
.withOpacity(0.3), borderRadius: BorderRadius.all(Radius.circular(5))),
borderRadius: BorderRadius.all(
Radius.circular(5))),
child: SvgPicture.asset( child: SvgPicture.asset(
projectViewModel.isArabic projectViewModel.isArabic
? 'assets/images/new-design/livecare_arabic_logo.svg' ? 'assets/images/new-design/livecare_arabic_logo.svg'
@ -217,23 +195,15 @@ class _HomePageState extends State<HomePage> {
], ],
), ),
), ),
Container( Container(width: double.infinity, height: projectViewModel.isArabic ? 110 : 80)
width: double.infinity,
height: projectViewModel.isArabic ? 110 : 80)
], ],
), ),
Positioned( Positioned(
top: 155, top: 155,
left: MediaQuery.of(context).size.width * left: MediaQuery.of(context).size.width *
(MediaQuery.of(context).orientation == (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03),
Orientation.landscape
? 0.02
: 0.03),
right: MediaQuery.of(context).size.width * right: MediaQuery.of(context).size.width *
(MediaQuery.of(context).orientation == (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03),
Orientation.landscape
? 0.02
: 0.03),
child: (!model.isLogin) child: (!model.isLogin)
? Container( ? Container(
width: double.infinity, width: double.infinity,
@ -241,14 +211,10 @@ class _HomePageState extends State<HomePage> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#A59E9E'), color: HexColor('#A59E9E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(color: Colors.transparent, width: 0.5),
color: Colors.transparent, width: 0.5), borderRadius: BorderRadius.all(Radius.circular(9)),
borderRadius:
BorderRadius.all(Radius.circular(9)),
image: DecorationImage( image: DecorationImage(
image: ExactAssetImage( image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover)),
'assets/images/bg_graphic.png'),
fit: BoxFit.cover)),
child: Container( child: Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Column( child: Column(
@ -264,37 +230,30 @@ class _HomePageState extends State<HomePage> {
fontSize: 23, fontSize: 23,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).myMedicalFileSubTitle,
.myMedicalFileSubTitle,
color: Colors.black, color: Colors.black,
fontSize: 16, fontSize: 16,
), ),
Align( Align(
alignment: projectViewModel.isArabic alignment:
? Alignment.bottomLeft projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight,
: Alignment.bottomRight,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
widget.goToMyProfile(); widget.goToMyProfile();
}, },
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 15, right: 15),
left: 15, right: 15),
width: 90, width: 90,
height: 30, height: 30,
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#D81A2E'), color: HexColor('#D81A2E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(color: Colors.transparent, width: 0.5),
color: Colors.transparent, borderRadius: BorderRadius.all(Radius.circular(0)),
width: 0.5),
borderRadius: BorderRadius.all(
Radius.circular(0)),
), ),
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context) TranslationBase.of(context).viewMore,
.viewMore,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 12, fontSize: 12,
@ -313,14 +272,10 @@ class _HomePageState extends State<HomePage> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#A59E9E'), color: HexColor('#A59E9E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(color: Colors.transparent, width: 0.5),
color: Colors.transparent, width: 0.5), borderRadius: BorderRadius.all(Radius.circular(9)),
borderRadius:
BorderRadius.all(Radius.circular(9)),
image: DecorationImage( image: DecorationImage(
image: ExactAssetImage( image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover),
'assets/images/bg_graphic.png'),
fit: BoxFit.cover),
), ),
child: Container( child: Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
@ -328,81 +283,51 @@ class _HomePageState extends State<HomePage> {
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
if (projectViewModel.user != null && if (projectViewModel.user != null && model.isLogin)
model.isLogin)
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 8, height: 8,
), ),
model.user.cRSVerificationStatus == model.user.cRSVerificationStatus == 2
2
? Row( ? Row(
children: [ children: [
Texts( Texts(
model.user model.user.firstName + " " + model.user.lastName,
.firstName + color: Colors.grey[100],
" " +
model.user
.lastName,
color: Colors
.grey[100],
bold: true, bold: true,
fontSize: 15, fontSize: 15,
), ),
Container( Container(
margin: EdgeInsets margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
.fromLTRB(
8.0,
0.0,
8.0,
0.0),
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/images/new-design/verification_check.svg"), "assets/images/new-design/verification_check.svg"),
), ),
], ],
) )
: model.user.cRSVerificationStatus == : model.user.cRSVerificationStatus == 3
3
? Row( ? Row(
children: [ children: [
Texts( Texts(
model.user model.user.firstName + " " + model.user.lastName,
.firstName + color: Colors.grey[100],
" " +
model.user
.lastName,
color: Colors
.grey[100],
bold: true, bold: true,
fontSize: 15, fontSize: 15,
), ),
Container( Container(
margin: EdgeInsets margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
.fromLTRB( child: SvgPicture.asset(
8.0, "assets/images/new-design/pending.svg"),
0.0,
8.0,
0.0),
child: SvgPicture
.asset(
"assets/images/new-design/pending.svg"),
), ),
], ],
) )
: Row( : Row(
children: [ children: [
Texts( Texts(
model.user model.user.firstName + " " + model.user.lastName,
.firstName + color: Colors.grey[100],
" " +
model.user
.lastName,
color: Colors
.grey[100],
bold: true, bold: true,
fontSize: 15, fontSize: 15,
), ),
@ -436,17 +361,14 @@ class _HomePageState extends State<HomePage> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#D81A2E'), color: HexColor('#D81A2E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(color: Colors.transparent, width: 0.5),
color: Colors.transparent,
width: 0.5),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(5), Radius.circular(5),
), ),
), ),
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context) TranslationBase.of(context).myMedicalFile,
.myMedicalFile,
color: Colors.white, color: Colors.white,
fontSize: 12, fontSize: 12,
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -485,10 +407,8 @@ class _HomePageState extends State<HomePage> {
width: 25, width: 25,
height: 40, height: 40,
), ),
Texts( Texts('${model.weightKg} ${TranslationBase.of(context).kg}',
'${model.weightKg} ${TranslationBase.of(context).kg}', color: Colors.white, fontSize: 17)
color: Colors.white,
fontSize: 17)
], ],
), ),
), ),
@ -503,9 +423,7 @@ class _HomePageState extends State<HomePage> {
width: 35, width: 35,
height: 40, height: 40,
), ),
Texts('${model.booldType}', Texts('${model.booldType}', color: Colors.white, fontSize: 17)
color: Colors.white,
fontSize: 17)
], ],
), ),
), ),
@ -519,12 +437,10 @@ class _HomePageState extends State<HomePage> {
], ],
), ),
Padding( Padding(
padding: padding: const EdgeInsets.only(bottom: 15, right: 15, left: 15),
const EdgeInsets.only(bottom: 15, right: 15, left: 15),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.of(context).push(MaterialPageRoute( Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage()));
builder: (context) => PackagesHomePage()));
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -571,13 +487,14 @@ class _HomePageState extends State<HomePage> {
}, },
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: (model.user != null && model.user.outSA == 1)
child: (model.user != null && ? const EdgeInsets.all(0.0)
model.user.outSA == 1) : const EdgeInsets.all(15.0),
child: (model.user != null && model.user.outSA == 1)
? Container( ? Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
color: Colors.grey.withOpacity(0.7), color: Colors.grey.shade500.withOpacity(0.3),
child: Icon( child: Icon(
Icons.lock_outline, Icons.lock_outline,
size: 40, size: 40,
@ -594,14 +511,11 @@ class _HomePageState extends State<HomePage> {
height: 10, height: 10,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).homeHealthCare,
.homeHealthCare,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize: SizeConfig.textMultiplier * 1.55,
SizeConfig.textMultiplier *
1.55,
) )
], ],
)), )),
@ -613,18 +527,17 @@ class _HomePageState extends State<HomePage> {
if (projectViewModel.havePrivilege(65)) if (projectViewModel.havePrivilege(65))
DashboardItem( DashboardItem(
onTap: () => onTap: () =>
(model.user != null && model.user.outSA == 1) (model.user != null && model.user.outSA == 1) ? () {} : getPharmacyToken(model),
? () {}
: getPharmacyToken(model),
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: (model.user != null && model.user.outSA == 1)
child: (model.user != null && ? const EdgeInsets.all(0.0)
model.user.outSA == 1) : const EdgeInsets.all(15.0),
child: (model.user != null && model.user.outSA == 1)
? Container( ? Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
color: Colors.grey.withOpacity(0.7), color: Colors.grey.shade500.withOpacity(0.3),
child: Icon( child: Icon(
Icons.lock_outline, Icons.lock_outline,
size: 40, size: 40,
@ -647,14 +560,11 @@ class _HomePageState extends State<HomePage> {
height: 20, height: 20,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).onlinePharmacy,
.onlinePharmacy,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize: SizeConfig.textMultiplier * 1.55,
SizeConfig.textMultiplier *
1.55,
) )
], ],
), ),
@ -677,13 +587,14 @@ class _HomePageState extends State<HomePage> {
}, },
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: (model.user != null && model.user.outSA == 1)
child: (model.user != null && ? const EdgeInsets.all(0.0)
model.user.outSA == 1) : const EdgeInsets.all(15.0),
child: (model.user != null && model.user.outSA == 1)
? Container( ? Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
color: Colors.grey.withOpacity(0.7), color: Colors.grey.shade500.withOpacity(0.3),
child: Icon( child: Icon(
Icons.lock_outline, Icons.lock_outline,
size: 40, size: 40,
@ -700,14 +611,11 @@ class _HomePageState extends State<HomePage> {
height: 10, height: 10,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).cmcHeading,
.cmcHeading,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize: SizeConfig.textMultiplier * 1.55,
SizeConfig.textMultiplier *
1.55,
) )
], ],
)), )),
@ -723,8 +631,7 @@ class _HomePageState extends State<HomePage> {
height: 8, height: 8,
), ),
InkWell( InkWell(
onTap: () => onTap: () => Navigator.push(context, FadePage(page: PaymentService())),
Navigator.push(context, FadePage(page: PaymentService())),
child: Container( child: Container(
margin: EdgeInsets.only(left: 15, right: 15), margin: EdgeInsets.only(left: 15, right: 15),
child: Row( child: Row(
@ -745,8 +652,7 @@ class _HomePageState extends State<HomePage> {
height: 5, height: 5,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).onlinePaymentService,
.onlinePaymentService,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.black87, color: Colors.black87,
bold: false, bold: false,
@ -777,8 +683,7 @@ class _HomePageState extends State<HomePage> {
height: 10, height: 10,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).offersAndPackages,
.offersAndPackages,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.black87, color: Colors.black87,
bold: false, bold: false,
@ -818,13 +723,11 @@ class _HomePageState extends State<HomePage> {
height: 10, height: 10,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).emergencyServices,
.emergencyServices,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.black87, color: Colors.black87,
bold: false, bold: false,
fontSize: fontSize: SizeConfig.textMultiplier * 1.7,
SizeConfig.textMultiplier * 1.7,
) )
], ],
), ),
@ -862,8 +765,7 @@ class _HomePageState extends State<HomePage> {
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).viewAllHabibMedicalService,
.viewAllHabibMedicalService,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 10, fontSize: 10,
@ -884,15 +786,13 @@ class _HomePageState extends State<HomePage> {
opacity: 0.5, opacity: 0.5,
color: Colors.grey[700], color: Colors.grey[700],
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
onTap: () => Navigator.push( onTap: () => Navigator.push(context, FadePage(page: AllHabibMedicalService())),
context, FadePage(page: AllHabibMedicalService())),
), ),
DashboardItem( DashboardItem(
onTap: () { onTap: () {
// Navigator.push( // Navigator.push(
// context, FadePage(page: FeedbackHomePage())); // context, FadePage(page: FeedbackHomePage()));
Navigator.push( Navigator.push(context, FadePage(page: ContactUsPage()));
context, FadePage(page: ContactUsPage()));
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
@ -1014,10 +914,8 @@ class DashboardItem extends StatelessWidget {
? DecorationImage( ? DecorationImage(
image: ExactAssetImage('assets/images/$imageName'), image: ExactAssetImage('assets/images/$imageName'),
fit: BoxFit.cover, fit: BoxFit.cover,
colorFilter: hasColorFilter colorFilter:
? new ColorFilter.mode( hasColorFilter ? new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn) : null,
Colors.black.withOpacity(0.2), BlendMode.dstIn)
: null,
) )
: null, : null,
), ),

Loading…
Cancel
Save