@ -40,16 +40,14 @@ class HomePage extends StatefulWidget {
}
class _HomePageState extends State < HomePage > {
PharmacyModuleViewModel pharmacyModuleViewModel = locator < PharmacyModuleViewModel > ( ) ;
PharmacyModuleViewModel pharmacyModuleViewModel =
locator < PharmacyModuleViewModel > ( ) ;
@ override
Widget build ( BuildContext context ) {
ProjectViewModel projectViewModel = Provider . of ( context ) ;
return BaseView < DashboardViewModel > (
onModelReady: ( model ) = > ( ) async {
model . getPatientRadOrders ( ) ;
var user = await sharedPref . getObject ( USER_PROFILE ) ;
} ,
onModelReady: ( model ) = > ( ) async { } ,
builder: ( _ , model , wi ) = > AppScaffold (
isShowDecPage: false ,
isHelp: true ,
@ -68,7 +66,9 @@ class _HomePageState extends State<HomePage> {
height: 210 ,
decoration: BoxDecoration (
image: DecorationImage (
image: ExactAssetImage ( ' assets/images/dashboard_top_bg.png ' ) , fit: BoxFit . cover ) ,
image: ExactAssetImage (
' assets/images/dashboard_top_bg.png ' ) ,
fit: BoxFit . cover ) ,
) ,
child: Stack (
children: < Widget > [
@ -77,34 +77,43 @@ class _HomePageState extends State<HomePage> {
left: 5 ,
right: 5 ,
child: Container (
width: MediaQuery . of ( context ) . size . width * 0.8 ,
width:
MediaQuery . of ( context ) . size . width * 0.8 ,
child: Row (
children: < Widget > [
Expanded (
child: Visibility (
visible: model . user . outSA = = 1 ? false : true ,
/ / visible:
/ / model . user . outSA = = 1
/ / ? false
/ / : true ,
child: Container (
height: 125 ,
padding: EdgeInsets . all ( 5 ) ,
margin: EdgeInsets . all ( 5 ) ,
decoration: BoxDecoration (
image: DecorationImage (
image:
AssetImage ( " assets/images/new-design/covid_bg_transparent.png " ) ,
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 ) ) ) ,
color: Colors . white
. withOpacity ( 0.3 ) ,
borderRadius: BorderRadius . all (
Radius . circular ( 5 ) ) ) ,
child: Container (
child: Column (
children: < Widget > [
Texts (
TranslationBase . of ( context ) . covidTest ,
TranslationBase . of ( context )
. covidTest ,
color: Colors . white ,
fontWeight: FontWeight . w700 ,
) ,
Row (
mainAxisAlignment: MainAxisAlignment . spaceAround ,
mainAxisAlignment:
MainAxisAlignment
. spaceAround ,
children: < Widget > [
Container (
margin: EdgeInsets . only (
@ -116,36 +125,64 @@ class _HomePageState extends State<HomePage> {
height: 45.0 ) ,
) ,
Container (
margin: EdgeInsets . only ( top: 5.0 ) ,
margin: EdgeInsets . only (
top: 5.0 ) ,
child: Column (
children: < Widget > [
Texts (
TranslationBase . of ( context ) . driveThru ,
fontWeight: FontWeight . w700 ,
color: Colors . white ,
TranslationBase . of (
context )
. driveThru ,
fontWeight:
FontWeight
. w700 ,
color:
Colors . white ,
) ,
ButtonTheme (
shape: RoundedRectangleBorder (
borderRadius: BorderRadius . circular ( 5.0 ) ,
shape:
RoundedRectangleBorder (
borderRadius:
BorderRadius
. circular (
5.0 ) ,
) ,
minWidth: MediaQuery . of ( context ) . size . width * 0.15 ,
minWidth: MediaQuery . of (
context )
. size
. width *
0.15 ,
height: 25.0 ,
child: RaisedButton (
color: Colors . red [ 800 ] ,
textColor: Colors . white ,
disabledTextColor: Colors . white ,
disabledColor: new Color ( 0xFFbcc2c4 ) ,
child:
RaisedButton (
color: Colors
. red [ 800 ] ,
textColor:
Colors
. white ,
disabledTextColor:
Colors
. white ,
disabledColor:
new Color (
0xFFbcc2c4 ) ,
onPressed: ( ) {
navigateToCovidDriveThru ( ) ;
} ,
child: Center (
child: Center (
child: Center (
child: Center (
child: Texts (
TranslationBase . of ( context ) . bookNow ,
fontWeight: FontWeight . w700 ,
color: Colors . white ,
child:
Center (
child:
Center (
child:
Texts (
TranslationBase . of ( context )
. bookNow ,
fontWeight:
FontWeight . w700 ,
color:
Colors . white ,
) ,
) ,
) ,
@ -166,14 +203,17 @@ class _HomePageState extends State<HomePage> {
) ,
Expanded (
child: InkWell (
onTap: ( ) = > Navigator . push ( context , FadePage ( page: LiveCareHome ( ) ) ) ,
onTap: ( ) = > Navigator . push ( context ,
FadePage ( page: LiveCareHome ( ) ) ) ,
child: Container (
height: 125 ,
padding: EdgeInsets . all ( 15 ) ,
margin: EdgeInsets . all ( 5 ) ,
decoration: BoxDecoration (
color: Colors . white . withOpacity ( 0.3 ) ,
borderRadius: BorderRadius . all ( Radius . circular ( 5 ) ) ) ,
color: Colors . white
. withOpacity ( 0.3 ) ,
borderRadius: BorderRadius . all (
Radius . circular ( 5 ) ) ) ,
child: SvgPicture . asset (
projectViewModel . isArabic
? ' assets/images/new-design/livecare_arabic_logo.svg '
@ -189,15 +229,23 @@ class _HomePageState extends State<HomePage> {
] ,
) ,
) ,
Container ( width: double . infinity , height: projectViewModel . isArabic ? 110 : 80 )
Container (
width: double . infinity ,
height: projectViewModel . isArabic ? 110 : 80 )
] ,
) ,
Positioned (
top: 155 ,
left: MediaQuery . of ( context ) . size . width *
( MediaQuery . of ( context ) . orientation = = Orientation . landscape ? 0.02 : 0.03 ) ,
( MediaQuery . of ( context ) . orientation = =
Orientation . landscape
? 0.02
: 0.03 ) ,
right: MediaQuery . of ( context ) . size . width *
( MediaQuery . of ( context ) . orientation = = Orientation . landscape ? 0.02 : 0.03 ) ,
( MediaQuery . of ( context ) . orientation = =
Orientation . landscape
? 0.02
: 0.03 ) ,
child: ( ! model . isLogin )
? Container (
width: double . infinity ,
@ -205,10 +253,14 @@ class _HomePageState extends State<HomePage> {
decoration: BoxDecoration (
color: HexColor ( ' #A59E9E ' ) ,
shape: BoxShape . rectangle ,
border: Border . all ( color: Colors . transparent , width: 0.5 ) ,
borderRadius: BorderRadius . all ( Radius . circular ( 9 ) ) ,
border: Border . all (
color: Colors . transparent , width: 0.5 ) ,
borderRadius:
BorderRadius . all ( Radius . circular ( 9 ) ) ,
image: DecorationImage (
image: ExactAssetImage ( ' assets/images/bg_graphic.png ' ) , fit: BoxFit . cover ) ) ,
image: ExactAssetImage (
' assets/images/bg_graphic.png ' ) ,
fit: BoxFit . cover ) ) ,
child: Container (
margin: EdgeInsets . all ( 5 ) ,
child: Column (
@ -224,30 +276,37 @@ class _HomePageState extends State<HomePage> {
fontSize: 23 ,
) ,
Texts (
TranslationBase . of ( context ) . myMedicalFileSubTitle ,
TranslationBase . of ( context )
. myMedicalFileSubTitle ,
color: Colors . black ,
fontSize: 16 ,
) ,
Align (
alignment:
projectViewModel . isArabic ? Alignment . bottomLeft : Alignment . bottomRight ,
alignment: projectViewModel . isArabic
? Alignment . bottomLeft
: Alignment . bottomRight ,
child: InkWell (
onTap: ( ) {
widget . goToMyProfile ( ) ;
} ,
child: Container (
margin: EdgeInsets . only ( left: 15 , right: 15 ) ,
margin: EdgeInsets . only (
left: 15 , right: 15 ) ,
width: 90 ,
height: 30 ,
decoration: BoxDecoration (
color: HexColor ( ' #D81A2E ' ) ,
shape: BoxShape . rectangle ,
border: Border . all ( color: Colors . transparent , width: 0.5 ) ,
borderRadius: BorderRadius . all ( Radius . circular ( 0 ) ) ,
border: Border . all (
color: Colors . transparent ,
width: 0.5 ) ,
borderRadius: BorderRadius . all (
Radius . circular ( 0 ) ) ,
) ,
child: Center (
child: Texts (
TranslationBase . of ( context ) . viewMore ,
TranslationBase . of ( context )
. viewMore ,
color: Colors . white ,
fontWeight: FontWeight . w700 ,
fontSize: 12 ,
@ -266,10 +325,14 @@ class _HomePageState extends State<HomePage> {
decoration: BoxDecoration (
color: HexColor ( ' #A59E9E ' ) ,
shape: BoxShape . rectangle ,
border: Border . all ( color: Colors . transparent , width: 0.5 ) ,
borderRadius: BorderRadius . all ( Radius . circular ( 9 ) ) ,
border: Border . all (
color: Colors . transparent , width: 0.5 ) ,
borderRadius:
BorderRadius . all ( Radius . circular ( 9 ) ) ,
image: DecorationImage (
image: ExactAssetImage ( ' assets/images/bg_graphic.png ' ) , fit: BoxFit . cover ) ,
image: ExactAssetImage (
' assets/images/bg_graphic.png ' ) ,
fit: BoxFit . cover ) ,
) ,
child: Container (
margin: EdgeInsets . all ( 5 ) ,
@ -277,51 +340,81 @@ class _HomePageState extends State<HomePage> {
children: < Widget > [
Row (
children: < Widget > [
if ( projectViewModel . user ! = null & & model . isLogin )
if ( projectViewModel . user ! = null & &
model . isLogin )
Expanded (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment:
CrossAxisAlignment . start ,
children: < Widget > [
SizedBox (
height: 8 ,
) ,
model . user . cRSVerificationStatus = = 2
model . user . cRSVerificationStatus = =
2
? Row (
children: [
Texts (
model . user . firstName + " " + model . user . lastName ,
color: Colors . grey [ 100 ] ,
model . user
. firstName +
" " +
model . user
. lastName ,
color: Colors
. grey [ 100 ] ,
bold: true ,
fontSize: 15 ,
) ,
Container (
margin: EdgeInsets . fromLTRB ( 8.0 , 0.0 , 8.0 , 0.0 ) ,
margin: EdgeInsets
. fromLTRB (
8.0 ,
0.0 ,
8.0 ,
0.0 ) ,
child: SvgPicture . asset (
" assets/images/new-design/verification_check.svg " ) ,
) ,
] ,
)
: model . user . cRSVerificationStatus = = 3
: model . user . cRSVerificationStatus = =
3
? Row (
children: [
Texts (
model . user . firstName + " " + model . user . lastName ,
color: Colors . grey [ 100 ] ,
model . user
. firstName +
" " +
model . user
. lastName ,
color: Colors
. grey [ 100 ] ,
bold: true ,
fontSize: 15 ,
) ,
Container (
margin: EdgeInsets . fromLTRB ( 8.0 , 0.0 , 8.0 , 0.0 ) ,
child: SvgPicture . asset (
" assets/images/new-design/pending.svg " ) ,
margin: EdgeInsets
. fromLTRB (
8.0 ,
0.0 ,
8.0 ,
0.0 ) ,
child: SvgPicture
. asset (
" assets/images/new-design/pending.svg " ) ,
) ,
] ,
)
: Row (
children: [
Texts (
model . user . firstName + " " + model . user . lastName ,
color: Colors . grey [ 100 ] ,
model . user
. firstName +
" " +
model . user
. lastName ,
color: Colors
. grey [ 100 ] ,
bold: true ,
fontSize: 15 ,
) ,
@ -355,14 +448,17 @@ class _HomePageState extends State<HomePage> {
decoration: BoxDecoration (
color: HexColor ( ' #D81A2E ' ) ,
shape: BoxShape . rectangle ,
border: Border . all ( color: Colors . transparent , width: 0.5 ) ,
border: Border . all (
color: Colors . transparent ,
width: 0.5 ) ,
borderRadius: BorderRadius . all (
Radius . circular ( 5 ) ,
) ,
) ,
child: Center (
child: Texts (
TranslationBase . of ( context ) . myMedicalFile ,
TranslationBase . of ( context )
. myMedicalFile ,
color: Colors . white ,
fontSize: 12 ,
textAlign: TextAlign . center ,
@ -401,8 +497,10 @@ class _HomePageState extends State<HomePage> {
width: 25 ,
height: 40 ,
) ,
Texts ( ' ${ model . weightKg } ${ TranslationBase . of ( context ) . kg } ' ,
color: Colors . white , fontSize: 17 )
Texts (
' ${ model . weightKg } ${ TranslationBase . of ( context ) . kg } ' ,
color: Colors . white ,
fontSize: 17 )
] ,
) ,
) ,
@ -417,7 +515,9 @@ class _HomePageState extends State<HomePage> {
width: 35 ,
height: 40 ,
) ,
Texts ( ' ${ model . booldType } ' , color: Colors . white , fontSize: 17 )
Texts ( ' ${ model . booldType } ' ,
color: Colors . white ,
fontSize: 17 )
] ,
) ,
) ,
@ -431,10 +531,12 @@ class _HomePageState extends State<HomePage> {
] ,
) ,
Padding (
padding: const EdgeInsets . only ( bottom: 15 , right: 15 , left: 15 ) ,
padding:
const EdgeInsets . only ( bottom: 15 , right: 15 , left: 15 ) ,
child: InkWell (
onTap: ( ) {
Navigator . of ( context ) . push ( MaterialPageRoute ( builder: ( context ) = > PackagesHomePage ( ) ) ) ;
Navigator . of ( context ) . push ( MaterialPageRoute (
builder: ( context ) = > PackagesHomePage ( ) ) ) ;
} ,
child: Container (
decoration: BoxDecoration (
@ -462,126 +564,132 @@ class _HomePageState extends State<HomePage> {
if ( projectViewModel . havePrivilege ( 64 ) | |
projectViewModel . havePrivilege ( 65 ) | |
projectViewModel . havePrivilege ( 67 ) )
if ( model . user . outSA = = 0 )
Container (
margin: EdgeInsets . only ( left: 15 , right: 15 ) ,
child: Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: < Widget > [
if ( projectViewModel . havePrivilege ( 64 ) )
DashboardItem (
onTap: ( ) {
Navigator . push (
context ,
FadePage (
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 ,
fontWeight: FontWeight . w700 ,
fontSize: SizeConfig . textMultiplier * 1.55 ,
)
] ,
) ,
/ / if ( model . user . outSA = = 0 )
Container (
margin: EdgeInsets . only ( left: 15 , right: 15 ) ,
child: Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: < Widget > [
if ( projectViewModel . havePrivilege ( 64 ) )
DashboardItem (
onTap: ( ) {
Navigator . push (
context ,
FadePage (
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 ,
fontWeight: FontWeight . w700 ,
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 ) ,
child: Column (
children: < Widget > [
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 ,
)
] ,
) ,
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 ) ,
child: Column (
children: < Widget > [
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 ,
)
] ,
) ,
) ,
height: MediaQuery . of ( context ) . size . width * 0.4 ,
imageName: ' al-habib_onlne_pharmacy_bg.png ' ,
) ,
if ( projectViewModel . havePrivilege ( 67 ) )
DashboardItem (
onTap: ( ) {
Navigator . push (
context ,
FadePage (
page: CMCPage ( ) ,
) ,
) ;
} ,
child: Center (
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 ,
fontWeight: FontWeight . w700 ,
fontSize: SizeConfig . textMultiplier * 1.55 ,
)
] ,
) ,
height: MediaQuery . of ( context ) . size . width * 0.4 ,
imageName: ' al-habib_onlne_pharmacy_bg.png ' ,
) ,
if ( projectViewModel . havePrivilege ( 67 ) )
DashboardItem (
onTap: ( ) {
Navigator . push (
context ,
FadePage (
page: CMCPage ( ) ,
) ,
) ;
} ,
child: Center (
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 ,
fontWeight: FontWeight . w700 ,
fontSize:
SizeConfig . textMultiplier * 1.55 ,
)
] ,
) ,
) ,
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 (
height: 8 ,
) ,
InkWell (
onTap: ( ) = > Navigator . push ( context , FadePage ( page: PaymentService ( ) ) ) ,
onTap: ( ) = >
Navigator . push ( context , FadePage ( page: PaymentService ( ) ) ) ,
child: Container (
margin: EdgeInsets . only ( left: 15 , right: 15 ) ,
child: Row (
@ -602,7 +710,8 @@ class _HomePageState extends State<HomePage> {
height: 5 ,
) ,
Texts (
TranslationBase . of ( context ) . onlinePaymentService ,
TranslationBase . of ( context )
. onlinePaymentService ,
textAlign: TextAlign . center ,
color: Colors . black87 ,
bold: false ,
@ -633,7 +742,8 @@ class _HomePageState extends State<HomePage> {
height: 10 ,
) ,
Texts (
TranslationBase . of ( context ) . offersAndPackages ,
TranslationBase . of ( context )
. offersAndPackages ,
textAlign: TextAlign . center ,
color: Colors . black87 ,
bold: false ,
@ -673,11 +783,13 @@ class _HomePageState extends State<HomePage> {
height: 10 ,
) ,
Texts (
TranslationBase . of ( context ) . emergencyServices ,
TranslationBase . of ( context )
. emergencyServices ,
textAlign: TextAlign . center ,
color: Colors . black87 ,
bold: false ,
fontSize: SizeConfig . textMultiplier * 1.7 ,
fontSize:
SizeConfig . textMultiplier * 1.7 ,
)
] ,
) ,
@ -715,7 +827,8 @@ class _HomePageState extends State<HomePage> {
fontWeight: FontWeight . normal ,
) ,
Texts (
TranslationBase . of ( context ) . viewAllHabibMedicalService ,
TranslationBase . of ( context )
. viewAllHabibMedicalService ,
color: Colors . white ,
fontWeight: FontWeight . normal ,
fontSize: 10 ,
@ -736,13 +849,15 @@ class _HomePageState extends State<HomePage> {
opacity: 0.5 ,
color: Colors . grey [ 700 ] ,
width: MediaQuery . of ( context ) . size . width * 0.45 ,
onTap: ( ) = > Navigator . push ( context , FadePage ( page: AllHabibMedicalService ( ) ) ) ,
onTap: ( ) = > Navigator . push (
context , FadePage ( page: AllHabibMedicalService ( ) ) ) ,
) ,
DashboardItem (
onTap: ( ) {
/ / Navigator . push (
/ / context , FadePage ( page: FeedbackHomePage ( ) ) ) ;
Navigator . push ( context , FadePage ( page: ContactUsPage ( ) ) ) ;
Navigator . push (
context , FadePage ( page: ContactUsPage ( ) ) ) ;
} ,
child: Container (
width: double . infinity ,
@ -864,8 +979,10 @@ class DashboardItem extends StatelessWidget {
? DecorationImage (
image: ExactAssetImage ( ' assets/images/ $ imageName ' ) ,
fit: BoxFit . cover ,
colorFilter:
hasColorFilter ? new ColorFilter . mode ( Colors . black . withOpacity ( 0.2 ) , BlendMode . dstIn ) : null ,
colorFilter: hasColorFilter
? new ColorFilter . mode (
Colors . black . withOpacity ( 0.2 ) , BlendMode . dstIn )
: null ,
)
: null ,
) ,