From 3e441c55b22549ee50ef4706c1f232f5c7d428d2 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 26 Jan 2021 12:41:50 +0200 Subject: [PATCH] fix bottom nav bar --- lib/config/localized_values.dart | 4 ++ lib/pages/landing/home_page.dart | 9 ++-- lib/pages/landing/landing_page.dart | 2 + lib/pages/medical/medical_profile_page.dart | 53 ++++++++++--------- lib/uitl/translations_delegate_base.dart | 7 +-- .../bottom_navigation/bottom_nav_bar.dart | 2 +- .../medical/time_line_widget.dart | 14 +++-- 7 files changed, 46 insertions(+), 45 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 1601471a..5658469e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1646,4 +1646,8 @@ const Map localizedValues = { "en": "Enter Diastolic Value", "ar": "أدخل قيمة الإنبساط " }, + "cmc-heading": { + "en": "Comprehensive Medical Checkup", + "ar": "فحص طبي شامل" + }, }; diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 87afb17f..3a64fbd5 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_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'; @@ -421,7 +422,7 @@ class _HomePageState extends State { Navigator.push( context, FadePage( - page: HomeHealthCareIndexPage(), + page: HomeHealthCarePage(), ), ); }, @@ -436,10 +437,10 @@ class _HomePageState extends State { height: 50, ), SizedBox( - height: 3, + height: 10, ), Texts( - TranslationBase.of(context).homeHealthCareService, + TranslationBase.of(context).cmcHeading, textAlign: TextAlign.center, color: Colors.white, fontWeight: FontWeight.w700, @@ -505,7 +506,7 @@ class _HomePageState extends State { height: 50, ), SizedBox( - height: 3, + height:10, ), Texts( TranslationBase.of(context).emergencyService, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 01a50fda..e63df76c 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -607,6 +607,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { return TranslationBase.of(context).medicalProfile; case 2: return TranslationBase.of(context).bookAppo; + case 5: + return TranslationBase.of(context).bookAppo; case 3: return TranslationBase.of(context).services; case 4: diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index ade69f45..431990e8 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -54,15 +54,19 @@ class MedicalProfilePage extends StatefulWidget { class _MedicalProfilePageState extends State { var authProvider = new AuthProvider(); - List medical=List(); + List medical = List(); ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { - projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); var appoCountProvider = Provider.of(context); - - List myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel,context: context,count: appoCountProvider.count,isLogin: projectViewModel.isLogin); - return BaseView( + List myMedicalList = Utils.myMedicalList( + projectViewModel: projectViewModel, + context: context, + count: appoCountProvider.count, + isLogin: projectViewModel.isLogin); + return BaseView( onModelReady: (model) => model.getAppointmentHistory(), builder: (_, model, widget) => AppScaffold( isShowDecPage: false, @@ -97,25 +101,30 @@ class _MedicalProfilePageState extends State { itemCount: model .appoitmentAllHistoryResultList.length, scrollDirection: Axis.horizontal, - reverse: !projectViewModel.isArabic, + reverse: projectViewModel.isArabic, ), ], ), ), - SizedBox(height: 50,), + SizedBox( + height: 50, + ), Padding( padding: EdgeInsets.symmetric(vertical: 5.0), child: GridView.builder( shrinkWrap: true, primary: false, physics: NeverScrollableScrollPhysics(), - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + gridDelegate: + SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 3, - childAspectRatio: MediaQuery.of(context).size.width / (MediaQuery.of(context).size.height / 2.40), + childAspectRatio: MediaQuery.of(context) + .size + .width / + (MediaQuery.of(context).size.height / 2.40), ), itemCount: myMedicalList.length, itemBuilder: (BuildContext context, int index) { - return myMedicalList[index]; }, ), @@ -123,8 +132,7 @@ class _MedicalProfilePageState extends State { ], ), SizedBox( - height: - MediaQuery.of(context).size.height * 0.12, + height: MediaQuery.of(context).size.height * 0.12, ), if (model.user != null && model.isLogin) Positioned( @@ -135,7 +143,7 @@ class _MedicalProfilePageState extends State { width: double.infinity, height: 80, decoration: BoxDecoration( - color: Theme.of(context).primaryColor, + color: Colors.grey[500], shape: BoxShape.rectangle, border: Border.all( color: Colors.transparent, width: 0.5), @@ -187,20 +195,13 @@ class _MedicalProfilePageState extends State { ), ); } - - fullMedicalData(){ - if(projectViewModel.havePrivilege(5)) - {} - } } -class Medical{ - - final String title; - final String imagePath; - final String subTitle; - final Widget page; - - Medical({this.title, this.imagePath, this.subTitle, this.page}); +class Medical { + final String title; + final String imagePath; + final String subTitle; + final Widget page; + Medical({this.title, this.imagePath, this.subTitle, this.page}); } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 2365359d..82d3d5c4 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1377,15 +1377,10 @@ class TranslationBase { localizedValues["viewTermsConditions"][locale.languageCode]; String get walkinAppo => localizedValues["WalkinAppo"][locale.languageCode]; String get videoAppo => localizedValues["videoAppo"][locale.languageCode]; - String get addNewChild => localizedValues["add-new-child"][locale.languageCode]; - String get sendChildEmailMsg => localizedValues["send-child-email-msg"][locale.languageCode]; - String get vaccinationAddChildMsg => localizedValues["vaccination-add-child-msg"][locale.languageCode]; - String get childAddedSuccessfully => localizedValues["child_added_successfully"][locale.languageCode]; - String get bloodDEnterDesc => localizedValues["bloodD-enter-desc"][locale.languageCode]; - String get viewTermsConditions => localizedValues["viewTermsConditions"][locale.languageCode]; String get weightAdd => localizedValues["weight-add"][locale.languageCode]; String get systolicAdd => localizedValues["systolic-add"][locale.languageCode]; String get diastolicAdd => localizedValues["systolic-add"][locale.languageCode]; + String get cmcHeading => localizedValues["cmc-heading"][locale.languageCode]; } diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index 66a83224..107e730c 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -95,7 +95,7 @@ class _BottomNavBarState extends State { icon: EvaIcons.calendar, activeIcon: EvaIcons.calendar, changeIndex: _changeIndex, - index: _index, + index: widget.index, currentIndex: 2, name: TranslationBase.of(context).bookAppo, ), diff --git a/lib/widgets/data_display/medical/time_line_widget.dart b/lib/widgets/data_display/medical/time_line_widget.dart index 6e946aa5..810fc0d8 100644 --- a/lib/widgets/data_display/medical/time_line_widget.dart +++ b/lib/widgets/data_display/medical/time_line_widget.dart @@ -72,9 +72,8 @@ class TimeLineWidget extends StatelessWidget { width: 15, height: 15, decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - border: Border.all( - color: Theme.of(context).primaryColor, width: 2), + color: Colors.yellow[700], + border: Border.all(color: Colors.yellow[700], width: 2), shape: BoxShape.rectangle, borderRadius: BorderRadius.all( Radius.circular(25.0), @@ -111,7 +110,7 @@ class TimeLineWidget extends StatelessWidget { child: Column( children: [ Texts( - appoitmentAllHistoryResul.clinicName, + appoitmentAllHistoryResul.clinicName.trim(), color: Colors.white, fontSize: 12.5, fontWeight: FontWeight.normal, @@ -132,9 +131,8 @@ class TimeLineWidget extends StatelessWidget { width: 15, height: 15, decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - border: Border.all( - color: Theme.of(context).primaryColor, width: 2), + color: Colors.yellow[700], + border: Border.all(color: Colors.yellow[700], width: 2), shape: BoxShape.rectangle, borderRadius: BorderRadius.all( Radius.circular(25.0), @@ -164,7 +162,7 @@ class TimeLineWidget extends StatelessWidget { height: 3, ), Texts( - appoitmentAllHistoryResul.doctorNameObj, + appoitmentAllHistoryResul.doctorNameObj.trim(), color: Colors.white, fontSize: 10.5, fontWeight: FontWeight.normal,