Merge branch 'development_new_design_2.0' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into sultan_new_design

merge-requests/417/head
Sultan Khan 3 years ago
commit d514f64870

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="37.982" height="37.982" viewBox="0 0 37.982 37.982">
<path id="Path_4586" data-name="Path 4586" d="M18.991,0A18.991,18.991,0,1,0,37.982,18.991,19.013,19.013,0,0,0,18.991,0ZM9.5,17.8A3.555,3.555,0,0,1,11.2,14.777L8.75,12.793a1.187,1.187,0,1,1,1.491-1.847l5.052,4.088A3.561,3.561,0,1,1,9.5,17.8Zm16.29,12.688a1.188,1.188,0,0,1-1.678.04,7.42,7.42,0,0,0-10.234,0,1.187,1.187,0,1,1-1.636-1.721,9.787,9.787,0,0,1,13.5,0A1.187,1.187,0,0,1,25.785,30.492Zm3.447-17.7-2.455,1.985a3.549,3.549,0,1,1-4.09.256l5.054-4.088a1.187,1.187,0,1,1,1.491,1.847Z" fill="#ca3332"/>
</svg>

After

Width:  |  Height:  |  Size: 614 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="37.982" height="37.982" viewBox="0 0 37.982 37.982">
<path id="Path_4587" data-name="Path 4587" d="M18.991,0A18.991,18.991,0,1,0,37.982,18.991,19.013,19.013,0,0,0,18.991,0ZM9.5,14.243a2.374,2.374,0,1,1,2.374,2.374A2.378,2.378,0,0,1,9.5,14.243ZM27.383,28.895a1.192,1.192,0,0,1-1.681,0,9.72,9.72,0,0,0-13.429,0,1.187,1.187,0,0,1-1.678-1.678,11.869,11.869,0,0,1,16.788,0A1.188,1.188,0,0,1,27.383,28.895Zm-1.27-12.278a2.374,2.374,0,1,1,2.374-2.374A2.378,2.378,0,0,1,26.113,16.617Z" fill="#d56e6d"/>
</svg>

After

Width:  |  Height:  |  Size: 551 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="37.982" height="37.982" viewBox="0 0 37.982 37.982">
<path id="Path_4588" data-name="Path 4588" d="M18.991,0A18.991,18.991,0,1,0,37.982,18.991,19.013,19.013,0,0,0,18.991,0ZM9.5,14.243a2.374,2.374,0,1,1,2.374,2.374A2.378,2.378,0,0,1,9.5,14.243Zm15.43,14.243H13.056a1.187,1.187,0,1,1,0-2.374H24.926a1.187,1.187,0,1,1,0,2.374Zm1.187-11.869a2.374,2.374,0,1,1,2.374-2.374A2.378,2.378,0,0,1,26.113,16.617Z" fill="#ca8432"/>
</svg>

After

Width:  |  Height:  |  Size: 474 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="37.981" height="37.982" viewBox="0 0 37.981 37.982">
<path id="Path_4589" data-name="Path 4589" d="M18.991,0A18.991,18.991,0,1,0,37.981,18.991,19.013,19.013,0,0,0,18.991,0ZM8.308,14.243A3.561,3.561,0,1,1,11.869,17.8,3.565,3.565,0,0,1,8.308,14.243ZM27.382,27.382a11.866,11.866,0,0,1-16.785,0A1.187,1.187,0,0,1,12.275,25.7a9.72,9.72,0,0,0,13.429,0,1.187,1.187,0,0,1,1.678,1.678ZM26.112,17.8a3.561,3.561,0,1,1,3.561-3.561A3.565,3.565,0,0,1,26.112,17.8Z" fill="#8ca742"/>
</svg>

After

Width:  |  Height:  |  Size: 524 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="37.982" height="37.982" viewBox="0 0 37.982 37.982">
<path id="Path_4590" data-name="Path 4590" d="M18.991,0A18.991,18.991,0,1,0,37.982,18.991,19.013,19.013,0,0,0,18.991,0Zm7.122,11.869a2.374,2.374,0,1,1-2.374,2.374A2.378,2.378,0,0,1,26.113,11.869Zm-14.243,0A2.374,2.374,0,1,1,9.5,14.243,2.378,2.378,0,0,1,11.869,11.869Zm7.122,21.365a14.275,14.275,0,0,1-13.7-10.36,1.188,1.188,0,0,1,1.142-1.51H31.549a1.183,1.183,0,0,1,.945.47,1.2,1.2,0,0,1,.2,1.04A14.275,14.275,0,0,1,18.991,33.234Z" fill="#20a16a"/>
</svg>

After

Width:  |  Height:  |  Size: 558 B

@ -61,6 +61,9 @@ const Map localizedValues = {
'neverWait': {'en': 'Never wait in queue', 'ar': 'لا تنتظر في قائمة الانتظار'},
'reminderTitle': {'en': 'You have appointment with Dr. ', 'ar': 'لديك موعد مع د'},
'appointmentCalendar': {'en': 'Would you like to set a reminder for this appointment in your calendar?', 'ar': 'هل ترغب في تعيين تذكير لهذا الموعد في التقويم الخاص بك؟'},
'appointmentReminder': {'en': 'Would you like to set a reminder for this appointment?', 'ar': 'هل ترغب في تعيين تذكير لهذا الموعد؟'},
'prescriptionReminder': {'en': 'Would you like to set a reminder for this prescription?', 'ar': 'هل ترغب في تعيين تذكير لهذه الوصفة؟'},
'please_select_from_below_options': {'en': 'Please select from below options:', 'ar': 'الرجاء التحديد من الخيارات أدناه:'},
'appointmentSuccess': {'en': 'Appointment is successfully booked', 'ar': 'تم حجز الموعد بنجاح'},
'docQualifications': {'en': 'Doctor Qualifications', 'ar': 'مؤهلات الطبيب'},
'pressAgain': {'en': 'Press again to exit the app', 'ar': 'اضغط مرة أخرى للخروج من التطبيق'},
@ -916,7 +919,8 @@ const Map localizedValues = {
"iAcceptTermsConditions": {"en": "I Accept the Terms And Conditions", "ar": "أوافق على الشروط والأحكام"},
"YouCanPayByTheFollowingOptions": {"en": "You can pay by the following Options:", "ar": "يمكنك الدفع عن طريق الخيارات التالية:"},
"RRTDDetails": {
"en": "The RRT service provides medical service for urgent and stable cases, not life-threatening situations or extremities, and the service includes providing medical care from a complete medical team at home.",
"en":
"The RRT service provides medical service for urgent and stable cases, not life-threatening situations or extremities, and the service includes providing medical care from a complete medical team at home.",
"ar": "توفر خدمة فريق الاستجابة السريع RRT خدمه طبيه للحالات المستعجله والمستقره وليست الحالات المهدده للحياه او الاطراف ، وتشمل الخدمه تقديم رعايه طبيه من فريق طبي متكامل بالمنزل."
},
"rrtService": {"en": "RRT Service", "ar": "خدمة RRT"},
@ -1119,7 +1123,7 @@ const Map localizedValues = {
"en": "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location",
"ar": "\nتعرض هذه الخدمة أقرب فرع\n من بين جميع فروع مجموعة \nالحبيب الطبية بناءً على موقعك الحالي."
},
"NearestEr": {"en": "Nearest ER", "ar":"اقرب طوارئ"},
"NearestEr": {"en": "Nearest ER", "ar": "اقرب طوارئ"},
"infoCMC": {
"en": "Through this service, you can request a set of tests that help you and your doctor to understand the current health condition and then identify potential risks.",
"ar": "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة"
@ -1508,22 +1512,24 @@ const Map localizedValues = {
"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": "اعرض قائمة الأطباء"},
"covidQuestionnaire": { "en": "Please answer below questionnaire:", "ar": "الرجاء الإجابة على الاستبيان أدناه:" },
"covidBookAppo": { "en": "Booking Appointment For: ", "ar": "موعد الحجز لـ: " },
"emptySchedule": { "en": "Doctor has no schedule.", "ar": "لا يوجد جدول حضور مسجل للطبيب" },
"serviceNotAvailable": { "en": "Dear, this service is not available now, please try again later", "ar": "عزيزي المراجع, هذه الخدمة غير متوفرة الان يرجى المحاوله لاحقا"},
"covidQuestionnaire": {"en": "Please answer below questionnaire:", "ar": "الرجاء الإجابة على الاستبيان أدناه:"},
"covidBookAppo": {"en": "Booking Appointment For: ", "ar": "موعد الحجز لـ: "},
"emptySchedule": {"en": "Doctor has no schedule.", "ar": "لا يوجد جدول حضور مسجل للطبيب"},
"serviceNotAvailable": {"en": "Dear, this service is not available now, please try again later", "ar": "عزيزي المراجع, هذه الخدمة غير متوفرة الان يرجى المحاوله لاحقا"},
"doctorScheduleNot": {"en": "Doctor schedule not available", "ar": "جدول الطبيب غير متوفر"},
"RRTRequestSuccess": { "en": "Request has been sent successfully, You will be contacted soon.", "ar": "تم إرسال الطلب بنجاح ، وسيتم الاتصال بك باسرع وقت ممكن" },
"rateDoctorAppo": { "en": "Rate DR & Appointment", "ar": "معدل الدكتور والتعيين" },
"invoice": { "en": "Invoice", "ar": "الفاتورة" },
"requestedDate": { "en": "Reqeusted Date", "ar": "التاريخ " },
"callDuration": { "en": "Call Duration", "ar": "مدة الاتصال" },
"alreadyRated": { "en": "This appointment has been previously evaluated.", "ar": "تم تقييم هذا الموعد مسبقاً" },
"insuranceCompany": { "en": "Insurance Company", "ar": "شركة تأمين" },
"RRTRequestSuccess": {"en": "Request has been sent successfully, You will be contacted soon.", "ar": "تم إرسال الطلب بنجاح ، وسيتم الاتصال بك باسرع وقت ممكن"},
"rateDoctorAppo": {"en": "Rate DR & Appointment", "ar": "معدل الدكتور والتعيين"},
"invoice": {"en": "Invoice", "ar": "الفاتورة"},
"requestedDate": {"en": "Requested Date", "ar": "التاريخ "},
"callDuration": {"en": "Call Duration", "ar": "مدة الاتصال"},
"alreadyRated": {"en": "This appointment has been previously evaluated.", "ar": "تم تقييم هذا الموعد مسبقاً"},
"insuranceCompany": {"en": "Insurance Company", "ar": "شركة تأمين"},
"preferredBranch": {"en": "Preferred Branch", "ar": "الفرع المفضل"},
"selectPreferredBranch": {"en": "Select Preferred Branch", "ar": "اختر الفرع المفضل"},
"patientLocated": {"en": "Where the patient located", "ar": "اين موقع المريض"},
"otherInfo": {"en": "Other details", "ar": "تفاصيل أخرى"},
"medicalReport": {"en": "Medical Report", "ar": "تقرير طبي"},
"insuredPatient": {"en": "Insured Patient", "ar": "هل لدى المريض تامين؟"},
"rateDoctor": {"en": "Rate Doctor", "ar": "تقييم الطبيب"},
"rateAppointment": {"en": "Rate Appointment", "ar": "سعر التعيين"},
};

@ -16,9 +16,6 @@ class VaccineService extends BaseService {
body['To'] = "0";
body['From'] = "0";
// body['PatientID'] = 1018977;
// body['TokenID'] = "@dm!n";
hasError = false;
_vaccineList.clear();
await baseAppClient.post(GET_VACCINES,

@ -31,6 +31,11 @@ class PrescriptionsViewModel extends BaseViewModel {
List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList;
List<PrescriptionsList> get prescriptionsOrderList => filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital;
List<PrescriptionsList> prescriptionsOrderListByValue(filterValue) {
return filterValue == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital;
}
get isMedDeliveryAllowed => _prescriptionsService.isMedDeliveryAllowed;
getPrescriptions() async {
setState(ViewState.Busy);

@ -1,5 +1,6 @@
class HeaderModel {
String doctorName;
int doctorId;
String doctorImageURL;
List<String> speciality;
String invoiceNo;
@ -12,6 +13,6 @@ class HeaderModel {
int totalReviews;
String email;
HeaderModel(this.doctorName, this.doctorImageURL, this.speciality, this.invoiceNo, this.projectName, this.date, this.time, this.nationalityFlagURL, this.doctorRate, this.actualDoctorRate,
this.totalReviews, this.email);
HeaderModel(this.doctorName, this.doctorId, this.doctorImageURL, this.speciality, this.invoiceNo, this.projectName, this.date, this.time, this.nationalityFlagURL, this.doctorRate,
this.actualDoctorRate, this.totalReviews, this.email);
}

@ -10,13 +10,12 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
@ -28,13 +27,10 @@ class NewEReferralStepOnePage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel;
final Function changePageViewIndex;
const NewEReferralStepOnePage(
{Key key, this.createEReferralRequestModel, this.changePageViewIndex})
: super(key: key);
const NewEReferralStepOnePage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key);
@override
_NewEReferralStepOnePageState createState() =>
_NewEReferralStepOnePageState();
_NewEReferralStepOnePageState createState() => _NewEReferralStepOnePageState();
}
class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
@ -49,14 +45,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
// todo create a model for Country
// todo use country from the json
dynamic _selectedCountry = {
"name": "Saudi Arabia",
"name_ar": "المملكة العربية السعودية",
"code": "966",
"countryCode": "SA",
"pattern": "5xxxxxxxx",
"maxLength": 9
};
dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9};
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
@ -120,16 +109,14 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
),
Center(
child: Texts(
TranslationBase.of(context)
.referralRequesterInformation,
TranslationBase.of(context).referralRequesterInformation,
),
),
SizedBox(
height: 12,
),
NewTextFields(
hintText: TranslationBase.of(context)
.enterReferralRequesterName,
hintText: TranslationBase.of(context).enterReferralRequesterName,
controller: _nameTextController,
),
SizedBox(
@ -141,15 +128,10 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getCountryName()),
Icon(Icons.arrow_drop_down)
],
children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)],
),
),
),
@ -158,9 +140,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
),
MobileNumberTextFiled(
controller: _mobileTextController,
code: _selectedCountry == null
? "11"
: _selectedCountry["code"],
code: _selectedCountry == null ? "11" : _selectedCountry["code"],
),
SizedBox(
height: 12,
@ -175,21 +155,15 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
height: 12,
),
InkWell(
onTap: () => confirmSelectRelationTypeDialog(
model.relationTypes),
onTap: () => confirmSelectRelationTypeDialog(model.relationTypes),
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getRelationName()),
Icon(Icons.arrow_drop_down)
],
children: [Texts(getRelationName()), Icon(Icons.arrow_drop_down)],
),
),
),
@ -204,22 +178,19 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
padding: EdgeInsets.all(9),
child: DefaultButton(
TranslationBase.of(context).next,
(_nameTextController.text.isEmpty ||
_selectedRelation == null ||
_mobileTextController.text.isEmpty)
(_nameTextController.text.isEmpty || _selectedRelation == null || _mobileTextController.text.isEmpty)
? null
: () async {
SendActivationCodeForEReferralRequestModel
sendActivationCodeForEReferralRequestModel =
SendActivationCodeForEReferralRequestModel(
zipCode: _selectedCountry['code'],
patientMobileNumber:
int.parse(_mobileTextController.text),
);
await model.sendActivationCodeForEReferral(
sendActivationCodeForEReferralRequestModel);
showSMSDialog(model);
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
GifLoaderDialogUtils.showMyDialog(context);
SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = SendActivationCodeForEReferralRequestModel(
zipCode: _selectedCountry['code'],
patientMobileNumber: int.parse(_mobileTextController.text),
);
await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel);
GifLoaderDialogUtils.hideDialog(context);
showSMSDialog(model);
});
},
disabledColor: Colors.grey,
),
@ -228,30 +199,24 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
void submit(EReferralViewModel model, code) async {
final activationCode = code;
// ToDo call service
CheckActivationCodeForEReferralResponseModel
checkActivationCodeForEReferralRequestModel =
new CheckActivationCodeForEReferralResponseModel(
activationCode: activationCode);
await model.checkActivationCodeForEReferral(
checkActivationCodeForEReferralRequestModel);
if (model.state == ViewState.ErrorLocal) {
// Utils.showErrorToast(model.error);
} else {
Navigator.of(context).pop();
widget.changePageViewIndex(1);
widget.createEReferralRequestModel.requesterName =
_nameTextController.text;
widget.createEReferralRequestModel.requesterContactNo =
_selectedCountry['code'].toString().substring(1) +
_mobileTextController.text;
widget.createEReferralRequestModel.requesterRelationship =
_selectedRelation.iD;
}
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
GifLoaderDialogUtils.showMyDialog(context);
CheckActivationCodeForEReferralResponseModel checkActivationCodeForEReferralRequestModel = new CheckActivationCodeForEReferralResponseModel(activationCode: activationCode);
await model.checkActivationCodeForEReferral(checkActivationCodeForEReferralRequestModel);
if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context);
} else {
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop();
widget.changePageViewIndex(1);
widget.createEReferralRequestModel.requesterName = _nameTextController.text;
widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1) + _mobileTextController.text;
widget.createEReferralRequestModel.requesterRelationship = _selectedRelation.iD;
}
});
}
void confirmSelectRelationTypeDialog(
List<GetAllRelationshipTypeResponseModel> relations) {
void confirmSelectRelationTypeDialog(List<GetAllRelationshipTypeResponseModel> relations) {
showDialog(
context: context,
child: SelectRelationTypeDialog(
@ -302,9 +267,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
}
class MobileNumberTextFiled extends StatelessWidget {
const MobileNumberTextFiled(
{Key key, this.controller, this.code, this.onChange})
: super(key: key);
const MobileNumberTextFiled({Key key, this.controller, this.code, this.onChange}) : super(key: key);
final TextEditingController controller;
final String code;
@ -314,8 +277,7 @@ class MobileNumberTextFiled extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(5),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), color: Colors.white),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(15), color: Colors.white),
child: Row(textDirection: TextDirection.ltr, children: <Widget>[
Expanded(
flex: 1,
@ -337,8 +299,7 @@ class MobileNumberTextFiled extends StatelessWidget {
controller: controller,
onChanged: onChange,
keyboardType: TextInputType.phone,
decoration: InputDecoration(
border: InputBorder.none, hintText: '5xxxxxxxx'),
decoration: InputDecoration(border: InputBorder.none, hintText: '5xxxxxxxx'),
),
),
)

@ -11,12 +11,12 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
@ -29,13 +29,10 @@ class NewEReferralStepThreePage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel;
final Function changePageViewIndex;
const NewEReferralStepThreePage(
{Key key, this.createEReferralRequestModel, this.changePageViewIndex})
: super(key: key);
const NewEReferralStepThreePage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key);
@override
_NewEReferralStepThreePageState createState() =>
_NewEReferralStepThreePageState();
_NewEReferralStepThreePageState createState() => _NewEReferralStepThreePageState();
}
class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
@ -104,8 +101,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 9),
padding: const EdgeInsets.symmetric(horizontal: 9),
child: Texts(
TranslationBase.of(context).medicalReport,
color: Colors.grey,
@ -120,21 +116,14 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
context,
(String image, File file) {
setState(() {
EReferralAttachment
eReferralAttachment =
new EReferralAttachment(
fileName:
'image ${medicalReportImages.length + 1}.png',
base64String: image);
medicalReportImages
.add(eReferralAttachment);
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image);
medicalReportImages.add(eReferralAttachment);
});
},
);
},
child: Container(
margin: EdgeInsets.only(
left: 10, right: 10, top: 15),
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
height: 50,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
@ -144,10 +133,8 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
),
child: Center(
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(Icons.attach_file),
Texts(
@ -169,30 +156,24 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
margin: EdgeInsets.all(10),
padding: EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Icon(
FontAwesomeIcons.paperclip),
Icon(FontAwesomeIcons.paperclip),
SizedBox(
width: 8,
),
Texts(
medicalReportImages[index]
.fileName,
medicalReportImages[index].fileName,
),
],
),
InkWell(
onTap: () {
setState(() {
medicalReportImages.remove(
medicalReportImages[
index]);
medicalReportImages.remove(medicalReportImages[index]);
});
},
child: Icon(
@ -210,27 +191,22 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
),
Container(
padding: EdgeInsets.only(top: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Column(
children: [
Container(
width: double.infinity,
decoration: containerRadius(Colors.white, 12),
margin: EdgeInsets.only(left: 20, right: 20),
padding: EdgeInsets.only(
left: 10, right: 10, top: 12, bottom: 12),
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
child: Row(
children: [
Flexible(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context)
.preferredBranch,
TranslationBase.of(context).preferredBranch,
style: TextStyle(
fontSize: 11,
letterSpacing: -0.44,
@ -239,38 +215,24 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
),
Container(
height: 18,
child:
DropdownButtonHideUnderline(
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
key: projectDropdownKey,
hint: Text(TranslationBase.of(
context)
.selectPreferredBranch),
hint: Text(TranslationBase.of(context).selectPreferredBranch),
value: projectDropdownValue,
iconSize: 0,
isExpanded: true,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
color: Colors.black),
items:
projectsList.map((item) {
return new DropdownMenuItem<
String>(
value: item.mainProjectID
.toString() +
"," +
item.name.toString(),
child:
new Text(item.name),
style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black),
items: projectsList.map((item) {
return new DropdownMenuItem<String>(
value: item.mainProjectID.toString() + "," + item.name.toString(),
child: new Text(item.name),
);
}).toList(),
onChanged: (newValue) {
setState(() {
projectDropdownValue =
newValue;
print(
projectDropdownValue);
projectDropdownValue = newValue;
print(projectDropdownValue);
});
},
),
@ -289,9 +251,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
height: 12,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Column(
children: [
Row(
@ -337,25 +297,16 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
children: [
InkWell(
onTap: () {
ImageOptions.showImageOptions(context,
(String image, File file) {
ImageOptions.showImageOptions(context, (String image, File file) {
setState(() {
EReferralAttachment
eReferralAttachment =
new EReferralAttachment(
fileName:
'image ${medicalReportImages.length + 1}.png',
base64String: image);
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image);
insuredPatientImages = [
eReferralAttachment
];
insuredPatientImages = [eReferralAttachment];
});
});
},
child: Container(
margin: EdgeInsets.only(
left: 10, right: 10, top: 15),
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
height: 50,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
@ -365,10 +316,8 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
),
child: Center(
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(Icons.attach_file),
Texts(
@ -390,15 +339,12 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
margin: EdgeInsets.all(10),
padding: EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Icon(FontAwesomeIcons
.paperclip),
Icon(FontAwesomeIcons.paperclip),
SizedBox(
width: 8,
),
@ -410,9 +356,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
InkWell(
onTap: () {
setState(() {
insuredPatientImages.remove(
insuredPatientImages[
index]);
insuredPatientImages.remove(insuredPatientImages[index]);
});
},
child: Icon(
@ -444,44 +388,24 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
medicalReportImages.length == 0
? null
: () async {
this
.widget
.createEReferralRequestModel
.medicalReportAttachment = medicalReportImages;
this
.widget
.createEReferralRequestModel
.insuranceCardAttachment =
insuredPatientImages.length != 0
? insuredPatientImages[0]
: null;
this
.widget
.createEReferralRequestModel
.isInsuredPatient = isPatientInsured;
// ToDo make the preferred Branch info dynamic
this
.widget
.createEReferralRequestModel
.preferredBranchCode =
num.tryParse(projectDropdownValue.split(",")[0]);
this
.widget
.createEReferralRequestModel
.preferredBranchName =
projectDropdownValue.split(",")[1];
this
.widget
.createEReferralRequestModel
.otherRelationship = "";
await model.createEReferral(
this.widget.createEReferralRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(
message: "Referral sent successfully");
}
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
GifLoaderDialogUtils.showMyDialog(context);
this.widget.createEReferralRequestModel.medicalReportAttachment = medicalReportImages;
this.widget.createEReferralRequestModel.insuranceCardAttachment = insuredPatientImages.length != 0 ? insuredPatientImages[0] : null;
this.widget.createEReferralRequestModel.isInsuredPatient = isPatientInsured;
// ToDo make the preferred Branch info dynamic
this.widget.createEReferralRequestModel.preferredBranchCode = num.tryParse(projectDropdownValue.split(",")[0]);
this.widget.createEReferralRequestModel.preferredBranchName = projectDropdownValue.split(",")[1];
this.widget.createEReferralRequestModel.otherRelationship = "";
await model.createEReferral(this.widget.createEReferralRequestModel);
if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context);
Utils.showErrorToast(model.error);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: "Referral sent successfully");
}
});
},
disabledColor: Colors.grey,
color: Color(0xff359846),

@ -57,25 +57,29 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
return BaseView<EReferralViewModel>(
onModelReady: (model) async {
if (projectViewModel.isLogin) {
SearchEReferralRequestModel searchEReferralRequestModel =
new SearchEReferralRequestModel(
patientMobileNumber: (projectViewModel.user.outSA == 0
? "966"
: "971") +
projectViewModel.user.mobileNumber
.substring(1, projectViewModel.user.mobileNumber.length),
);
if (selectedCriteria.value == 1) {
searchEReferralRequestModel.identificationNo =
_searchTextController.text;
searchEReferralRequestModel.referralNumber = 0;
} else {
searchEReferralRequestModel.referralNumber =
int.parse(_searchTextController.text);
searchEReferralRequestModel.identificationNo =
projectViewModel.user.patientIdentificationNo;
}
await model.getEReferrals(searchEReferralRequestModel);
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
GifLoaderDialogUtils.showMyDialog(context);
SearchEReferralRequestModel searchEReferralRequestModel =
new SearchEReferralRequestModel(
patientMobileNumber: (projectViewModel.user.outSA == 0
? "966"
: "971") +
projectViewModel.user.mobileNumber
.substring(1, projectViewModel.user.mobileNumber.length),
);
if (selectedCriteria.value == 1) {
searchEReferralRequestModel.identificationNo =
_searchTextController.text;
searchEReferralRequestModel.referralNumber = 0;
} else {
searchEReferralRequestModel.referralNumber =
int.parse(_searchTextController.text);
searchEReferralRequestModel.identificationNo =
projectViewModel.user.patientIdentificationNo;
}
await model.getEReferrals(searchEReferralRequestModel);
GifLoaderDialogUtils.hideDialog(context);
});
}
},
builder: (_, model, widget) => AppScaffold(

@ -74,6 +74,7 @@ class _BookConfirmState extends State<BookConfirm> {
DoctorHeader(
headerModel: HeaderModel(
widget.doctor.name,
widget.doctor.doctorID,
widget.doctor.doctorImageURL,
widget.doctor.speciality,
"",
@ -307,7 +308,7 @@ class _BookConfirmState extends State<BookConfirm> {
AppoitmentAllHistoryResultList appo;
widget.service.insertLiveCareScheduleAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, context).then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully");
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
print(res['AppointmentNo']);
Future.delayed(new Duration(milliseconds: 500), () {

@ -60,6 +60,7 @@ class _BookSuccessState extends State<BookSuccess> {
DoctorHeader(
headerModel: HeaderModel(
widget.docObject.name,
widget.docObject.doctorID,
widget.docObject.doctorImageURL,
widget.docObject.speciality,
"",

@ -103,6 +103,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
DoctorHeader(
headerModel: HeaderModel(
widget.doctor.name,
widget.doctor.doctorID,
widget.doctor.doctorImageURL,
widget.doctor.speciality,
"",

@ -70,6 +70,7 @@ class _BookReminderPageState extends State<BookReminderPage> {
DoctorHeader(
headerModel: HeaderModel(
widget.docObject.name,
widget.docObject.doctorID,
widget.docObject.doctorImageURL,
widget.docObject.speciality,
"",
@ -191,7 +192,7 @@ class _BookReminderPageState extends State<BookReminderPage> {
disabledTextColor: Colors.white,
disabledColor: CustomColors.green,
onPressed: () async {
print(widget.patientShareResponse.appointmentNo);
print(widget.patientShareResponse.appointmentNo);
showReminderDialog(
context,
widget.dateTime,
@ -201,7 +202,7 @@ class _BookReminderPageState extends State<BookReminderPage> {
widget.appoTimeFormatted,
onSuccess: () {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
navigateToBookSuccess(context);
navigateToBookSuccess(context);
},
);
},

@ -99,7 +99,11 @@ class DoctorView extends StatelessWidget {
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
if (isShowFlag) Image.network(this.doctor.nationalityFlagURL, width: 22.0, height: 22.0)
Icon(
Icons.arrow_forward,
color: Theme.of(context).primaryColor,
),
// if (isShowFlag) Image.network(this.doctor.nationalityFlagURL, width: 22.0, height: 22.0)
],
),
],

@ -115,7 +115,7 @@ class _ReminderDialogState extends State<ReminderDialog> {
),
mHeight(20),
Text(
"When would you like to set a reminder for this appointment?",
TranslationBase.of(context).appointmentReminder,
style: TextStyle(
fontSize: 16,
color: Color(0xff2B353E),
@ -125,7 +125,7 @@ class _ReminderDialogState extends State<ReminderDialog> {
),
mHeight(20),
Text(
"Please select from below options:",
TranslationBase.of(context).pleaseSelectFromBelowOptions,
style: TextStyle(
fontSize: 12,
color: Color(0xff2B353E),
@ -135,7 +135,7 @@ class _ReminderDialogState extends State<ReminderDialog> {
),
ListTile(
contentPadding: EdgeInsets.zero,
title: const Text('Before 30 Mins'),
title: Text(TranslationBase.of(context).appoReminder30),
leading: Radio<int>(
value: 0,
groupValue: i,
@ -148,7 +148,7 @@ class _ReminderDialogState extends State<ReminderDialog> {
),
ListTile(
contentPadding: EdgeInsets.zero,
title: const Text('Before 1 Hour'),
title: Text(TranslationBase.of(context).appoReminder60),
leading: Radio<int>(
value: 1,
groupValue: i,
@ -161,7 +161,7 @@ class _ReminderDialogState extends State<ReminderDialog> {
),
ListTile(
contentPadding: EdgeInsets.zero,
title: const Text('Before 1 Hour and 30 Mins'),
title: Text(TranslationBase.of(context).appoReminder90),
leading: Radio<int>(
value: 2,
groupValue: i,
@ -174,7 +174,7 @@ class _ReminderDialogState extends State<ReminderDialog> {
),
ListTile(
contentPadding: EdgeInsets.zero,
title: const Text('Before 2 Hours'),
title: Text(TranslationBase.of(context).appoReminder120),
leading: Radio<int>(
value: 3,
groupValue: i,

@ -451,7 +451,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, context, widget.selectedProcedure.procedureID)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully");
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
getToDoCount();
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
} else {

@ -75,13 +75,14 @@ class _ErOptionsState extends State<ErOptions> {
),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: DdServicesPage()));
// Navigator.push(context, FadePage(page: DdServicesPage()));
},
child: MedicalProfileItem(
title: "ED",
imagePath: 'assets/images/new-design/AM.PNG',
subTitle: TranslationBase.of(context).service,
isPngImage: true,
isEnable: false,
),
),
InkWell(

@ -94,6 +94,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
DoctorHeader(
headerModel: HeaderModel(
widget.appo.doctorTitle + " " + widget.appo.doctorNameObj,
widget.appo.doctorID,
widget.appo.doctorImageURL,
widget.appo.doctorSpeciality,
"",
@ -107,7 +108,8 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
"",
//model.user.emailAddress,
),
isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true,
isNeedToShowButton:
(widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true,
buttonTitle: TranslationBase.of(context).schedule,
buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false,
@ -357,13 +359,15 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[0].patientNumber),
height: 6.0,
child: Container(
color: Colors.green[700],
Expanded(
child: Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[0].patientNumber),
height: 6.0,
child: Container(
color: Colors.green[700],
),
),
),
),

@ -162,13 +162,19 @@ class _SchedulePageState extends State<SchedulePage> {
weeks[index][index2]['WorkingHours'],
fontWeight: FontWeight.w500,
),
)
),
Icon(projectViewModel.isArabic
? Icons
.arrow_back_ios_outlined
: Icons
.arrow_forward_ios_outlined, size: 16.0),
],
)
]))),
)
),
],
))));
)
)));
},
)),
PageViewIndicator(

@ -41,10 +41,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
super.initState();
_tabController = TabController(length: 2, vsync: this);
_tabController.addListener(() {
setState(() {
});
setState(() {});
});
}
@ -61,7 +58,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
appBarTitle: widget.appointmentAllHistoryResultList.doctorTitle + " " + widget.appointmentAllHistoryResultList.doctorNameObj,
appBarTitle: widget.appointmentAllHistoryResultList.doctorTitle + " " + widget.appointmentAllHistoryResultList.doctorNameObj,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
@ -70,6 +67,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
DoctorHeader(
headerModel: HeaderModel(
widget.appointmentAllHistoryResultList.doctorTitle + " " + widget.appointmentAllHistoryResultList.doctorNameObj,
widget.appointmentAllHistoryResultList.doctorID,
widget.appointmentAllHistoryResultList.doctorImageURL,
widget.appointmentAllHistoryResultList.doctorSpeciality,
"",
@ -83,7 +81,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
"",
//model.user.emailAddress,
),
isNeedToShowButton: _tabController.index==0?true:projectViewModel.havePrivilege(15),
isNeedToShowButton: _tabController.index == 0 ? true : projectViewModel.havePrivilege(15),
showConfirmMessageDialog: true,
onRatingAndReviewTap: getDoctorRatingsDetails,
onTap: () {

@ -27,8 +27,7 @@ class InvoiceDetail extends StatefulWidget {
final DentalInvoiceDetailResponse dentalInvoiceDetailResponse;
final BuildContext context;
InvoiceDetail(this.doctor, this.listDentalAppointments,
this.dentalInvoiceDetailResponse, this.context);
InvoiceDetail(this.doctor, this.listDentalAppointments, this.dentalInvoiceDetailResponse, this.context);
@override
_InvoiceDetailState createState() => _InvoiceDetailState();
@ -50,11 +49,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
ProjectViewModel projectViewModel = Provider.of(context);
generateInvoiceDetails();
return AppScaffold(
appBarTitle: widget.doctor.doctorTitle != null
? widget.doctor.doctorTitle.toString()
: TranslationBase.of(context).dr +
" " +
widget.doctor.name.toString(),
appBarTitle: widget.doctor.doctorTitle != null ? widget.doctor.doctorTitle.toString() : TranslationBase.of(context).dr + " " + widget.doctor.name.toString(),
isShowAppBar: true,
isShowDecPage: false,
showNewAppBar: true,
@ -67,6 +62,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
DoctorHeader(
headerModel: HeaderModel(
widget.doctor.name,
widget.doctor.doctorID,
widget.doctor.doctorImageURL,
widget.doctor.speciality,
widget.doctor.clinicName,
@ -76,7 +72,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
widget.doctor.nationalityFlagURL,
widget.doctor.doctorRate,
widget.doctor.actualDoctorRate,
widget.doctor.noOfPatientsRate,
widget.doctor.noOfPatientsRate ?? 0,
projectViewModel.user.emailAddress),
onTap: () {
sendInvoiceEmail();
@ -86,8 +82,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Card(
elevation: 3.0,
shape: cardRadius(12),
margin: EdgeInsets.only(
left: 16, top: 8, right: 16, bottom: 16),
margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
@ -112,8 +107,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Card(
elevation: 3.0,
shape: cardRadius(12),
margin: EdgeInsets.only(
left: 16, top: 8, right: 16, bottom: 16),
margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
@ -121,29 +115,12 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
children: [
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Text(TranslationBase.of(context).cardDetail,
style: TextStyle(
color: Colors.black,
letterSpacing: -0.64,
fontSize: 18.0,
fontWeight: FontWeight.bold)),
child: Text(TranslationBase.of(context).cardDetail, style: TextStyle(color: Colors.black, letterSpacing: -0.64, fontSize: 18.0, fontWeight: FontWeight.bold)),
),
myRichText(
TranslationBase.of(context).insuranceCompany +
": ",
widget.dentalInvoiceDetailResponse
.listEInvoiceForDental[0].companyName,
projectViewModel.isArabic),
myRichText(TranslationBase.of(context).insuranceCompany + ": ", widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].companyName, projectViewModel.isArabic),
myRichText(
TranslationBase.of(context).insuranceID + ": ",
widget
.dentalInvoiceDetailResponse
.listEInvoiceForDental[0]
.insuranceID !=
null
? widget.dentalInvoiceDetailResponse
.listEInvoiceForDental[0].insuranceID
: "N/A",
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID != null ? widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID : "N/A",
projectViewModel.isArabic),
],
),
@ -155,8 +132,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Card(
elevation: 3.0,
shape: cardRadius(12),
margin: EdgeInsets.only(
left: 16, top: 8, right: 16, bottom: 16),
margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
@ -164,13 +140,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
children: [
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Text(
TranslationBase.of(context).totalBalance,
style: TextStyle(
letterSpacing: -0.64,
color: Colors.black,
fontSize: 18.0,
fontWeight: FontWeight.bold)),
child: Text(TranslationBase.of(context).totalBalance, style: TextStyle(letterSpacing: -0.64, color: Colors.black, fontSize: 18.0, fontWeight: FontWeight.bold)),
),
Container(
width: double.infinity,
@ -178,15 +148,10 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context).discount),
child: _getNormalText(TranslationBase.of(context).discount),
),
Expanded(
child: _getNormalText(
this.totalDiscount.toString() +
" " +
TranslationBase.of(context).sar,
isBold: true),
child: _getNormalText(this.totalDiscount.toString() + " " + TranslationBase.of(context).sar, isBold: true),
)
],
),
@ -198,26 +163,13 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context)
.totalVAT
.toString() +
" (" +
widget
.dentalInvoiceDetailResponse
.listEInvoiceForDental[0]
.listConsultation[0]
.vATPercentage
.toString() +
"%): "),
child: _getNormalText(TranslationBase.of(context).totalVAT.toString() +
" (" +
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].vATPercentage.toString() +
"%): "),
),
Expanded(
child: _getNormalText(
num.tryParse(this.totalVAT.toString())
.toStringAsFixed(2) +
" " +
TranslationBase.of(context).sar,
isBold: true),
child: _getNormalText(num.tryParse(this.totalVAT.toString()).toStringAsFixed(2) + " " + TranslationBase.of(context).sar, isBold: true),
)
],
),
@ -229,15 +181,10 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context).total),
child: _getNormalText(TranslationBase.of(context).total),
),
Expanded(
child: _getNormalText(
this.subTotal.toString() +
" " +
TranslationBase.of(context).sar,
isBold: true),
child: _getNormalText(this.subTotal.toString() + " " + TranslationBase.of(context).sar, isBold: true),
)
],
),
@ -249,15 +196,10 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
child: Row(
children: [
Expanded(
child: _getNormalText(
TranslationBase.of(context).paid),
child: _getNormalText(TranslationBase.of(context).paid),
),
Expanded(
child: _getNormalText(
this.grandTotal.toString() +
" " +
TranslationBase.of(context).sar,
isBold: true),
child: _getNormalText(this.grandTotal.toString() + " " + TranslationBase.of(context).sar, isBold: true),
)
],
),
@ -284,10 +226,8 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
List<ListConsultation> listConsultations = new List();
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation
.forEach((item) {
var i = listConsultations
.indexWhere((x) => x.procedureID == item.procedureID);
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.forEach((item) {
var i = listConsultations.indexWhere((x) => x.procedureID == item.procedureID);
if (i <= -1) {
listConsultations.add(item);
}
@ -308,16 +248,10 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
GifLoaderDialogUtils.showMyDialog(widget.context);
MyInvoicesService myInvoicesService = new MyInvoicesService();
myInvoicesService
.sendDentalAppointmentInvoiceEmail(
widget.listDentalAppointments.projectID,
widget.listDentalAppointments.appointmentNo,
widget.context)
.then((res) {
myInvoicesService.sendDentalAppointmentInvoiceEmail(widget.listDentalAppointments.projectID, widget.listDentalAppointments.appointmentNo, widget.context).then((res) {
GifLoaderDialogUtils.hideDialog(widget.context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(
message: TranslationBase.of(widget.context).emailSentSuccessfully);
AppToast.showSuccessToast(message: TranslationBase.of(widget.context).emailSentSuccessfully);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
@ -342,37 +276,17 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
],
),
);
for (int i = 0;
i <
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0]
.listConsultation.length;
i++) {
for (int i = 0; i < widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length; i++) {
tableRow.add(
TableRow(children: [
Utils.tableColumnValue(
'${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].procedureName}',
isLast: i ==
(widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0]
.listConsultation.length -
1)),
Utils.tableColumnValue(
'${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].quantity}',
isLast: i ==
(widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0]
.listConsultation.length -
1)),
Utils.tableColumnValue(
'${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].price.toString() + " " + TranslationBase.of(context).sar}',
isLast: i ==
(widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0]
.listConsultation.length -
1)),
Utils.tableColumnValue(
'${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].total.toString() + " " + TranslationBase.of(context).sar}',
isLast: i ==
(widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0]
.listConsultation.length -
1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].procedureName}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].quantity}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].price.toString() + " " + TranslationBase.of(context).sar}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].total.toString() + " " + TranslationBase.of(context).sar}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)),
]),
);
}

@ -38,6 +38,7 @@ class PrescriptionDetailsPage extends StatelessWidget {
DoctorHeader(
headerModel: HeaderModel(
prescriptions.doctorName,
prescriptions.doctorID,
prescriptions.doctorImageURL,
prescriptions.speciality,
"",
@ -179,8 +180,8 @@ class PrescriptionDetailsPage extends StatelessWidget {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
},
);
return;
showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {

@ -49,6 +49,7 @@ class PrescriptionItemsPage extends StatelessWidget {
DoctorHeader(
headerModel: HeaderModel(
prescriptions.doctorName,
prescriptions.doctorID,
prescriptions.doctorImageURL,
prescriptions.speciality,
"",

@ -1,5 +1,6 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -26,7 +27,7 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
_tabController = TabController(length: 3, vsync: this);
imagesInfo.add(ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/0.png'));
imagesInfo.add(ImagesInfo(
@ -74,7 +75,8 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
letterSpacing: -0.48,
),
tabs: [
Text(TranslationBase.of(context).prescriptions, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')),
Text(TranslationBase.of(context).byClinic, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')),
Text(TranslationBase.of(context).byHospital, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')),
Text(TranslationBase.of(context).orderLog, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')),
],
),
@ -84,9 +86,19 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
controller: _tabController,
children: <Widget>[
PrescriptionsPage(
FilterType.Clinic,
prescriptionsViewModel: model,
showOrderLog: () async {
_tabController.animateTo(1);
_tabController.animateTo(2);
await model.getPrescriptionsOrders(showLoading: true);
setState(() {});
},
),
PrescriptionsPage(
FilterType.Hospital,
prescriptionsViewModel: model,
showOrderLog: () async {
_tabController.animateTo(2);
await model.getPrescriptionsOrders(showLoading: true);
setState(() {});
},

@ -16,86 +16,66 @@ import 'package:provider/provider.dart';
class PrescriptionsPage extends StatelessWidget {
final VoidCallback showOrderLog;
final FilterType filterType;
final PrescriptionsViewModel prescriptionsViewModel;
const PrescriptionsPage({Key key, this.prescriptionsViewModel, this.showOrderLog}) : super(key: key);
const PrescriptionsPage(this.filterType, {Key key, this.prescriptionsViewModel, this.showOrderLog}) : super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
baseViewModel: prescriptionsViewModel,
body: FractionallySizedBox(
widthFactor: 1.0,
child: ListView(
baseViewModel: prescriptionsViewModel,
body: ListView.separated(
physics: BouncingScrollPhysics(),
children: <Widget>[
Row(
children: [
MyTabView(TranslationBase.of(context).byClinic, FilterType.Clinic, prescriptionsViewModel.filterType, () {
prescriptionsViewModel.setFilterType(FilterType.Clinic);
}),
MyTabView(TranslationBase.of(context).byHospital, FilterType.Hospital, prescriptionsViewModel.filterType, () {
prescriptionsViewModel.setFilterType(FilterType.Hospital);
}),
],
),
ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.only(top: 12),
separatorBuilder: (context, index) {
return Container(
height: 12,
margin: EdgeInsets.only(left: 21, right: 21),
// color: Color(0xffD9D9D9),
);
},
itemBuilder: (context, index) {
List<Prescriptions> prescriptionsList = prescriptionsViewModel.prescriptionsOrderList[index].prescriptionsList;
return AppExpandableNotifier(
title: prescriptionsViewModel.prescriptionsOrderList[index].filterName,
bodyWidget: ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) {
Prescriptions prescriptions = prescriptionsList[_index];
return DoctorCard(
onTap: () async {
final _shouldRecallApi = await Navigator.push(
context,
FadePage(
page: PrescriptionItemsPage(
prescriptions: prescriptions,
),
),
);
if (_shouldRecallApi != null) {
showOrderLog();
}
},
name: prescriptions.doctorName,
profileUrl: prescriptions.doctorImageURL,
rating: prescriptions.actualDoctorRate.toDouble(),
subName: prescriptions.name,
isInOutPatient: prescriptions.isInOutPatient,
isLiveCareAppointment: prescriptions.isLiveCareAppointment,
// appointmentTime: DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions
// .appointmentDate)),
date: DateUtil.convertStringToDate(prescriptions
.appointmentDate) //projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr( DateUtil.convertStringToDate(prescriptions.appointmentDate) ):DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(prescriptions.appointmentDate)),
);
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: prescriptionsList.length),
);
},
itemCount: prescriptionsViewModel.prescriptionsOrderList.length,
)
],
),
),
);
padding: EdgeInsets.only(top: 12),
separatorBuilder: (context, index) {
return Container(
height: 12,
margin: EdgeInsets.only(left: 21, right: 21),
// color: Color(0xffD9D9D9),
);
},
itemBuilder: (context, index) {
List<Prescriptions> prescriptionsList = prescriptionsViewModel.prescriptionsOrderListByValue(filterType)[index].prescriptionsList;
return AppExpandableNotifier(
title: prescriptionsViewModel.prescriptionsOrderListByValue(filterType)[index].filterName,
bodyWidget: ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) {
Prescriptions prescriptions = prescriptionsList[_index];
return DoctorCard(
onTap: () async {
final _shouldRecallApi = await Navigator.push(
context,
FadePage(
page: PrescriptionItemsPage(
prescriptions: prescriptions,
),
),
);
if (_shouldRecallApi != null) {
showOrderLog();
}
},
name: prescriptions.doctorName,
profileUrl: prescriptions.doctorImageURL,
rating: prescriptions.actualDoctorRate.toDouble(),
subName: prescriptions.name,
isInOutPatient: prescriptions.isInOutPatient,
isLiveCareAppointment: prescriptions.isLiveCareAppointment,
// appointmentTime: DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions
// .appointmentDate)),
date: DateUtil.convertStringToDate(prescriptions
.appointmentDate) //projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr( DateUtil.convertStringToDate(prescriptions.appointmentDate) ):DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(prescriptions.appointmentDate)),
);
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: prescriptionsList.length),
);
},
itemCount: prescriptionsViewModel.prescriptionsOrderListByValue(filterType).length,
));
}
}

@ -40,6 +40,7 @@ class RadiologyDetailsPage extends StatelessWidget {
DoctorHeader(
headerModel: new HeaderModel(
finalRadiology.doctorName,
finalRadiology.doctorID,
finalRadiology.doctorImageURL,
finalRadiology.speciality,
finalRadiology.invoiceNo.toString(),

@ -1,27 +1,35 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_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';
class RateAppointmentClinic extends StatefulWidget {
final AppointmentDetails appointmentDetails;
final String doctorNote;
final int doctorRate;
RateAppointmentClinic({this.appointmentDetails, this.doctorRate, this.doctorNote});
RateAppointmentClinic(
{this.appointmentDetails, this.doctorRate, this.doctorNote});
@override
_RateAppointmentClinicState createState() => _RateAppointmentClinicState();
@ -34,164 +42,253 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<AppointmentRateViewModel>(
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
baseViewModel: model,
body: Scaffold(
backgroundColor: Colors.grey[200],
appBar: AppBar(
elevation: 0,
textTheme: TextTheme(
headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
title: Text('Rate'),
leading: Builder(
builder: (BuildContext context) {
return IconButton(
icon: Icon(Icons.menu),
color: Colors.white,
onPressed: () => Scaffold.of(context).openDrawer(),
);
},
),
centerTitle: true,
),
drawer: SafeArea(child: AppDrawer()),
body: FractionallySizedBox(
widthFactor: 1,
child: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(12),
child: Column(
children: <Widget>[
SizedBox(
height: 25,
),
Texts(
TranslationBase.of(context).lastAppointment,
bold: true,
color: Colors.black,
),
SizedBox(
height: 25,
appBarTitle: TranslationBase.of(context).rateAppointment,
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 25,
),
Text(
TranslationBase.of(context).lastAppointment,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
height: 23 / 16),
),
SizedBox(
height: 25,
),
Card(
elevation: 0,
shape: cardRadius(10),
child: Padding(
padding: const EdgeInsets.only(
left: 12, right: 12, top: 12, bottom: 12),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
model.appointmentDetails.projectName,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.64,
height: 25 / 16),
),
Text(
model.appointmentDetails.startTime,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.64,
height: 25 / 16),
),
],
),
),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
LargeAvatar(
url:
'https://hmgwebservices.com/Images/Hospitals/' +
model.appointmentDetails.projectID
.toString() +
'.jpg',
width: 48,
height: 48,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
myRichText(
TranslationBase.of(context).clinic + ":",
model.appointmentDetails.projectName,
projectViewModel.isArabic),
myRichText(
TranslationBase.of(context).date + ":",
DateUtil.getMonthDayYearDateFormatted(
DateUtil.convertStringToDate(model
.appointmentDetails
.appointmentDate)),
projectViewModel.isArabic),
],
),
),
],
),
],
),
Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
shape: BoxShape.rectangle,
border: Border.all(color: Colors.white, width: 0.5),
),
),
),
SizedBox(
height: 12,
),
Container(
width: double.infinity,
child: Card(
elevation: 0,
shape: cardRadius(10),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
children: <Widget>[
SizedBox(
height: 8,
),
LargeAvatar(
url: 'https://hmgwebservices.com/Images/Hospitals/' + model.appointmentDetails.projectID.toString() + '.jpg',
name: model.appointmentDetails.clinicName,
width: 110,
height: 110,
),
SizedBox(
height: 22,
),
Texts(
model.appointmentDetails.projectName,
fontSize: 22,
fontWeight: FontWeight.bold,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).rateClinic,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
height: 23 / 16),
),
SizedBox(
height: 4,
height: 12,
),
Texts(
DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointmentDetails.appointmentDate)),
),
SizedBox(
height: 8,
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
...List.generate(
5,
(index) => AnimatedSwitcher(
duration: Duration(milliseconds: 300),
switchInCurve: Curves.elasticOut,
switchOutCurve: Curves.elasticIn,
transitionBuilder: (Widget child,
Animation<double> animation) {
return ScaleTransition(
child: child, scale: animation);
},
child: rating == (index + 1)
? Container(
margin: EdgeInsets.only(
left: 3.0, right: 3.0),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(100),
border: Border.all(
width: 3,
color: CustomColors.green)),
key: ValueKey<int>(rating),
child: IconButton(
onPressed: () {
setState(() {
rating = index + 1;
});
},
iconSize: 35,
icon: SvgPicture.asset(
'assets/images/new/appointment-rating/' +
(index + 1).toString() +
'.svg'),
),
)
: Container(
key: ValueKey<int>(rating),
child: IconButton(
onPressed: () {
setState(() {
rating = index + 1;
});
},
iconSize: 35,
icon: SvgPicture.asset(
'assets/images/new/appointment-rating/' +
(index + 1).toString() +
'.svg'),
),
),
),
)
],
),
Texts(model.appointmentDetails.startTime),
SizedBox(
height: 8,
)
],
),
),
SizedBox(
height: 12,
),
Center(
child: Texts(
TranslationBase.of(context).rateClinic,
textAlign: TextAlign.center,
)),
SizedBox(
height: 12,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
...List.generate(
5,
(index) => AnimatedSwitcher(
duration: Duration(milliseconds: 1000),
switchInCurve: Curves.elasticOut,
switchOutCurve: Curves.elasticIn,
transitionBuilder: (Widget child, Animation<double> animation) {
return ScaleTransition(child: child, scale: animation);
},
child: Container(
key: ValueKey<int>(rating),
child: IconButton(
//iconSize: 45.0,
onPressed: () {
setState(() {
rating = index + 1;
});
},
iconSize: rating == (index + 1) ? 60 : 40,
// Theme.of(context).hintColor,
icon: Image.asset('assets/images/' + (index + 1).toString() + '.png')),
),
),
)
],
),
SizedBox(height: 12),
SizedBox(
height: 12,
),
],
),
),
),
SizedBox(height: 12),
SizedBox(
height: 12,
),
],
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.15,
width: double.infinity,
color: Colors.grey[200],
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
onTap: () async {
if (rating > 0) {
),
bottomSheet: Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: DefaultButton(
TranslationBase.of(context).later,
() {
Navigator.pushReplacement(
context,
FadePage(
page: LandingPage(),
),
);
},
color: Color(0xffEAEAEA),
textColor: Color(0xff2B353E),
),
),
SizedBox(width: 10),
Expanded(
child: DefaultButton(
TranslationBase.of(context).submit,
rating <= 0
? null
: () {
model
.sendAppointmentRate(
rating, widget.appointmentDetails.appointmentNo, widget.appointmentDetails.projectID, widget.appointmentDetails.doctorID, widget.appointmentDetails.clinicID, note)
rating,
widget.appointmentDetails.appointmentNo,
widget.appointmentDetails.projectID,
widget.appointmentDetails.doctorID,
widget.appointmentDetails.clinicID,
note)
.then(
(value) => {
model
.sendDoctorRate(
widget.doctorRate,
widget.appointmentDetails.appointmentNo,
widget
.appointmentDetails.appointmentNo,
widget.appointmentDetails.projectID,
widget.appointmentDetails.doctorID,
widget.appointmentDetails.clinicID,
note,
widget.appointmentDetails.appointmentDate,
widget.appointmentDetails
.appointmentDate,
widget.appointmentDetails.doctorName,
widget.appointmentDetails.projectName,
widget.appointmentDetails.clinicName)
@ -205,36 +302,12 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
}),
},
);
} else {
AppToast.showErrorToast(message: 'please rate the clinic');
}
},
label: TranslationBase.of(context).submit,
disabled: (model.state == ViewState.Busy || rating == 0),
// loading: model.state == ViewState.BusyLocal,
textColor: Theme.of(context).backgroundColor),
},
color: Color(0xff359846),
disabledColor: Colors.grey,
),
SizedBox(
height: 12,
),
InkWell(
onTap: () {
Navigator.pushReplacement(
context,
FadePage(
page: LandingPage(),
),
);
},
child: Texts(
TranslationBase.of(context).later,
decoration: TextDecoration.underline,
color: HexColor('#151DFE'),
fontSize: 18,
),
)
],
),
),
],
),
),
),

@ -1,20 +1,17 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_clinic.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class RateAppointmentDoctor extends StatefulWidget {
@override
@ -30,214 +27,192 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
Widget build(BuildContext context) {
return BaseView<AppointmentRateViewModel>(
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
baseViewModel: model,
body: Scaffold(
backgroundColor: Colors.grey[200],
appBar: AppBar(
elevation: 0,
textTheme: TextTheme(
headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
title: Text(TranslationBase.of(context).rate),
leading: Builder(
builder: (BuildContext context) {
return IconButton(
icon: Icon(Icons.menu),
color: Colors.white,
onPressed: () => Scaffold.of(context).openDrawer(),
);
},
),
centerTitle: true,
),
drawer: SafeArea(child: AppDrawer()),
body: FractionallySizedBox(
widthFactor: 1,
child: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(12),
child: Column(
children: <Widget>[
SizedBox(
height: 25, //5598
),
Texts(
TranslationBase.of(context).lastVisit,
bold: true,
color: Colors.black,
),
SizedBox(
height: 25,
),
Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
shape: BoxShape.rectangle,
border: Border.all(color: Colors.white, width: 0.5),
),
appBarTitle: TranslationBase.of(context).rateDoctor,
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 25, //5598
),
Text(
TranslationBase.of(context).lastVisit,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
height: 23 / 16),
),
SizedBox(
height: 25,
),
Container(
child: DoctorView(
doctor: getDoctorObject(model),
isLiveCareAppointment: false,
isShowFlag: false,
),
),
SizedBox(
height: 12,
),
Container(
width: double.infinity,
child: Card(
elevation: 0,
shape: cardRadius(10),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
children: <Widget>[
SizedBox(
height: 8,
),
LargeAvatar(
name: model.appointmentDetails.doctorName,
url: model.appointmentDetails.doctorImageURL,
width: 110,
height: 110,
),
SizedBox(
height: 22,
),
Texts(
TranslationBase.of(context).dr + " " + model.appointmentDetails.doctorName,
bold: true,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).tapTitle,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
height: 23 / 16),
),
SizedBox(
height: 4,
height: 12,
),
Texts(
model.appointmentDetails.clinicName != null ? model.appointmentDetails.clinicName : "",
bold: true,
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
...List.generate(
5,
(index) => AnimatedSwitcher(
duration: Duration(milliseconds: 1000),
switchInCurve: Curves.elasticOut,
switchOutCurve: Curves.elasticIn,
transitionBuilder: (Widget child,
Animation<double> animation) {
return ScaleTransition(
child: child, scale: animation);
},
child: Container(
key: ValueKey<int>(rating),
child: IconButton(
iconSize: 45.0,
onPressed: () {
setState(() {
rating = index + 1;
});
},
color: rating >= (index + 1)
? Color.fromRGBO(255, 186, 0, 1.0)
: Colors.grey[400],
// Theme.of(context).hintColor,
icon: Icon(rating >= (index + 1)
? Icons.star
: Icons.star)),
),
),
)
],
),
SizedBox(
height: 8,
)
],
),
),
SizedBox(
height: 12,
),
Center(
child: Texts(
TranslationBase.of(context).tapTitle,
textAlign: TextAlign.center,
)),
SizedBox(
height: 12,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
...List.generate(
5,
(index) => AnimatedSwitcher(
duration: Duration(milliseconds: 1000),
switchInCurve: Curves.elasticOut,
switchOutCurve: Curves.elasticIn,
transitionBuilder:
(Widget child, Animation<double> animation) {
return ScaleTransition(
child: child, scale: animation);
},
child: Container(
key: ValueKey<int>(rating),
child: IconButton(
iconSize: 45.0,
onPressed: () {
setState(() {
rating = index + 1;
});
},
color: rating >= (index + 1)
? Color.fromRGBO(255, 186, 0, 1.0)
: Colors.grey[400],
// Theme.of(context).hintColor,
icon: Icon(rating >= (index + 1)
? EvaIcons.star
: EvaIcons.star)),
),
),
)
],
),
SizedBox(
height: 12,
),
Form(
key: formKey,
child: TextFields(
hintText: TranslationBase.of(context).notes,
minLines: 4,
maxLines: 4,
// validator: (value) {
// if (value.isEmpty)
// return 'Please enter your note';
// else if (rating == 0) return 'Rating cannot be \"0\"';
// return null;
// },
onChanged: (value) {
setState(() {
note = value;
});
},
),
),
SizedBox(
height: 12,
),
Card(
elevation: 0,
shape: cardRadius(10),
child: Padding(
padding: EdgeInsets.all(8.0),
child: TextField(
maxLines: 5,
decoration: InputDecoration.collapsed(
hintText: TranslationBase.of(context).notes,
hintStyle: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
height: 23 / 16)),
onChanged: (value) {
setState(() {
note = value;
});
},
))),
],
),
),
),
bottomSheet: Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: DefaultButton(
TranslationBase.of(context).later,
() {
Navigator.pushReplacement(
context,
FadePage(
page: LandingPage(),
),
),
SizedBox(
height: 12,
),
Container(
width: double.infinity,
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
onTap: () async {
final form = formKey.currentState;
if (form.validate() && rating>0 ) {
form.save();
Navigator.push(
context,
FadePage(
page: RateAppointmentClinic(
appointmentDetails:
model.appointmentDetails,
doctorNote: note,
doctorRate: rating,
),
),
);
}
},
label: TranslationBase.of(context).next,
disabled: (model.state == ViewState.BusyLocal || rating==0),
loading: model.state == ViewState.BusyLocal,
textColor: Theme.of(context).backgroundColor),
),
SizedBox(
height: 12,
),
InkWell(
onTap: () {
Navigator.pushReplacement(
context,
FadePage(
page: LandingPage(),
),
);
},
child: Texts(
TranslationBase.of(context).later,
decoration: TextDecoration.underline,
color: HexColor('#151DFE'),
fontSize: 18,
);
},
color: Color(0xffEAEAEA),
textColor: Color(0xff2B353E),
),
),
SizedBox(width: 10),
Expanded(
child: DefaultButton(
TranslationBase.of(context).next,
rating <= 0
? null
: () {
Navigator.push(
context,
FadePage(
page: RateAppointmentClinic(
appointmentDetails: model.appointmentDetails,
doctorNote: note,
doctorRate: rating,
),
),
)
],
),
)
],
);
},
// iconData: Icons.notifications_active,
color: Color(0xff359846),
disabledColor: Colors.grey,
),
),
),
],
),
),
),
);
}
DoctorList getDoctorObject(AppointmentRateViewModel model) {
DoctorList doctor = new DoctorList();
doctor.name = model.appointmentDetails.doctorName;
doctor.doctorImageURL = model.appointmentDetails.doctorImageURL;
doctor.clinicName = model.appointmentDetails.clinicName;
doctor.projectName = model.appointmentDetails.projectName;
doctor.actualDoctorRate = 5;
return doctor;
}
}

@ -108,6 +108,11 @@ class TranslationBase {
String get appointmentCalendar => localizedValues['appointmentCalendar'][locale.languageCode];
String get appointmentReminder => localizedValues['appointmentReminder'][locale.languageCode];
String get prescriptionReminder => localizedValues['prescriptionReminder'][locale.languageCode];
String get pleaseSelectFromBelowOptions => localizedValues['please_select_from_below_options'][locale.languageCode];
String get appointmentSuccess => localizedValues['appointmentSuccess'][locale.languageCode];
String get confirm => localizedValues['confirm'][locale.languageCode];
@ -2322,6 +2327,9 @@ class TranslationBase {
String get insuredPatientReferral => localizedValues["insuredPatient"][locale.languageCode];
String get rateDoctor => localizedValues["rateDoctor"][locale.languageCode];
String get rateAppointment => localizedValues["rateAppointment"][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -6,8 +6,7 @@ class GifLoaderContainer extends StatefulWidget {
_GifLoaderContainerState createState() => _GifLoaderContainerState();
}
class _GifLoaderContainerState extends State<GifLoaderContainer>
with TickerProviderStateMixin {
class _GifLoaderContainerState extends State<GifLoaderContainer> with TickerProviderStateMixin {
GifController controller1;
@override
@ -15,8 +14,9 @@ class _GifLoaderContainerState extends State<GifLoaderContainer>
controller1 = GifController(vsync: this);
WidgetsBinding.instance.addPostFrameCallback((_) {
controller1.repeat(
min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true);
try {
controller1.repeat(min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true);
} catch (ex) {}
});
super.initState();
}
@ -30,14 +30,13 @@ class _GifLoaderContainerState extends State<GifLoaderContainer>
@override
Widget build(BuildContext context) {
return Center(
//progress-loading.gif
//progress-loading.gif
child: Container(
// margin: EdgeInsets.only(bottom: 40),
child: GifImage(
controller: controller1,
image: AssetImage(
"assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"),
),
));
// margin: EdgeInsets.only(bottom: 40),
child: GifImage(
controller: controller1,
image: AssetImage("assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"),
),
));
}
}
}

@ -44,6 +44,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
DoctorHeader(
headerModel: HeaderModel(
widget.patientLabOrder.doctorName,
widget.patientLabOrder.doctorID,
widget.patientLabOrder.doctorImageURL,
widget.patientLabOrder.speciality,
widget.billNo,

@ -94,17 +94,19 @@ class DoctorCard extends StatelessWidget {
),
)
: BoxDecoration(),
child: isShowInOutPatient ? RotatedBox(
quarterTurns: 3,
child: Text(
isLiveCareAppointment
? TranslationBase.of(context).liveCare.toLowerCase().capitalizeFirstofEach
: !isInOutPatient
? TranslationBase.of(context).inPatient.toLowerCase().capitalizeFirstofEach
: TranslationBase.of(context).outpatient.toLowerCase().capitalizeFirstofEach,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w700, color: Colors.white, letterSpacing: -0.2, height: 16 / 10),
),
) : Container(),
child: isShowInOutPatient
? RotatedBox(
quarterTurns: 3,
child: Text(
isLiveCareAppointment
? TranslationBase.of(context).liveCare.toLowerCase().capitalizeFirstofEach
: !isInOutPatient
? TranslationBase.of(context).inPatient.toLowerCase().capitalizeFirstofEach
: TranslationBase.of(context).outpatient.toLowerCase().capitalizeFirstofEach,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w700, color: Colors.white, letterSpacing: -0.2, height: 16 / 10),
),
)
: Container(),
),
Expanded(
child: Padding(
@ -147,6 +149,7 @@ class DoctorCard extends StatelessWidget {
),
Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
LargeAvatar(
name: name,
@ -201,14 +204,24 @@ class DoctorCard extends StatelessWidget {
],
),
),
if (onEmailTap != null && projectViewModel.havePrivilege(17))
InkWell(
onTap: onEmailTap,
child: Icon(
Icons.email,
color: Theme.of(context).primaryColor,
),
SizedBox(
height: 48,
child: Align(
alignment: Alignment.bottomCenter,
child: (onEmailTap != null && projectViewModel.havePrivilege(17))
? InkWell(
onTap: onEmailTap,
child: Icon(
Icons.email,
color: Theme.of(context).primaryColor,
),
)
: Icon(
Icons.arrow_forward,
color: Theme.of(context).primaryColor,
),
),
),
],
),
],

@ -1,6 +1,10 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
@ -27,7 +31,7 @@ class DoctorHeader extends StatelessWidget {
this.isNeedToShowButton = true,
this.buttonIcon,
this.showConfirmMessageDialog = true,
this.onRatingAndReviewTap})
@required this.onRatingAndReviewTap})
: super(key: key);
ProjectViewModel projectViewModel;
@ -100,7 +104,11 @@ class DoctorHeader extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: onRatingAndReviewTap,
onTap: () {
if ((headerModel?.totalReviews ?? 0) > 0) {
getDoctorRatingsDetails(context);
}
},
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
@ -122,10 +130,10 @@ class DoctorHeader extends StatelessWidget {
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: onRatingAndReviewTap != null ? Colors.blue[600] : Color(0xff2B353E),
color: (headerModel?.totalReviews ?? 0) > 0 ? Colors.blue[600] : Color(0xff2B353E),
letterSpacing: -0.48,
height: 18 / 12,
decoration: onRatingAndReviewTap != null ? TextDecoration.underline : null,
decoration: (headerModel?.totalReviews ?? 0) > 0 ? TextDecoration.underline : null,
),
),
],
@ -141,7 +149,8 @@ class DoctorHeader extends StatelessWidget {
},
child: Container(
padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15),
decoration: BoxDecoration(color: Color(0XFFD02127), borderRadius: projectViewModel.isArabic ? BorderRadius.only(topRight: Radius.circular(10)) : BorderRadius.only(topLeft: Radius.circular(10))),
decoration: BoxDecoration(
color: Color(0XFFD02127), borderRadius: projectViewModel.isArabic ? BorderRadius.only(topRight: Radius.circular(10)) : BorderRadius.only(topLeft: Radius.circular(10))),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
@ -175,4 +184,220 @@ class DoctorHeader extends StatelessWidget {
),
);
}
void getDoctorRatingsDetails(context) {
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorRateDetails> doctorDetailsList = List();
DoctorsListService service = new DoctorsListService();
service.getDoctorsRatingDetails(headerModel.doctorId, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
doctorDetailsList.clear();
res['DoctorRatingDetailsList'].forEach((v) {
doctorDetailsList.add(new DoctorRateDetails.fromJson(v));
});
showRatingDialog(doctorDetailsList, context);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
void showRatingDialog(List<DoctorRateDetails> doctorDetailsList, context) {
showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: Dialog(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
// height: 400.0,
width: MediaQuery.of(context).size.width * 0.8,
color: Colors.white,
child: Column(
children: [
Container(
alignment: Alignment.center,
width: MediaQuery.of(context).size.width,
color: Theme.of(context).primaryColor,
margin: EdgeInsets.only(bottom: 5.0),
padding: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.white))),
Container(margin: EdgeInsets.only(top: 0.0), child: Text(this.headerModel.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: RatingBar.readOnly(
initialRating: this.headerModel.actualDoctorRate.toDouble(),
size: 35.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(this.headerModel.totalReviews.toString() + " " + TranslationBase.of(context).reviews, style: TextStyle(fontSize: 14.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Container(
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[0].patientNumber),
height: 6.0,
child: Container(
color: Colors.green[700],
),
),
),
],
),
),
Container(
child: Row(
children: [
Container(
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).v_good, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[1].patientNumber),
height: 6.0,
child: Container(
color: Color(0xffB7B723),
),
),
),
],
),
),
Container(
child: Row(
children: [
Container(
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).good, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[2].patientNumber),
height: 6.0,
child: Container(
color: Color(0xffEBA727),
),
),
),
],
),
),
Container(
child: Row(
children: [
Container(
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).average, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[3].patientNumber),
height: 6.0,
child: Container(
color: Color(0xffEB7227),
),
),
),
],
),
),
Container(
child: Row(
children: [
Container(
width: 100.0,
margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0),
child: Text(TranslationBase.of(context).below_average, style: TextStyle(fontSize: 13.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
child: SizedBox(
width: getRatingWidth(doctorDetailsList[4].patientNumber),
height: 6.0,
child: Container(
color: Color(0xffE20C0C),
),
),
),
],
),
),
Container(margin: EdgeInsets.only(top: 40.0), child: Divider()),
Container(
margin: EdgeInsets.only(top: 0.0),
child: Align(
alignment: FractionalOffset.bottomCenter,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width,
height: 40.0,
child: RaisedButton(
elevation: 0.0,
color: Colors.white,
textColor: Colors.red,
hoverColor: Colors.transparent,
focusColor: Colors.transparent,
highlightColor: Colors.transparent,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
Navigator.of(context).pop();
},
child: Text(TranslationBase.of(context).cancel, style: TextStyle(fontSize: 18.0)),
),
),
),
),
],
),
),
],
),
),
),
);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
}
double getRatingWidth(int patientNumber) {
var width = (patientNumber / this.headerModel.totalReviews) * 100;
return width;
}
}

Loading…
Cancel
Save