diff --git a/assets/images/bn_offer.png b/assets/images/bn_offer.png new file mode 100644 index 00000000..7eca85cb Binary files /dev/null and b/assets/images/bn_offer.png differ diff --git a/assets/images/bn_offer.svg b/assets/images/bn_offer.svg new file mode 100644 index 00000000..9bbcbadf --- /dev/null +++ b/assets/images/bn_offer.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Kid’s Offer + Take care of your children’s teeth + Only 500 SAR + + + + + + + + + + + + diff --git a/assets/images/new/Boo_ Appointment.svg b/assets/images/new/Boo_ Appointment.svg new file mode 100644 index 00000000..c25652c3 --- /dev/null +++ b/assets/images/new/Boo_ Appointment.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/images/new/Bottom Nav/Family Files.svg b/assets/images/new/Bottom Nav/Family Files.svg new file mode 100644 index 00000000..ce47d959 --- /dev/null +++ b/assets/images/new/Bottom Nav/Family Files.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/new/Bottom Nav/Help.svg b/assets/images/new/Bottom Nav/Help.svg new file mode 100644 index 00000000..31d49e71 --- /dev/null +++ b/assets/images/new/Bottom Nav/Help.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/new/Bottom Nav/Home.svg b/assets/images/new/Bottom Nav/Home.svg new file mode 100644 index 00000000..b363bbc0 --- /dev/null +++ b/assets/images/new/Bottom Nav/Home.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/new/Bottom Nav/My File.svg b/assets/images/new/Bottom Nav/My File.svg new file mode 100644 index 00000000..fc5c0096 --- /dev/null +++ b/assets/images/new/Bottom Nav/My File.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/new/Bottom Nav/Todo.svg b/assets/images/new/Bottom Nav/Todo.svg new file mode 100644 index 00000000..98232af9 --- /dev/null +++ b/assets/images/new/Bottom Nav/Todo.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/new/E_Refferal.svg b/assets/images/new/E_Refferal.svg new file mode 100644 index 00000000..bbbfc2b5 --- /dev/null +++ b/assets/images/new/E_Refferal.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/new/HHC.svg b/assets/images/new/HHC.svg new file mode 100644 index 00000000..5c0aacd1 --- /dev/null +++ b/assets/images/new/HHC.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/new/Live_Care.svg b/assets/images/new/Live_Care.svg new file mode 100644 index 00000000..84349a70 --- /dev/null +++ b/assets/images/new/Live_Care.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/new/My Services/Appointment list.svg b/assets/images/new/My Services/Appointment list.svg new file mode 100644 index 00000000..40f61dea --- /dev/null +++ b/assets/images/new/My Services/Appointment list.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/new/My Services/Vital Signs.svg b/assets/images/new/My Services/Vital Signs.svg new file mode 100644 index 00000000..fe476c3c --- /dev/null +++ b/assets/images/new/My Services/Vital Signs.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/new/My Services/active medication.svg b/assets/images/new/My Services/active medication.svg new file mode 100644 index 00000000..aa6eeaea --- /dev/null +++ b/assets/images/new/My Services/active medication.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/new/My Services/lab result.svg b/assets/images/new/My Services/lab result.svg new file mode 100644 index 00000000..e8507595 --- /dev/null +++ b/assets/images/new/My Services/lab result.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/images/new/My Services/medicine prescription.svg b/assets/images/new/My Services/medicine prescription.svg new file mode 100644 index 00000000..21cadf7c --- /dev/null +++ b/assets/images/new/My Services/medicine prescription.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/new/My Services/radiology.svg b/assets/images/new/My Services/radiology.svg new file mode 100644 index 00000000..8f1d8a46 --- /dev/null +++ b/assets/images/new/My Services/radiology.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/new/Nav_Icon.svg b/assets/images/new/Nav_Icon.svg new file mode 100644 index 00000000..6808f518 --- /dev/null +++ b/assets/images/new/Nav_Icon.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/Pharmacy.svg b/assets/images/new/Pharmacy.svg new file mode 100644 index 00000000..bdb101e5 --- /dev/null +++ b/assets/images/new/Pharmacy.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/new/RRT.svg b/assets/images/new/RRT.svg new file mode 100644 index 00000000..d29abf81 --- /dev/null +++ b/assets/images/new/RRT.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/new/Verify_face.svg b/assets/images/new/Verify_face.svg new file mode 100644 index 00000000..7969cad2 --- /dev/null +++ b/assets/images/new/Verify_face.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/new/comprehensive_checkup.svg b/assets/images/new/comprehensive_checkup.svg new file mode 100644 index 00000000..a22c960c --- /dev/null +++ b/assets/images/new/comprehensive_checkup.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/new/covid_test_drive_thru.svg b/assets/images/new/covid_test_drive_thru.svg new file mode 100644 index 00000000..09de0045 --- /dev/null +++ b/assets/images/new/covid_test_drive_thru.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/images/new/forward_arrow.svg b/assets/images/new/forward_arrow.svg new file mode 100644 index 00000000..3142c248 --- /dev/null +++ b/assets/images/new/forward_arrow.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/new/remind_me.svg b/assets/images/new/remind_me.svg new file mode 100644 index 00000000..1e5b27a8 --- /dev/null +++ b/assets/images/new/remind_me.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/new/verified_check.svg b/assets/images/new/verified_check.svg new file mode 100644 index 00000000..73916330 --- /dev/null +++ b/assets/images/new/verified_check.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/new/verify_sms.svg b/assets/images/new/verify_sms.svg new file mode 100644 index 00000000..ae5fa9f7 --- /dev/null +++ b/assets/images/new/verify_sms.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/images/new/verify_thumb.svg b/assets/images/new/verify_thumb.svg new file mode 100644 index 00000000..e626bafc --- /dev/null +++ b/assets/images/new/verify_thumb.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/images/new/verify_whatsapp.svg b/assets/images/new/verify_whatsapp.svg new file mode 100644 index 00000000..09ac85c9 --- /dev/null +++ b/assets/images/new/verify_whatsapp.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/lib/models/gradient_color.dart b/lib/models/gradient_color.dart new file mode 100644 index 00000000..d2a32e8d --- /dev/null +++ b/lib/models/gradient_color.dart @@ -0,0 +1,35 @@ +import 'package:flutter/material.dart'; + +class GradientColor { + Color darkColor; + Color lightColor; + + GradientColor(this.darkColor, this.lightColor); +} + +List bannerColor = [ + new GradientColor(Color(0xFFF2B353E), Color(0xFFF71787E)), + new GradientColor(Color(0xFFFD02127), Color(0xFFFEE6161)), + new GradientColor(Colors.blue[700], Colors.blue[400]), + new GradientColor(Colors.yellow[700], Colors.yellow), + new GradientColor(Colors.orange[800], Colors.orange), + new GradientColor(Colors.green[800], Colors.green[500]), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), + new GradientColor(Colors.brown[700], Colors.brown), +]; diff --git a/lib/models/hmg_services.dart b/lib/models/hmg_services.dart new file mode 100644 index 00000000..c4163bd4 --- /dev/null +++ b/lib/models/hmg_services.dart @@ -0,0 +1,9 @@ +class HmgServices { + int action; + String title; + String subTitle; + String icon; + bool isLogin; + + HmgServices(this.action, this.title, this.subTitle, this.icon,this.isLogin); +} diff --git a/lib/models/slider_data.dart b/lib/models/slider_data.dart new file mode 100644 index 00000000..6d72fc4f --- /dev/null +++ b/lib/models/slider_data.dart @@ -0,0 +1,11 @@ +import 'package:flutter/material.dart'; + +class SliderData{ + String pateintId; + String pateintName; + String dof; + Color darkColor; + Color lightColor; + + SliderData(this.pateintId, this.pateintName, this.dof,this.darkColor,this.lightColor); +} \ No newline at end of file diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 51692461..d5229161 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -37,8 +37,7 @@ class HomePage extends StatefulWidget { } class _HomePageState extends State { - PharmacyModuleViewModel pharmacyModuleViewModel = - locator(); + PharmacyModuleViewModel pharmacyModuleViewModel = locator(); @override Widget build(BuildContext context) { @@ -62,10 +61,7 @@ class _HomePageState extends State { width: double.infinity, height: 210, decoration: BoxDecoration( - image: DecorationImage( - image: ExactAssetImage( - 'assets/images/dashboard_top_bg.png'), - fit: BoxFit.cover), + image: DecorationImage(image: ExactAssetImage('assets/images/dashboard_top_bg.png'), fit: BoxFit.cover), ), child: Stack( children: [ @@ -74,8 +70,7 @@ class _HomePageState extends State { 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: [ Expanded( @@ -85,74 +80,48 @@ class _HomePageState extends State { 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: [ Texts( - TranslationBase.of(context) - .covidTest, + TranslationBase.of(context).covidTest, color: Colors.white, fontWeight: FontWeight.w700, ), Row( - mainAxisAlignment: - MainAxisAlignment - .spaceAround, + mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Container( margin: EdgeInsets.only( top: 15.0, ), - child: SvgPicture.asset( - 'assets/images/new-design/covid-19-car.svg', - width: 45.0, - height: 45.0), + child: SvgPicture.asset('assets/images/new-design/covid-19-car.svg', width: 45.0, height: 45.0), ), Container( - margin: EdgeInsets.only( - top: 5.0), + margin: EdgeInsets.only(top: 5.0), child: Column( children: [ Texts( - TranslationBase.of( - context) - .driveThru, - fontWeight: - FontWeight.w700, + 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), + color: Colors.red[800], + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), onPressed: () { navigateToCovidDriveThru(); }, @@ -161,14 +130,9 @@ class _HomePageState extends State { child: Center( child: Center( child: Texts( - TranslationBase.of( - context) - .bookNow, - fontWeight: - FontWeight - .w700, - color: Colors - .white, + TranslationBase.of(context).bookNow, + fontWeight: FontWeight.w700, + color: Colors.white, ), ), ), @@ -188,21 +152,14 @@ class _HomePageState extends State { ), 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))), + decoration: BoxDecoration(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' - : 'assets/images/new-design/liveCare_white_logo.svg', + projectViewModel.isArabic ? 'assets/images/new-design/livecare_arabic_logo.svg' : 'assets/images/new-design/liveCare_white_logo.svg', ), ), ), @@ -214,23 +171,13 @@ class _HomePageState extends State { ], ), ), - 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), - right: MediaQuery.of(context).size.width * - (MediaQuery.of(context).orientation == - Orientation.landscape - ? 0.02 - : 0.03), + left: MediaQuery.of(context).size.width * (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), child: (!model.isLogin) ? Container( width: double.infinity, @@ -238,14 +185,9 @@ class _HomePageState extends State { decoration: BoxDecoration( color: HexColor('#A59E9E'), shape: BoxShape.rectangle, - 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)), + 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)), child: Container( margin: EdgeInsets.all(5), child: Column( @@ -261,37 +203,29 @@ class _HomePageState extends State { 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, @@ -310,14 +244,9 @@ class _HomePageState extends State { decoration: BoxDecoration( color: HexColor('#A59E9E'), shape: BoxShape.rectangle, - 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), + 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), ), child: Container( margin: EdgeInsets.all(5), @@ -325,12 +254,10 @@ class _HomePageState extends State { children: [ Row( children: [ - if (projectViewModel.user != null && - model.isLogin) + if (projectViewModel.user != null && model.isLogin) Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 8, @@ -338,22 +265,14 @@ class _HomePageState extends State { Row( children: [ Texts( - model.user.firstName + - " " + - model.user.lastName, + 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/verification_check.svg"), + margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0), + child: SvgPicture.asset("assets/images/new-design/verification_check.svg"), ), ], ), @@ -385,17 +304,14 @@ class _HomePageState extends State { 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, @@ -434,9 +350,7 @@ class _HomePageState extends State { width: 25, height: 40, ), - Texts('${model.weightKg}', - color: Colors.white, - fontSize: 17) + Texts('${model.weightKg}', color: Colors.white, fontSize: 17) ], ), ), @@ -445,8 +359,7 @@ class _HomePageState extends State { ), Expanded( child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Image.asset( 'assets/images/blood_icon.png', @@ -470,12 +383,10 @@ class _HomePageState extends State { ], ), 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( @@ -500,9 +411,7 @@ class _HomePageState extends State { ), ), ), - if (projectViewModel.havePrivilege(64) || - projectViewModel.havePrivilege(65) || - projectViewModel.havePrivilege(67)) + if (projectViewModel.havePrivilege(64) || projectViewModel.havePrivilege(65) || projectViewModel.havePrivilege(67)) Container( margin: EdgeInsets.only(left: 15, right: 15), child: Row( @@ -532,13 +441,11 @@ class _HomePageState extends State { height: 10, ), Texts( - TranslationBase.of(context) - .homeHealthCare, + TranslationBase.of(context).homeHealthCare, textAlign: TextAlign.center, color: Colors.white, fontWeight: FontWeight.w700, - fontSize: - SizeConfig.textMultiplier * 1.55, + fontSize: SizeConfig.textMultiplier * 1.55, ) ], ), @@ -565,13 +472,11 @@ class _HomePageState extends State { height: 20, ), Texts( - TranslationBase.of(context) - .onlinePharmacy, + TranslationBase.of(context).onlinePharmacy, textAlign: TextAlign.center, color: Colors.white, fontWeight: FontWeight.w700, - fontSize: - SizeConfig.textMultiplier * 1.55, + fontSize: SizeConfig.textMultiplier * 1.55, ) ], ), @@ -608,8 +513,7 @@ class _HomePageState extends State { textAlign: TextAlign.center, color: Colors.white, fontWeight: FontWeight.w700, - fontSize: - SizeConfig.textMultiplier * 1.55, + fontSize: SizeConfig.textMultiplier * 1.55, ) ], ), @@ -626,8 +530,7 @@ class _HomePageState extends State { 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( @@ -648,8 +551,7 @@ class _HomePageState extends State { height: 5, ), Texts( - TranslationBase.of(context) - .onlinePaymentService, + TranslationBase.of(context).onlinePaymentService, textAlign: TextAlign.center, color: Colors.black87, bold: false, @@ -680,8 +582,7 @@ class _HomePageState extends State { height: 10, ), Texts( - TranslationBase.of(context) - .offersAndPackages, + TranslationBase.of(context).offersAndPackages, textAlign: TextAlign.center, color: Colors.black87, bold: false, @@ -721,13 +622,11 @@ class _HomePageState extends State { 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, ) ], ), @@ -765,8 +664,7 @@ class _HomePageState extends State { fontWeight: FontWeight.normal, ), Texts( - TranslationBase.of(context) - .viewAllHabibMedicalService, + TranslationBase.of(context).viewAllHabibMedicalService, color: Colors.white, fontWeight: FontWeight.normal, fontSize: 10, @@ -787,15 +685,13 @@ class _HomePageState extends State { 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, @@ -870,17 +766,7 @@ class _HomePageState extends State { } class DashboardItem extends StatelessWidget { - const DashboardItem( - {this.hasBorder = false, - this.imageName, - @required this.child, - this.onTap, - Key key, - this.width, - this.height, - this.color, - this.opacity = 0.4, - this.hasColorFilter = true}) + const DashboardItem({this.hasBorder = false, this.imageName, @required this.child, this.onTap, Key key, this.width, this.height, this.color, this.opacity = 0.4, this.hasColorFilter = true}) : super(key: key); final bool hasBorder; final String imageName; @@ -910,17 +796,12 @@ class DashboardItem extends StatelessWidget { : HexColor('#050705').withOpacity(opacity) : Colors.white, borderRadius: BorderRadius.circular(6.0), - border: hasBorder - ? Border.all(width: 1.0, color: const Color(0xffcccccc)) - : Border.all(width: 0.0, color: Colors.transparent), + border: hasBorder ? Border.all(width: 1.0, color: const Color(0xffcccccc)) : Border.all(width: 0.0, color: Colors.transparent), image: imageName != null ? 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, ), diff --git a/lib/pages/landing/home_page_2.dart b/lib/pages/landing/home_page_2.dart new file mode 100644 index 00000000..34398b56 --- /dev/null +++ b/lib/pages/landing/home_page_2.dart @@ -0,0 +1,338 @@ +import 'package:carousel_slider/carousel_slider.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/models/gradient_color.dart'; +import 'package:diplomaticquarterapp/models/hmg_services.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; +import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart'; +import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; +import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/landing/widgets/logged_slider_view.dart'; +import 'package:diplomaticquarterapp/pages/landing/widgets/offer_view.dart'; +import 'package:diplomaticquarterapp/pages/landing/widgets/pharmacy_view.dart'; +import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart'; +import 'package:diplomaticquarterapp/pages/landing/widgets/slider_view.dart'; +import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; +import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackagesPage.dart'; +import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart' as s; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'landing_page_pharmcy.dart'; +import 'package:diplomaticquarterapp/models/slider_data.dart'; + +class HomePage2 extends StatefulWidget { + final Function goToMyProfile; + + HomePage2({Key key, this.goToMyProfile}); + + @override + _HomePageState2 createState() => _HomePageState2(); +} + +class _HomePageState2 extends State { + PharmacyModuleViewModel pharmacyModuleViewModel = locator(); + ProjectViewModel projectViewModel; + var familyFileProvider = FamilyFilesProvider(); + List hmgServices = []; + + @override + void initState() { + // TODO: implement initState + super.initState(); + initialiseHmgServices(false); + // getFamilyFiles(); + } + + initialiseHmgServices(bool isLogin) { + hmgServices.add(new HmgServices(0, "LiveCare ", "Online Consulting", "assets/images/new/Live_Care.svg", isLogin)); + hmgServices.add(new HmgServices(1, "Covid Test", "Drive-Thru", "assets/images/new/covid_test_drive_thru.svg", isLogin)); + hmgServices.add(new HmgServices(2, "Checkup", "Comprehensive", "assets/images/new/comprehensive_checkup.svg", isLogin)); + hmgServices.add(new HmgServices(3, "HHC Home", "Health Care", "assets/images/new/HHC.svg", isLogin)); + hmgServices.add(new HmgServices(4, "E-Refferal", "Services", "assets/images/new/E_Refferal.svg", isLogin)); + hmgServices.add(new HmgServices(5, "RRT", "Emergency", "assets/images/new/RRT.svg", isLogin)); + } + + Future getFamilyFiles() async { + if (projectViewModel.user != null) { + print("calling_family"); + + if (await s.sharedPref.getObject(FAMILY_FILE) != null) { + // print(await sharedPref.getObject(FAMILY_FILE)); + return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(await s.sharedPref.getObject(FAMILY_FILE))); + } else { + return familyFileProvider.getSharedRecordByStatus(); + } + } + } + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getPatientRadOrders(), + builder: (_, model, wi) => Container( + color: Color(0xFFFF7F7F7), + child: SingleChildScrollView( + child: Column( + children: [ + !model.isLogin + ? AspectRatio( + aspectRatio: 2, + child: Container( + margin: EdgeInsets.all(14), + child: SliderView(), + // height: MediaQuery.of(context).size.width / 2.6, + ), + ) + : FutureBuilder( + future: getFamilyFiles(), // async work + builder: (BuildContext context, AsyncSnapshot snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return Padding(padding: EdgeInsets.all(10), child: Text('')); + default: + if (snapshot.hasError) + return Padding(padding: EdgeInsets.all(10), child: Text(snapshot.error)); + else { + List sliderData = []; + sliderData.add(new SliderData(TranslationBase.of(context).fileno + ": " + projectViewModel.user.patientID.toString(), + projectViewModel.user.firstName + ' ' + projectViewModel.user.lastName, "", bannerColor[0].darkColor, bannerColor[0].lightColor)); + for (int i = 0; i < snapshot.data.getAllSharedRecordsByStatusList.length; i++) { + if (snapshot.data.getAllSharedRecordsByStatusList[i].status == 3) + sliderData.add(new SliderData(TranslationBase.of(context).fileno + ": " + snapshot.data.getAllSharedRecordsByStatusList[i].responseID.toString(), + snapshot.data.getAllSharedRecordsByStatusList[i].patientName, "", bannerColor[i + 1].darkColor, bannerColor[i + 1].lightColor)); + } + + return CarouselSlider( + options: CarouselOptions( + autoPlay: false, + enlargeCenterPage: true, + initialPage: 0, + aspectRatio: 2.5, + viewportFraction: 0.9, + enableInfiniteScroll: false, + onPageChanged: (index, reason) { + print("onPageChanged"); + }), + items: [ + for (int i = 0; i < sliderData.length; i++) + Builder( + builder: (BuildContext context) { + return LoggedSliderView(sliderData[i]); + }, + ) + ], + ); + } + } + }, + ), + // CarouselSlider( + // options: CarouselOptions( + // autoPlay: false, + // enlargeCenterPage: true, + // initialPage: 0, + // aspectRatio: 2.5, + // viewportFraction: 0.9, + // enableInfiniteScroll: false, + // onPageChanged: (index, reason) { + // print("onPageChanged"); + // }), + // items: [ + // for (int i = 0; i < bannerColor.length; i++) + // Builder( + // builder: (BuildContext context) { + // return LoggedSliderView(bannerColor[i].darkColor, bannerColor[i].lightColor); + // }, + // ) + // ], + // ), + model.isLogin + ? FutureBuilder( + future: getFamilyFiles(), // async work + builder: (BuildContext context, AsyncSnapshot snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return Padding(padding: EdgeInsets.all(10), child: Text('')); + default: + if (snapshot.hasError) + return Padding(padding: EdgeInsets.all(10), child: Text(snapshot.error)); + else + return Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + // <--- left side + color: Colors.grey[200], + width: 1.0, + ), + )), + child: Column( + children: [ + // projectViewModel.user.isFamily == true + // ? + Container( + padding: EdgeInsets.only(bottom: 5), + child: InkWell( + onTap: () { + // switchUser( + // mainUser, + // context); + }, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Icon(Icons.person), + ), + Expanded( + flex: 7, + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + AppText(projectViewModel.user.firstName + ' ' + projectViewModel.user.lastName, color: Theme.of(context).textTheme.bodyText1.color), + AppText( + TranslationBase.of(context).fileno + ": " + projectViewModel.user.patientID.toString(), + color: Theme.of(context).textTheme.bodyText1.color, + ), + ])), + ], + ))), + // : SizedBox(), + Column( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: snapshot.data.getAllSharedRecordsByStatusList.map((result) { + return result.status == 3 + ? Container( + padding: EdgeInsets.only(bottom: 5), + child: InkWell( + onTap: () { + // switchUser(result, + // context); + }, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Icon(Icons.person, color: result.responseID == model.user.patientID ? Color(0xFF40ACC9) : Colors.black), + ), + Expanded( + flex: 7, + child: Padding( + padding: EdgeInsets.only(left: 5, right: 5), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + AppText(result.patientName, color: result.responseID == model.user.patientID ? Color(0xFF40ACC9) : Colors.black), + AppText(TranslationBase.of(context).fileno + ": " + result.responseID.toString(), + color: result.responseID == projectViewModel.user.patientID ? Color(0xFF40ACC9) : Colors.black), + ]))), + ], + ))) + : SizedBox(); + }).toList()) + ], + )); + } + }, + ) + : Container(), + Padding( + padding: const EdgeInsets.only(left: 20, right: 20), + child: Image.asset("assets/images/bn_offer.png"), + ), + mHeight(20), + Padding( + padding: const EdgeInsets.only(left:20,right: 20,top: 20,), + child: Column( + children: [ + Row( + children: [ + Expanded( + child: Text( + "HMG Services", + style: TextStyle( + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + ), + Text( + "View All Services", + style: TextStyle( + color: CustomColors.accentColor, + fontSize: 14, + ), + ), + ], + ), + mHeight(20), + GridView.builder( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3,childAspectRatio: 2/2 ,crossAxisSpacing: 12,mainAxisSpacing: 12), + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: hmgServices.length, + padding: EdgeInsets.zero, + itemBuilder: (BuildContext context, int index) { + return ServicesView(hmgServices[index]); + } + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.only(left:20,right: 20,top: 20,), + child: PharmacyView(), + ), + mHeight(140), + ], + ), + ), + ), + ); + } + + getPharmacyToken(DashboardViewModel model) async { + if (!model.isLogin) { + Navigator.push(context, FadePage(page: LandingPagePharmacy())); + } else { + GifLoaderDialogUtils.showMyDialog(context); + await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { + if (pharmacyModuleViewModel.error.isNotEmpty) { + await pharmacyModuleViewModel.createUser().then((value) { + GifLoaderDialogUtils.hideDialog(context); + Navigator.push(context, FadePage(page: LandingPagePharmacy())); + }); + } else { + GifLoaderDialogUtils.hideDialog(context); + Navigator.push(context, FadePage(page: LandingPagePharmacy())); + } + }); + } + } + + navigateToCovidDriveThru() { + Navigator.push(context, FadePage(page: CovidDrivethruLocation())); + } +} diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index c55b685b..2487e12d 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -12,11 +12,13 @@ import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; +import 'package:diplomaticquarterapp/pages/landing/home_page_2.dart'; import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' as family; + import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; import 'package:diplomaticquarterapp/uitl/HMGNetworkConnectivity.dart'; @@ -105,6 +107,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { print(route.settings.name); } + + //setState(() { print("didChangeAppLifecycleState"); print('state = $state'); @@ -187,6 +191,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { if (results[Permission.accessMediaLocation].isGranted) ; // if (results[Permission.calendar].isGranted) ; }); + + requestPermissions(); // }); // @@ -307,6 +313,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { // ); } + + showDialogs(String message) { ConfirmDialog dialog = new ConfirmDialog( context: context, @@ -541,7 +549,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { physics: NeverScrollableScrollPhysics(), controller: pageController, children: [ - HomePage( + HomePage2( goToMyProfile: () { _changeCurrentTab(1); }, diff --git a/lib/pages/landing/widgets/logged_slider_view.dart b/lib/pages/landing/widgets/logged_slider_view.dart new file mode 100644 index 00000000..24b0dfe5 --- /dev/null +++ b/lib/pages/landing/widgets/logged_slider_view.dart @@ -0,0 +1,110 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; +import 'package:diplomaticquarterapp/models/slider_data.dart'; + +class LoggedSliderView extends StatelessWidget { + SliderData sliderData; + + LoggedSliderView(this.sliderData); + + @override + Widget build(BuildContext context) { + return Card( + shape: cardRadius(20), + elevation: 3, + margin: EdgeInsets.all(6), + child: Card( + shape: cardRadius(20), + clipBehavior: Clip.antiAlias, + margin: EdgeInsets.zero, + color: sliderData.darkColor, + elevation: 0, + // padding: EdgeInsets.zero, + child: Stack( + children: [ + Card( + child: Container( + width: double.infinity, + height: double.infinity, + ), + color: Colors.transparent, + margin: EdgeInsets.zero, + elevation: 8, + ), + Container( + width: double.infinity, + height: double.infinity, + clipBehavior: Clip.antiAlias, + margin: EdgeInsets.zero, + decoration: containerBottomRightRadiusWithGradient(MediaQuery.of(context).size.width / 4, darkColor: sliderData.darkColor, lightColor: sliderData.lightColor), + child: Card( + color: Colors.transparent, + margin: EdgeInsets.zero, + elevation: 8, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + mFlex(3), + Row( + children: [ + Container( + decoration: containerColorRadiusRight(Color(0xFFFBF2E31), 100), + padding: EdgeInsets.only(left: 20, right: 16, top: 6, bottom: 6), + child: Text( + "Medical File", + style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 13), + ), + ), + mWidth(MediaQuery.of(context).size.width / 50), + circularAviator(MediaQuery.of(context).size.width / 14, brColor: Colors.white), + mFlex(1), + Text( + "Verified", + style: TextStyle(color: Colors.white, fontSize: 10), + ), + circularAviator(MediaQuery.of(context).size.width / 28, brColor: Colors.white, icon: Icons.done, bcColor: Colors.white), + mWidth(MediaQuery.of(context).size.width / 70), + ], + ), + mFlex(2), + Padding( + padding: const EdgeInsets.only(left: 20,right: 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + sliderData.pateintName, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 18, + ), + ), + Text( + sliderData.pateintId, + style: TextStyle(color: Colors.white, fontSize: 14), + ), + ], + ), + ), + mFlex(2), + Padding( + padding: const EdgeInsets.only(left: 20, right: 20), + child: Text( + "34 Years, Male, 4 January 1987", + style: TextStyle(color: Colors.white, fontSize: 14), + ), + ), + mFlex(3), + ], + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/landing/widgets/offer_view.dart b/lib/pages/landing/widgets/offer_view.dart new file mode 100644 index 00000000..c8269bc6 --- /dev/null +++ b/lib/pages/landing/widgets/offer_view.dart @@ -0,0 +1,87 @@ +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:flutter/material.dart'; + +class OfferView extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + height: MediaQuery.of(context).size.width / 5, + decoration: containerColorRadiusBorderWidth(Colors.grey[200], 20, Colors.grey[300], 2), + child: Row( + children: [ + Expanded( + flex: 2, + child: Container( + width: double.infinity, + padding: EdgeInsets.only(left: 20,right: 20,top: 8,bottom: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Kid's Offer", + style: TextStyle( + color: Color(0xFFFBF2E31), + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + Text( + "Take Care of your children's teeth", + style: TextStyle( + color: Colors.black, + fontSize: 12, + fontWeight: FontWeight.bold, + ), + ), + mFlex(1), + Row( + children: [ + Text( + "Only ", + style: TextStyle( + color: Color(0xFFFBF2E31), + fontSize: 14, + ), + ), + Text( + "500 ", + style: TextStyle( + color: Color(0xFFFBF2E31), + fontSize: 14, + fontWeight: FontWeight.bold, + ), + ), + Text( + "SAR ", + style: TextStyle( + color: Color(0xFFFBF2E31), + fontSize: 14, + ), + ), + mFlex(1), + ], + ), + ], + ), + ), + ), + Expanded( + child: Column( + children: [ + Expanded( + flex: 1, + child: Image.asset("assets/images/pharmacy_module/payment/hmg_shipping_logo.png"), + ), + Expanded( + flex: 1, + child: Image.asset("name"), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/landing/widgets/pharmacy_view.dart b/lib/pages/landing/widgets/pharmacy_view.dart new file mode 100644 index 00000000..c065c7a1 --- /dev/null +++ b/lib/pages/landing/widgets/pharmacy_view.dart @@ -0,0 +1,41 @@ +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class PharmacyView extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + decoration: containerColorRadiusBorderWidth(Colors.grey[200], 16, Colors.grey[300], 2), + padding: EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgPicture.asset("assets/images/new/Pharmacy.svg"), + mWidth(12), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "HMG Pharmacy", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + Text( + "Ecommerce Solution", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14, + ), + ), + ], + ) + ], + ), + ); + } +} diff --git a/lib/pages/landing/widgets/services_view.dart b/lib/pages/landing/widgets/services_view.dart new file mode 100644 index 00000000..0e829aac --- /dev/null +++ b/lib/pages/landing/widgets/services_view.dart @@ -0,0 +1,95 @@ +import 'package:auto_size_text/auto_size_text.dart'; +import 'package:diplomaticquarterapp/models/hmg_services.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class ServicesView extends StatelessWidget { + HmgServices hmgServices; + + ServicesView(this.hmgServices); + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + height: double.infinity, + decoration: containerRadiusWithGradientServices(20, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.darkGreyColor), + child: Stack( + children: [ + Container( + width: double.infinity, + height: double.infinity, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + mFlex(1), + Flexible( + flex: 8, + child: Column( + children: [ + Flexible( + flex: 5, + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Opacity( + opacity: 0.07, + child: SvgPicture.asset( + hmgServices.icon, + width: double.infinity, + height: double.infinity, + ), + ), + ), + ), + mFlex(1), + ], + ), + ), + ], + ), + ), + Container( + width: double.infinity, + height: double.infinity, + padding: EdgeInsets.all(MediaQuery.of(context).size.width / 30), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + mFlex(1), + SvgPicture.asset(hmgServices.icon), + mFlex(2), + Text( + hmgServices.title, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + ), + ), + Container( + width: double.infinity, + child: Row( + children: [ + Expanded( + child: AutoSizeText( + hmgServices.subTitle, + maxLines: 1, + style: TextStyle( + fontSize: 10, + ), + ), + ), + ], + ), + ), + mFlex(1), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/landing/widgets/slider_view.dart b/lib/pages/landing/widgets/slider_view.dart new file mode 100644 index 00000000..e999ea25 --- /dev/null +++ b/lib/pages/landing/widgets/slider_view.dart @@ -0,0 +1,124 @@ +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +class SliderView extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Card( + shape: cardRadius(20), + elevation: 0, + margin: EdgeInsets.all(6), + child: Card( + shape: cardRadius(20), + clipBehavior: Clip.antiAlias, + margin: EdgeInsets.zero, + color: Color(0xFFF2B353E), + elevation: 0, + // padding: EdgeInsets.zero, + child: Container( + width: double.infinity, + height: double.infinity, + clipBehavior: Clip.antiAlias, + margin: EdgeInsets.zero, + decoration: containerBottomRightRadiusWithGradient(MediaQuery.of(context).size.width / 4), + child: Card( + color: Colors.transparent, + margin: EdgeInsets.zero, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + mFlex(3), + Container( + decoration: containerColorRadiusRight(Color(0xFFFBF2E31), 100), + padding: EdgeInsets.only(left: 20, right: 16, top: 6, bottom: 6), + child: Text( + "Medical File", + style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 13), + ), + ), + mFlex(2), + Padding( + padding: const EdgeInsets.only(left: 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Can’t see your medical File?", + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 18, + ), + ), + Text( + "Login or Register Now", + style: TextStyle(color: Colors.white, fontSize: 14), + ), + ], + ), + ), + mFlex(2), + Padding( + padding: const EdgeInsets.only(left: 20), + child: Container( + height: MediaQuery.of(context).size.width / 14, + width: MediaQuery.of(context).size.width / 6, + child: RaisedButton( + shape: cardRadius(8), + color: Color(0xFFFBF2E31), + padding: EdgeInsets.zero, + onPressed: () {}, + child: Text( + "Login", + style: TextStyle( + color: Colors.white, + ), + ), + ), + ), + ), + mFlex(3), + ], + ), + ), + ), + ), + ); + } +} + +class CurvedBottomClipper extends CustomClipper { + @override + Path getClip(Size size) { + // I've taken approximate height of curved part of view + // Change it if you have exact spec for it + final roundingHeight = size.height * 3 / 5; + + // this is top part of path, rectangle without any rounding + final filledRectangle = Rect.fromLTRB(0, 0, size.width, size.height - roundingHeight); + + // this is rectangle that will be used to draw arc + // arc is drawn from center of this rectangle, so it's height has to be twice roundingHeight + // also I made it to go 5 units out of screen on left and right, so curve will have some incline there + final roundingRectangle = Rect.fromLTRB(-size.width, size.height - roundingHeight * 2, size.width, size.height); + + final path = Path(); + path.addRect(filledRectangle); + + // so as I wrote before: arc is drawn from center of roundingRectangle + // 2nd and 3rd arguments are angles from center to arc start and end points + // 4th argument is set to true to move path to rectangle center, so we don't have to move it manually + path.arcTo(roundingRectangle, pi, -pi, true); + path.close(); + + return path; + } + + @override + bool shouldReclip(CustomClipper oldClipper) { + // returning fixed 'true' value here for simplicity, it's not the part of actual question, please read docs if you want to dig into it + // basically that means that clipping will be redrawn on any changes + return true; + } +} diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 927e98de..998bf1c2 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -29,7 +29,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; - +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import '../../Constants.dart'; class Login extends StatefulWidget { @@ -47,17 +47,16 @@ class _Login extends State { final authService = new AuthProvider(); var sharedPref = new AppSharedPreferences(); bool isLoading = false; - AppointmentRateViewModel appointmentRateViewModel = - locator(); - PharmacyModuleViewModel pharmacyModuleViewModel = - locator(); + AppointmentRateViewModel appointmentRateViewModel = locator(); + PharmacyModuleViewModel pharmacyModuleViewModel = locator(); - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); ProjectViewModel projectViewModel; ToDoCountProviderModel toDoProvider; + var familyFileProvider = FamilyFilesProvider(); + @override void initState() { // getDeviceToken(); @@ -88,9 +87,7 @@ class _Login extends State { Expanded( flex: 2, child: Texts( - loginType == 1 - ? TranslationBase.of(context).enterNationalId - : TranslationBase.of(context).enterFile, + loginType == 1 ? TranslationBase.of(context).enterNationalId : TranslationBase.of(context).enterFile, fontSize: SizeConfig.textMultiplier * 3.5, textAlign: TextAlign.start, )), @@ -99,12 +96,7 @@ class _Login extends State { child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - Directionality( - textDirection: TextDirection.ltr, - child: MobileNo( - onNumberChange: (value) => - {mobileNo = value, validateForm()}, - onCountryChange: (value) => countryCode = value)), + Directionality(textDirection: TextDirection.ltr, child: MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value)), Directionality( textDirection: TextDirection.ltr, child: Container( @@ -113,16 +105,9 @@ class _Login extends State { fontWeight: FontWeight.normal, controller: nationalIDorFile, onChanged: (value) => {validateForm()}, - prefixIcon: Icon( - loginType == 1 - ? Icons.chrome_reader_mode - : Icons.receipt, - color: secondaryColor), - padding: EdgeInsets.only( - top: 20, bottom: 20, left: 10, right: 10), - hintText: loginType == 1 - ? TranslationBase.of(context).nationalID - : TranslationBase.of(context).fileNo, + prefixIcon: Icon(loginType == 1 ? Icons.chrome_reader_mode : Icons.receipt, color: secondaryColor), + padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10), + hintText: loginType == 1 ? TranslationBase.of(context).nationalID : TranslationBase.of(context).fileNo, ))) ], ), @@ -145,9 +130,7 @@ class _Login extends State { child: DefaultButton( TranslationBase.of(context).login, () => {this.startLogin()}, - color: isButtonDisabled == true - ? Colors.grey - : Colors.grey[900], + color: isButtonDisabled == true ? Colors.grey : Colors.grey[900], textColor: Colors.white, )) ], @@ -168,8 +151,7 @@ class _Login extends State { } void validateForm() { - if (util.validateIDBox(nationalIDorFile.text, loginType) == true && - util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { + if (util.validateIDBox(nationalIDorFile.text, loginType) == true && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { setState(() { isButtonDisabled = false; }); @@ -268,9 +250,9 @@ class _Login extends State { authenticatedUserObject.user = result.list; projectViewModel.user = authenticatedUserObject.user; + await familyFileProvider.getSharedRecordByStatus(); await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { - if (pharmacyModuleViewModel.error.isNotEmpty) - await pharmacyModuleViewModel.createUser(); + if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser(); }); appointmentRateViewModel diff --git a/lib/theme/colors.dart b/lib/theme/colors.dart index 893449f1..6185aeb0 100644 --- a/lib/theme/colors.dart +++ b/lib/theme/colors.dart @@ -8,4 +8,9 @@ class CustomColors { static const Color darkGrey = Color(0xFF222222); static const Color black = Color(0xFF141414); static const Color white = Color(0xFFFFFFFF); + static const Color accentColor=Color(0xFFFBF2E31); + static const Color lightGreyColor=Color(0xFFFEDEDED); + static const Color darkGreyColor=Color(0xFFFC9C9C9); + static const Color pharmacyGreyColor=Color(0xFFFE5E5E5); + static const Color backgroudGreyColor=Color(0xFFFF7F7F7); } diff --git a/lib/uitl/utils_new.dart b/lib/uitl/utils_new.dart new file mode 100644 index 00000000..1dd4e76a --- /dev/null +++ b/lib/uitl/utils_new.dart @@ -0,0 +1,457 @@ +import 'dart:io'; +import 'dart:math'; +import 'dart:ui'; + +import 'package:flutter/material.dart'; + +Decoration appGradient = BoxDecoration( + gradient: LinearGradient( + colors: [ + Color(0xFFFDCA46F), + Color(0xFFFA47E5D), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), +); + +Color getColorFromHex(String hexColor) { + hexColor = hexColor.toUpperCase().replaceAll('#', ''); + + if (hexColor.length == 6) { + hexColor = 'FF' + hexColor; + } + + return Color(int.parse(hexColor, radix: 16)); +} + +spacerVertical(double v) { + return Container( + height: v, + width: double.infinity, + ); +} + +spacerHorizontal(double v) { + return Container( + height: v, + width: v, + ); +} + +spacer() { + return SizedBox( + height: 8, + ); +} + +Future navigateTo(context, page) async { + return await Navigator.push(context, MaterialPageRoute(builder: (context) => page)); +} + +// Future navigateToReplace(context, page) async { +// Navigator.pushReplacement(context, FadeRouteBuilder(page: page)); +// } + +InputDecoration txtField(String label) { + return new InputDecoration( + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + errorBorder: InputBorder.none, + hintText: label, + hintStyle: TextStyle(color: Colors.grey), + disabledBorder: InputBorder.none, + contentPadding: EdgeInsets.only(left: 15, right: 15), + ); +} + +InputDecoration txtField3(String label) { + return new InputDecoration( + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + errorBorder: InputBorder.none, + hintText: label, + disabledBorder: InputBorder.none, + counterText: "", + contentPadding: EdgeInsets.only(left: 5, right: 5), + ); +} + +InputDecoration txtFieldSearch(String label) { + return new InputDecoration( + border: InputBorder.none, + suffixIcon: Icon(Icons.clear), + disabledBorder: InputBorder.none, + contentPadding: EdgeInsets.only(left: 15, right: 15), + ); +} + +Widget circularAviator(double s, {Color bcColor, Color brColor, Color iconColor, int borderWidth, IconData icon}) { + return Card( + shape: cardRadius(2000), + color: Colors.transparent, + elevation: 4, + child: Container( + width: s, + height: s, + decoration: containerColorRadiusBorderWidth(bcColor == null ? Colors.grey[200] : bcColor, 2000, brColor == null ? Colors.blueGrey[800] : brColor, borderWidth == null ? 2 : borderWidth), + child: Icon( + icon == null ? Icons.person : icon, + size: s / 1.7, + color: iconColor == null ? Colors.grey[800] : iconColor, + ), + ), + ); +} + +Widget circularImage(String im, double width, double height) { + return new Container( + width: 190.0, + height: 190.0, + decoration: new BoxDecoration( + shape: BoxShape.circle, + image: new DecorationImage( + fit: BoxFit.fill, + image: new AssetImage(im), + ), + ), + ); +} + +circularImage2(String im, double width, double height) { + return new Container( + width: width, + height: height, + decoration: new BoxDecoration( + shape: BoxShape.circle, + image: new DecorationImage( + fit: BoxFit.fill, + image: new AssetImage(im), + ), + ), + ); +} + +Widget mDivider(Color color) { + return Divider( + // width: double.infinity, + height: 1, + color: color, + ); +} + +Widget mFlex(int f) { + return Flexible( + flex: f, + child: Container(), + ); +} + +mOverlay(double op) { + return Opacity( + opacity: op, + child: Container( + color: Colors.black, + width: double.infinity, + height: double.infinity, + ), + ); +} + +Widget mHeight(double h) { + return Container( + height: h, + ); +} + +Widget mWidth(double w) { + return Container( + width: w, + ); +} + +RoundedRectangleBorder buttonShape() { + return RoundedRectangleBorder( + borderRadius: BorderRadius.circular(14.0), + ); +} + +Decoration containerRadiusWithGradient(double radius) { + return BoxDecoration( + borderRadius: BorderRadius.circular(radius), + gradient: LinearGradient( + colors: [ + Color(0xFFF71787E), + Color(0xFFF2B353E), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), + ); +} + +Decoration containerBottomRightRadiusWithGradient(double radius, {Color darkColor, Color lightColor}) { + return BoxDecoration( + borderRadius: BorderRadius.only(bottomRight: Radius.circular(radius)), + gradient: LinearGradient( + colors: [ + darkColor == null ? Color(0xFFF2B353E) : darkColor, + lightColor == null ? Color(0xFFF71787E) : lightColor, + ], + begin: Alignment.topCenter, + end: Alignment.bottomRight, + ), + ); +} + +Decoration containerRadiusWithGradientServices(double radius, {Color darkColor, Color lightColor}) { + return BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(radius)), + gradient: LinearGradient( + colors: [ + darkColor == null ? Color(0xFFF2B353E) : darkColor, + lightColor == null ? Color(0xFFF71787E) : lightColor, + ], + begin: Alignment.centerRight, + end: Alignment.topLeft, + ), + ); +} + +Decoration containerRadius(Color background, double radius) { + return BoxDecoration( + color: background, + border: Border.all( + width: 1, // + color: background // <--- border width here + ), + borderRadius: BorderRadius.circular(radius), + ); +} + +Decoration containerColorRadiusBorder(Color background, double radius, Color color) { + return BoxDecoration( + color: background, + border: Border.all( + width: 1, // + color: color // <--- border width here + ), + borderRadius: BorderRadius.circular(radius), + ); +} + +Decoration containerColorRadiusBorderWidth(Color background, double radius, Color color, double w) { + return BoxDecoration( + color: background, + border: Border.all( + width: w, // + color: color // <--- border width here + ), + borderRadius: BorderRadius.circular(radius), + ); +} + +Decoration containerColorRadiusRight(Color background, double radius) { + return BoxDecoration( + color: background, + borderRadius: BorderRadius.only(topRight: Radius.circular(radius), bottomRight: Radius.circular(radius)), + ); +} + +Decoration containerColorRadiusRightBorder(Color background, double radius, double w) { + return BoxDecoration( + color: background, + border: Border.all( + width: w, // + color: Colors.white // <--- border width here + ), + borderRadius: BorderRadius.only(topRight: Radius.circular(radius), bottomRight: Radius.circular(radius)), + ); +} + +Decoration containerColorRadiusRightBorderc(Color background, double radius, double w, Color borderColor) { + return BoxDecoration( + color: background, + border: Border.all( + width: w, // + color: borderColor // <--- border width here + ), + borderRadius: BorderRadius.circular(radius), + ); +} + +Decoration containerColorRadiusTop(Color color, double radius) { + return BoxDecoration( + color: color, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(radius), + topRight: Radius.circular(radius), + ), + ); +} + +Decoration containerColorRadiusBottom(Color color, double radius) { + return BoxDecoration( + color: color, + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(radius), + bottomRight: Radius.circular(radius), + ), + ); +} + +Decoration containerColorRadiusLeftBorder(Color background, double radius, double w) { + return BoxDecoration( + color: background, + border: Border.all( + width: w, // + color: Colors.white // <--- border width here + ), + borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)), + ); +} + +ShapeBorder cardRadius(double radius) { + return RoundedRectangleBorder( + side: BorderSide(color: Colors.transparent, width: 1), + borderRadius: BorderRadius.circular(radius), + ); +} + +ShapeBorder cardRadiusTop(double radius) { + return RoundedRectangleBorder( + side: BorderSide(color: Colors.transparent, width: 0), + borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), topRight: Radius.circular(radius)), + ); +} + +ShapeBorder cardRadiusTop2(double radius) { + return RoundedRectangleBorder( + borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), topRight: Radius.circular(radius)), + ); +} + +ShapeBorder cardRadiusBottom(double radius) { + return RoundedRectangleBorder( + borderRadius: BorderRadius.only(bottomLeft: Radius.circular(radius), bottomRight: Radius.circular(radius)), + ); +} + +ShapeBorder cardRadiusWithoutBorder(double radius) { + return RoundedRectangleBorder( + side: BorderSide(color: Colors.transparent, width: 1), + borderRadius: BorderRadius.circular(radius), + ); +} + +ShapeBorder cardRadiusWithBorder(double radius) { + return RoundedRectangleBorder( + side: BorderSide(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(radius), + ); +} + +ShapeBorder cardRadiusBorder(double radius, double w) { + return RoundedRectangleBorder( + side: BorderSide(color: Colors.transparent, width: w), + borderRadius: BorderRadius.circular(radius), + ); +} + +// String properRound(double val, int places) { +// double mod = pow(10.0, places); +// double result = ((val * mod).round().toDouble() / mod); +// return result.toString(); +// } +// +// double properRoundDouble(double val, int places) { +// double mod = pow(10.0, places); +// double result = ((val * mod).round().toDouble() / mod); +// return result; +// } +//var cardShape = RoundedRectangleBorder( +// side: BorderSide(color: Colors.white70, width: 1), +// borderRadius: BorderRadius.circular(10), +//); + +//await Navigator.of(context).push(new MaterialPageRoute( +//builder: (BuildContext context) { +//return AdminTeamAvaluatePage(widget.competitionID, data); +//}, +//)); +//setState(() {}); + +Color getColor(String selectedColor) { + try { + if ("black" == selectedColor) { + return Colors.black; + } else if ("red" == selectedColor) { + return Colors.red; + } else if ("blueAccent" == selectedColor) { + return Colors.blueAccent; + } else if ("blue" == selectedColor) { + return Colors.blue; + } else if ("blueGrey" == selectedColor) { + return Colors.blueGrey; + } else if ("yellow" == selectedColor) { + return Colors.yellow; + } else if ("black54" == selectedColor) { + return Colors.black54; + } else if ("green" == selectedColor) { + return Colors.green; + } else if ("orange" == selectedColor) { + return Colors.orange; + } else if ("deepOrange" == selectedColor) { + return Colors.deepOrange; + } else { + return Colors.black; + } + } catch (e) { + return Colors.black; + } +} + +TextAlign getTextAlign(String textAlign) { + try { + if (textAlign == "left") { + return TextAlign.left; + } else if (textAlign == "right") { + return TextAlign.right; + } else if (textAlign == "center") { + return TextAlign.center; + } else if (textAlign == "justify") { + return TextAlign.justify; + } else { + return TextAlign.left; + } + } catch (e) { + print("fffff " + e.toString()); + return TextAlign.left; + } +} + +FontWeight getFontWeight(String fontWeight) { + if (fontWeight == null) { + return FontWeight.normal; + } else if (fontWeight == "bold") { + return FontWeight.bold; + } else { + return FontWeight.normal; + } +} + +FontStyle getFontStyle(String fontStyle) { + try { + if (fontStyle == null) { + return FontStyle.normal; + } else if (fontStyle == "italian") { + return FontStyle.italic; + } else { + return FontStyle.normal; + } + } catch (e) { + return FontStyle.normal; + } +} diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 5192e0f0..cc500955 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -65,7 +65,7 @@ class _AppDrawerState extends State { width: MediaQuery.of(context).size.width * 0.75, color: Theme.of(context).scaffoldBackgroundColor, child: Container( - // color: Colors.white, + color: Colors.white, child: Theme( data: Theme.of(context).copyWith( canvasColor: Theme.of(context).scaffoldBackgroundColor), diff --git a/pubspec.yaml b/pubspec.yaml index 8caa9db4..fd70e30a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -189,6 +189,7 @@ dependencies: # Marker Animation flutter_animarker: ^1.0.0 + auto_size_text: ^2.0.1 dev_dependencies: flutter_test: @@ -220,6 +221,7 @@ flutter: - assets/images/gif/ - assets/images/pharmacy_module/payment/ - assets/images/pharmacy_module/lakum/ + - assets/images/new/ fonts: - family: WorkSans