diff --git a/assets/images/al-habib_online_payment_service_icon.png b/assets/images/al-habib_online_payment_service_icon.png new file mode 100644 index 00000000..4056bca6 Binary files /dev/null and b/assets/images/al-habib_online_payment_service_icon.png differ diff --git a/assets/images/blood_icon.png b/assets/images/blood_icon.png new file mode 100644 index 00000000..9e1b4468 Binary files /dev/null and b/assets/images/blood_icon.png differ diff --git a/assets/images/comprehensive_medical_checkup_logo.png b/assets/images/comprehensive_medical_checkup_logo.png new file mode 100644 index 00000000..15e4ac04 Binary files /dev/null and b/assets/images/comprehensive_medical_checkup_logo.png differ diff --git a/assets/images/dashboard_top_bg.png b/assets/images/dashboard_top_bg.png new file mode 100644 index 00000000..98b4c943 Binary files /dev/null and b/assets/images/dashboard_top_bg.png differ diff --git a/assets/images/ereferral_service_icon.png b/assets/images/ereferral_service_icon.png new file mode 100644 index 00000000..a47b7f36 Binary files /dev/null and b/assets/images/ereferral_service_icon.png differ diff --git a/assets/images/height_icon.png b/assets/images/height_icon.png new file mode 100644 index 00000000..a837fb3d Binary files /dev/null and b/assets/images/height_icon.png differ diff --git a/assets/images/livecare_white_logo.png b/assets/images/livecare_white_logo.png new file mode 100644 index 00000000..dc223965 Binary files /dev/null and b/assets/images/livecare_white_logo.png differ diff --git a/assets/images/pharmacy_logo.png b/assets/images/pharmacy_logo.png new file mode 100644 index 00000000..bf82ed5c Binary files /dev/null and b/assets/images/pharmacy_logo.png differ diff --git a/assets/images/weight_icon.png b/assets/images/weight_icon.png new file mode 100644 index 00000000..5c640114 Binary files /dev/null and b/assets/images/weight_icon.png differ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 3005c123..9c79825e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -326,7 +326,7 @@ const Map> localizedValues = { "OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'صيدلايات الحبيب'}, "EmergencyService": {"en": "Emergency Service", 'ar': 'الفحص الطبي الشامل'}, "OnlinePaymentService": {"en": "Online Payment Service", 'ar': 'خدمة الدفع عبر الإلكتدوني'}, - "OffersAndPackages": {"en": "Offers and Packages", 'ar': 'العروض والباقات'}, + "OffersAndPackages": {"en": "Online transfer request", 'ar': 'طلب التحويل الالكتروني'}, "ComprehensiveMedicalCheckup": {"en": "Comprehensive Medical Check up", 'ar': 'فحص طبي شامل'}, "HMGService": {"en": "HMG Service", 'ar': 'جميع خدمات الحبيب'}, "ViewAllHabibMedicalService": {"en": "View All Habib Medical Service", 'ar': 'عرض خدمات الحبيب الطبية'}, @@ -346,5 +346,6 @@ const Map> localizedValues = { "gate":{"en":"Gate:","ar":"بوابة"}, "building":{"en":"Building:","ar":"المبنى"}, "branch":{"en":"Branch:","ar":"الفرع"}, + "emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"}, }; diff --git a/lib/core/viewModels/base_view_model.dart b/lib/core/viewModels/base_view_model.dart index 08fc7a9d..74899fae 100644 --- a/lib/core/viewModels/base_view_model.dart +++ b/lib/core/viewModels/base_view_model.dart @@ -7,6 +7,7 @@ import 'package:flutter/material.dart'; class BaseViewModel extends ChangeNotifier { ViewState _state = ViewState.Idle; bool isInternetConnection = true; + bool isLogin = false; ViewState get state => _state; @@ -27,6 +28,10 @@ class BaseViewModel extends ChangeNotifier { _getUser() async { var userData = await sharedPref.getObject(USER_PROFILE); if (userData != null) user = AuthenticatedUser.fromJson(userData); + + var isLogin = await sharedPref.getString(LOGIN_TOKEN_ID); + this.isLogin = isLogin != null; + notifyListeners(); } } diff --git a/lib/core/viewModels/dashboard_view_model.dart b/lib/core/viewModels/dashboard_view_model.dart index 647d92b7..16ce9cfb 100644 --- a/lib/core/viewModels/dashboard_view_model.dart +++ b/lib/core/viewModels/dashboard_view_model.dart @@ -1,8 +1,29 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/service/dashboard_service.dart'; +import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import '../../locator.dart'; class DashboardViewModel extends BaseViewModel { + VitalSignService _vitalSignService = locator(); + String weightKg = ""; + String heightCm = ""; + String bloadType = ""; + getPatientRadOrders() async { + if (!isLogin) { + setState(ViewState.Busy); + await _vitalSignService.getPatientRadOrders(); + + if (_vitalSignService.hasError) { + error = _vitalSignService.error; + setState(ViewState.Error); + } else + _vitalSignService.vitalSignResModelList.forEach((element) { + weightKg = '${element.weightKg}'; + heightCm = '${element.heightCm}'; + }); + setState(ViewState.Idle); + } + } } diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index ed752b50..85f39ab9 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -2,10 +2,11 @@ import 'dart:async'; import 'package:connectivity/connectivity.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/cupertino.dart'; -class ProjectViewModel with ChangeNotifier { +class ProjectViewModel extends BaseViewModel { AppSharedPreferences sharedPref = AppSharedPreferences(); Locale _appLocale; String currentLanguage = 'ar'; diff --git a/lib/models/Authentication/authenticated_user.dart b/lib/models/Authentication/authenticated_user.dart index 7ca3a3e2..efccc068 100644 --- a/lib/models/Authentication/authenticated_user.dart +++ b/lib/models/Authentication/authenticated_user.dart @@ -1,3 +1,5 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + class AuthenticatedUser { String setupID; int patientType; @@ -11,6 +13,7 @@ class AuthenticatedUser { int relationshipID; int gender; String dateofBirth; + DateTime dateofBirthDataTime; dynamic dateofBirthN; String nationalityID; dynamic phoneResi; @@ -135,6 +138,7 @@ class AuthenticatedUser { relationshipID = json['RelationshipID']; gender = json['Gender']; dateofBirth = json['DateofBirth']; + dateofBirthDataTime = DateUtil.convertStringToDate(json['DateofBirth']); dateofBirthN = json['DateofBirthN']; nationalityID = json['NationalityID']; phoneResi = json['PhoneResi']; diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index fe44e112..17eba227 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -1,6 +1,9 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -12,6 +15,10 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class HomePage extends StatefulWidget { + final Function goToMyProfile; + + HomePage({Key key, this.goToMyProfile}); + @override _HomePageState createState() => _HomePageState(); } @@ -20,300 +27,497 @@ class _HomePageState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return AppScaffold( - body: Container( - width: double.infinity, - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Stack( - children: [ - Column( - children: [ - Container( - width: double.infinity, - height: 210, - decoration: BoxDecoration( - image: DecorationImage( - image: ExactAssetImage( - 'assets/images/timeline_bg.png'), - fit: BoxFit.cover), + return BaseView( + onModelReady: (model) => model.getPatientRadOrders(), + builder: (_, model, wi) => AppScaffold( + body: Container( + width: double.infinity, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + children: [ + Column( + children: [ + Container( + width: double.infinity, + height: 210, + decoration: BoxDecoration( + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/dashboard_top_bg.png'), + fit: BoxFit.cover), + ), + child: Stack( + children: [ + Positioned( + top: 30, + left: 15, + right: 15, + child: Container( + width: + MediaQuery.of(context).size.width * 0.8, + child: Row( + children: [ + Expanded( + child: InkWell( + onTap: () => Navigator.push(context, + FadePage(page: LiveCareHome())), + child: Container( + height: 110, + padding: EdgeInsets.all(15), + margin: EdgeInsets.all(5), + decoration: BoxDecoration( + color: Colors.white + .withOpacity(0.3), + borderRadius: BorderRadius.all( + Radius.circular(5))), + child: Image.asset( + 'assets/images/livecare_white_logo.png', + ), + ), + ), + ), + Expanded( + child: Container( + height: 110, + padding: EdgeInsets.all(15), + margin: EdgeInsets.all(5), + decoration: BoxDecoration( + color: + Colors.white.withOpacity(0.3), + borderRadius: BorderRadius.all( + Radius.circular(5))), + // child: Image.asset('assets/images/livecare_white_logo.png',), + ), + ), + ], + ), + ), + ) + ], + ), ), - child: Stack( - children: [ - Positioned( - top: 30, - left: 15, - right: 15, + Container(width: double.infinity, height: 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), + child: (!model.isLogin && projectViewModel.user == null) + ? Container( + width: double.infinity, + height: 125, + 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)), child: Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Row( + margin: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of(context).myMedicalFile, + color: Colors.black87, + bold: true, + fontSize: 23, + ), + SizedBox( + height: 5, + ), + Texts( + TranslationBase.of(context) + .myMedicalFileSubTitle, + color: Colors.black, + fontSize: 16, + ), + Align( + alignment: projectViewModel.isArabic + ? Alignment.bottomLeft + : Alignment.bottomRight, child: InkWell( - onTap: () => Navigator.push(context, - FadePage(page: LiveCareHome())), + onTap: () { + widget.goToMyProfile(); + }, child: Container( - height: 110, - margin: EdgeInsets.all(5), + margin: EdgeInsets.all(2), + width: 90, + height: 30, decoration: BoxDecoration( - color: Colors.transparent - .withOpacity(0.3), + color: Hexcolor('#D81A2E'), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, + width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(9)), ), child: Center( child: Texts( - 'Live care ', + TranslationBase.of(context) + .viewMore, color: Colors.white, + fontSize: 12, ), ), ), ), - ), - Expanded( - child: Container( - height: 110, - margin: EdgeInsets.all(5), - decoration: BoxDecoration( - color: Colors.transparent - .withOpacity(0.3), - )), - ), + ) ], ), ), ) - ], - ), - ), - Container(width: double.infinity, height: 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), - child: Container( - width: double.infinity, - height: 125, - 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)), - child: Container( - margin: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 8, - ), - Texts( - TranslationBase.of(context).myMedicalFile, - color: Colors.black87, - bold: true, - fontSize: 23, - ), - SizedBox( - height: 5, - ), - Texts( - TranslationBase.of(context).myMedicalFileSubTitle, - color: Colors.black, - fontSize: 16, - ), - Align( - alignment: projectViewModel.isArabic - ? Alignment.bottomLeft - : Alignment.bottomRight, - child: InkWell( - onTap: () {}, - child: Container( - margin: EdgeInsets.all(2), - 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(9)), - ), - child: Center( - child: Texts( - TranslationBase.of(context).viewMore, - color: Colors.white, - fontSize: 12, + : Container( + width: double.infinity, + height: 130, + 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), + ), + child: Container( + margin: EdgeInsets.all(5), + child: Column( + children: [ + Row( + children: [ + if (model.user != null) + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 8, + ), + Texts( + model.user.firstName + + " " + + model.user.lastName, + color: Colors.grey[100], + bold: true, + fontSize: 15, + ), + Texts( + '${model.user.patientID}', + color: Colors.white, + fontSize: 14, + ), + SizedBox( + height: 5, + ), + Texts( + '${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}', + color: Colors.grey[100], + fontWeight: FontWeight.normal, + fontSize: 14, + ), + ], + ), + ), + InkWell( + onTap: () { + widget.goToMyProfile(); + }, + child: Container( + margin: EdgeInsets.all(2), + 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(5), + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context) + .viewMore, + color: Colors.white, + fontSize: 12, + ), + ), + ), + ) + ], ), - ), + Row( + //crossAxisAlignment: CrossAxisAlignment.center, + //mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + 'assets/images/height_icon.png', + width: 35, + height: 40, + ), + Texts( + "${model.heightCm}", + color: Colors.white, + ) + ], + ), + ), + SizedBox( + width: 3, + ), + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + 'assets/images/weight_icon.png', + width: 25, + height: 40, + ), + Texts( + '${model.weightKg}', + color: Colors.white, + ) + ], + ), + ), + SizedBox( + width: 3, + ), + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + 'assets/images/blood_icon.png', + width: 35, + height: 40, + ), + Texts( + '${model.bloadType}', + color: Colors.white, + ) + ], + ), + ), + ], + ) + ], ), ), - ) - ], - ), - ), + ), ), - ), - ], - ), - Container( - margin: EdgeInsets.only(left: 15, right: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - DashboardItem( - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/Dr_Schedule_report.png', - width: 50, - height: 50, - ), - SizedBox( - height: 15, - ), - Texts( - TranslationBase.of(context) - .homeHealthCareService, - textAlign: TextAlign.center, - color: Colors.white, - bold: true, - fontSize: 14, - ) - ], + ], + ), + Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + DashboardItem( + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/Dr_Schedule_report.png', + width: 50, + height: 50, + ), + SizedBox( + height: 15, + ), + Texts( + TranslationBase.of(context) + .homeHealthCareService, + textAlign: TextAlign.center, + color: Colors.white, + bold: true, + fontSize: 14, + ) + ], + ), ), ), + height: 150, + imageName: 'home_healthcare_service_bg.png', + opacity: 0.5, ), - height: 150, - imageName: 'home_healthcare_service_bg.png', - opacity: 0.5, - ), - DashboardItem( - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/new-design/pharmacy_icon.png', - width: 40, - height: 40, - ), - SizedBox( - height: 15, - ), - Texts( - TranslationBase.of(context).onlinePharmacy, - textAlign: TextAlign.center, - color: Colors.white, - bold: true, - ) - ], + DashboardItem( + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/pharmacy_logo.png', + width: 40, + height: 40, + ), + SizedBox( + height: 15, + ), + Texts( + TranslationBase.of(context).onlinePharmacy, + textAlign: TextAlign.center, + color: Colors.white, + bold: true, + ) + ], + ), ), ), + height: 150, + imageName: 'al-habib_onlne_pharmacy_bg.png', ), - height: 150, - imageName: 'al-habib_onlne_pharmacy_bg.png', - ), - DashboardItem( - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/Dr_Schedule_report.png', - width: 50, - height: 50, - ), - SizedBox( - height: 15, - ), - Texts( - TranslationBase.of(context).emergencyService, - textAlign: TextAlign.center, - color: Colors.white, - bold: true, - fontSize: 14, - ) - ], + DashboardItem( + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/comprehensive_medical_checkup_logo.png', + width: 50, + height: 50, + ), + SizedBox( + height: 15, + ), + Texts( + TranslationBase.of(context).emergencyService, + textAlign: TextAlign.center, + color: Colors.white, + bold: true, + fontSize: 14, + ) + ], + ), ), ), + height: 150, + color: Hexcolor("#747C80"), + imageName: 'emergency_service_image.png', ), - height: 150, - color: Hexcolor("#747C80"), - imageName: 'emergency_service_image.png', - ), - ], + ], + ), ), - ), - SizedBox( - height: 8, - ), - Container( - margin: EdgeInsets.only(left: 15, right: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.29, - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/new-design/online_payment_icon.png', - width: 80, - height: 50, - ), - SizedBox( - height: 15, - ), - Texts( - TranslationBase.of(context) - .onlinePaymentService, - textAlign: TextAlign.center, - color: Colors.black87, - bold: false, - fontSize: SizeConfig.textMultiplier * 2, - ) - ], + SizedBox( + height: 8, + ), + Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.29, + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/al-habib_online_payment_service_icon.png', + height: 55, + ), + SizedBox( + height: 15, + ), + Texts( + TranslationBase.of(context) + .onlinePaymentService, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 2, + ) + ], + ), ), ), + height: 150, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + ), ), - height: 150, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.0), - color: Colors.white, - ), - ), - Container( + Container( + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/ereferral_service_icon.png', + width: 50, + height: 55, + ), + SizedBox( + height: 15, + ), + Texts( + TranslationBase.of(context) + .offersAndPackages, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 2, + ) + ], + ), + ), + ), + width: MediaQuery.of(context).size.width * 0.29, + height: 150, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + )), + Container( + width: MediaQuery.of(context).size.width * 0.29, child: Center( child: Padding( padding: const EdgeInsets.all(15.0), child: Column( children: [ Image.asset( - 'assets/images/offer_icon.png', + 'assets/images/Dr_Schedule_report.png', width: 50, height: 50, ), @@ -321,146 +525,114 @@ class _HomePageState extends State { height: 15, ), Texts( - TranslationBase.of(context).offersAndPackages, + TranslationBase.of(context).emergencyServices, textAlign: TextAlign.center, color: Colors.black87, bold: false, - fontSize: SizeConfig.textMultiplier * 2, + fontSize: SizeConfig.textMultiplier * 1.60, ) ], ), ), ), - width: MediaQuery.of(context).size.width * 0.29, height: 150, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.0), color: Colors.white, - )), - Container( - width: MediaQuery.of(context).size.width * 0.29, - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), + ), + ), + ], + ), + ), + SizedBox( + height: 8, + ), + Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + DashboardItem( + child: Container( + width: double.infinity, + padding: EdgeInsets.all(10), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image.asset( - 'assets/images/Dr_Schedule_report.png', - width: 50, - height: 50, - ), - SizedBox( - height: 15, + Texts( + TranslationBase.of(context).hMGService, + color: Colors.white, + fontWeight: FontWeight.normal, ), Texts( TranslationBase.of(context) - .comprehensiveMedicalCheckup, - textAlign: TextAlign.center, - color: Colors.black87, - bold: false, - fontSize: SizeConfig.textMultiplier * 1.60, + .viewAllHabibMedicalService, + color: Colors.white, + fontWeight: FontWeight.normal, + fontSize: 10, + ), + Expanded( + child: Container(), + ), + Texts( + TranslationBase.of(context).viewMore, + color: Colors.white, + //fontWeight: FontWeight.normal, ) ], ), ), + height: 100, + imageName: 'hmg_services_bg .png', + opacity: 0.5, + color: Colors.grey[700], + width: MediaQuery.of(context).size.width * 0.45, + onTap: () => Navigator.push( + context, FadePage(page: AllHabibMedicalService())), ), - height: 150, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.0), - color: Colors.white, - ), - ), - ], - ), - ), - SizedBox( - height: 8, - ), - Container( - margin: EdgeInsets.only(left: 15, right: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - DashboardItem( - child: Container( - width: double.infinity, - padding: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).hMGService, - color: Colors.white, - fontWeight: FontWeight.normal, - ), - Texts( - TranslationBase.of(context) - .viewAllHabibMedicalService, - color: Colors.white, - fontWeight: FontWeight.normal, - fontSize: 10, - ), - Expanded( - child: Container(), - ), - Texts( - TranslationBase.of(context).viewMore, - color: Colors.white, - //fontWeight: FontWeight.normal, - ) - ], - ), - ), - height: 100, - imageName: 'hmg_services_bg .png', - opacity: 0.5, - color: Colors.grey[700], - width: MediaQuery.of(context).size.width * 0.45, - onTap: () => Navigator.push( - context, FadePage(page: AllHabibMedicalService())), - ), - DashboardItem( - child: Container( - width: double.infinity, - padding: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).contactUs, - color: Colors.white, - fontWeight: FontWeight.normal, - ), - Texts( - TranslationBase.of(context).viewAllWaysReachUs, - color: Colors.white, - fontWeight: FontWeight.normal, - fontSize: 10, - ), - Expanded( - child: Container(), - ), - Texts( - TranslationBase.of(context).viewMore, - color: Colors.white, - fontWeight: FontWeight.normal, - ) - ], + DashboardItem( + child: Container( + width: double.infinity, + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).contactUs, + color: Colors.white, + fontWeight: FontWeight.normal, + ), + Texts( + TranslationBase.of(context).viewAllWaysReachUs, + color: Colors.white, + fontWeight: FontWeight.normal, + fontSize: 10, + ), + Expanded( + child: Container(), + ), + Texts( + TranslationBase.of(context).viewMore, + color: Colors.white, + fontWeight: FontWeight.normal, + ) + ], + ), ), + height: 100, + imageName: 'contact_us_bg.png', + opacity: 0.5, + color: Colors.grey[700], + width: MediaQuery.of(context).size.width * 0.45, ), - height: 100, - imageName: 'contact_us_bg.png', - opacity: 0.5, - color: Colors.grey[700], - width: MediaQuery.of(context).size.width * 0.45, - ), - ], + ], + ), ), - ), - SizedBox( - height: 80, - ) - ], + SizedBox( + height: 80, + ) + ], + ), ), ), ), diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 6a651a02..840c9a7f 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -229,14 +229,16 @@ class _LandingPageState extends State with WidgetsBindingObserver { physics: NeverScrollableScrollPhysics(), controller: pageController, children: [ - HomePage(), + HomePage(goToMyProfile: (){ + _changeCurrentTab(1); + },), MedicalProfilePage(), MyAdmissionsPage(), ToDo(), BookingOptions() ], // Please do not remove the BookingOptions from this array ), - bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab), + bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab,index: currentTab,), ); } diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index c611a95b..c23768ae 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -142,7 +142,7 @@ class AuthProvider with ChangeNotifier { return Future.value(localRes); } catch (error) { print(error); - throw error; + //throw error; } } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index cd8178e3..bfc26e3c 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -430,6 +430,7 @@ class TranslationBase { String get gate =>localizedValues['gate'][locale.languageCode]; String get building =>localizedValues['building'][locale.languageCode]; String get branch =>localizedValues['branch'][locale.languageCode]; + String get emergencyServices =>localizedValues['emergencyServices'][locale.languageCode]; diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index 890558dc..ee0734b9 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -9,8 +9,8 @@ import 'bottom_navigation_item.dart'; class BottomNavBar extends StatefulWidget { final ValueChanged changeIndex; - - BottomNavBar({Key key, this.changeIndex}) : super(key: key); + final int index ; + BottomNavBar({Key key, this.changeIndex,this.index}) : super(key: key); @override _BottomNavBarState createState() => _BottomNavBarState(); @@ -21,15 +21,6 @@ class _BottomNavBarState extends State { _changeIndex(int index) { widget.changeIndex(index); - setState(() { - _index = index; - - // Navigate to Appointment Booking Flow - // if (_index == 4) navigateToBookingOptions(context); - - // Navigate to upcoming list - //if (_index == 3) navigateToToDoList(context); - }); } @override @@ -48,7 +39,7 @@ class _BottomNavBarState extends State { icon: EvaIcons.home, activeIcon: EvaIcons.home, changeIndex: _changeIndex, - index: _index, + index: widget.index, currentIndex: 0, name: TranslationBase.of(context).home, ), @@ -56,7 +47,7 @@ class _BottomNavBarState extends State { icon: EvaIcons.list, activeIcon: EvaIcons.list, changeIndex: _changeIndex, - index: _index, + index: widget.index, currentIndex: 1, name: TranslationBase.of(context).medicalProfile, ), @@ -87,7 +78,7 @@ class _BottomNavBarState extends State { icon: EvaIcons.person, activeIcon: EvaIcons.person, changeIndex: _changeIndex, - index: _index, + index: widget.index, currentIndex: 2, name: TranslationBase.of(context).mySchedule, ), @@ -95,7 +86,7 @@ class _BottomNavBarState extends State { icon: EvaIcons.calendar, activeIcon: EvaIcons.calendar, changeIndex: _changeIndex, - index: _index, + index: widget.index, currentIndex: 3, name: TranslationBase.of(context).todoList, )