From c54146b3bae58bedbace3dc4ef7c1e02763f7042 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 30 Sep 2021 19:33:21 +0300 Subject: [PATCH] sechedule fix --- lib/config/config.dart | 4 +- lib/config/localized_values.dart | 3 +- lib/pages/BookAppointment/DoctorProfile.dart | 1 + lib/pages/MyAppointments/SchedulePage.dart | 50 +++++++++++++++----- lib/uitl/translations_delegate_base.dart | 1 + 5 files changed, 43 insertions(+), 16 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 0b3fc7ea..6bf726ac 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 0a34fd9f..c0d46acd 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1505,5 +1505,6 @@ const Map localizedValues = { "firstTri": {"en": "First Trimester Ends (12 weeks):", "ar": "تاريخ انتهاء الثلث الأول 12 اسبوع: "}, "secondTri": {"en": "Second Trimester Ends (27 weeks):", "ar": "تاريخ انتهاء الثلث الثاني 27 اسبوع: "}, "thirdTri": {"en": "Third Trimester, Estimated Due Date (40 weeks):", "ar": "تاريخ احتمال الولادة 40 اسبوع:"}, - "seeDoctorsList": {"en": "See List Of Doctors", "ar": "اعرض قائمة الأطباء"} + "seeDoctorsList": {"en": "See List Of Doctors", "ar": "اعرض قائمة الأطباء"}, + "doctorScheduleNot": {"en": "Doctor schedule not available", "ar": "جدول الطبيب غير متوفر"} }; diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 0dec924a..a1dc204c 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -117,6 +117,7 @@ class _DoctorProfileState extends State with TickerProviderStateM ), buttonIcon: 'assets/images/new/Boo_ Appointment.svg', showConfirmMessageDialog: false, + isNeedToShowButton: _tabController.index == 1, onTap: () { Navigator.push( context, diff --git a/lib/pages/MyAppointments/SchedulePage.dart b/lib/pages/MyAppointments/SchedulePage.dart index 10b52f10..5e7e478b 100644 --- a/lib/pages/MyAppointments/SchedulePage.dart +++ b/lib/pages/MyAppointments/SchedulePage.dart @@ -15,6 +15,10 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:provider/provider.dart'; class SchedulePage extends StatefulWidget { DoctorList doctorList; @@ -49,6 +53,7 @@ class _SchedulePageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getDoctorSchedule(doctorList), allowAny: true, @@ -97,13 +102,14 @@ class _SchedulePageState extends State { Expanded( flex: 1, child: Padding( - padding: EdgeInsets.only(left: 20), + padding: projectViewModel.isArabic ? EdgeInsets.only(right: 20) : EdgeInsets.only(left: 20), child: Row(children: [ Column( children: [ Texts( weeks[index][index2]['DayName'], fontSize: 13, + fontWeight: projectViewModel.isArabic ? FontWeight.w600 : FontWeight.w500, ), Texts( getDayMonths( @@ -123,21 +129,39 @@ class _SchedulePageState extends State { child: ClipRRect( borderRadius: const BorderRadius.all(Radius.circular(20.0)), child: Container( - padding: EdgeInsets.only(left: 10, right: 10, top: 20, bottom: 20), + padding: EdgeInsets.only(left: 10, right: 10, top: 15, bottom: 20), margin: EdgeInsets.only(left: 20, right: 20, top: 7, bottom: 7), decoration: BoxDecoration(boxShadow: [ - weeks[index][index2]['fullDay'] == false ? BoxShadow(color: Colors.green, offset: Offset(-5, 0)) : BoxShadow(), + DateUtil.convertStringToDate(weeks[index][index2]['Date']).toString().substring(0, 10) == DateTime.now().toString().substring(0, 10) + ? BoxShadow(color: Colors.green, offset: Offset(projectViewModel.isArabic ? 5 : -5, 0)) + : BoxShadow( + color: Colors.grey[100], + blurRadius: 5, + spreadRadius: 4, + offset: Offset(0, 10), + ), ], borderRadius: const BorderRadius.all(Radius.circular(10.0)), color: Colors.white), - child: Row( - children: [ - Expanded( - child: Texts( - weeks[index][index2]['WorkingHours'], - fontWeight: FontWeight.w400, - ), - ) - ], - ))), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + DateUtil.convertStringToDate(weeks[index][index2]['Date']).toString().substring(0, 10) == DateTime.now().toString().substring(0, 10) + ? Texts( + TranslationBase.of(context).today, + color: Colors.green, + fontWeight: FontWeight.w600, + fontSize: 12, + marginTop: 0, + ) + : SizedBox(), + Row( + children: [ + Expanded( + child: Texts( + weeks[index][index2]['WorkingHours'], + fontWeight: FontWeight.w500, + ), + ) + ], + ) + ]))), ) ], )))); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index cd16c74b..b01a4e95 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2252,6 +2252,7 @@ class TranslationBase { String get thirdTri => localizedValues["thirdTri"][locale.languageCode]; String get seeDoctorsList => localizedValues["seeDoctorsList"][locale.languageCode]; + String get doctorScheduleNot => localizedValues["doctorScheduleNot"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate {