Compare commits

...

8 Commits

@ -337,7 +337,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari
var CHANNEL = 3; var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958'; var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20'; var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 11.1; var VERSION_ID = 30.1;
var SETUP_ID = '91877'; var SETUP_ID = '91877';
var LANGUAGE = 2; var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0; // var PATIENT_OUT_SA = 0;
@ -618,6 +618,9 @@ var PAYFORT_PROD_URL = 'https://paymentservices.payfort.com/FortAPI/paymentApi';
var CHECK_PATIENT_NPHIES_ELIGIBILITY = 'Services/Doctors.svc/REST/checkPatientInsuranceCompanyValidity'; var CHECK_PATIENT_NPHIES_ELIGIBILITY = 'Services/Doctors.svc/REST/checkPatientInsuranceCompanyValidity';
var CONVERT_PATIENT_TO_CASH = 'Services/Doctors.svc/REST/deActivateInsuranceCompany'; var CONVERT_PATIENT_TO_CASH = 'Services/Doctors.svc/REST/deActivateInsuranceCompany';
var GET_BLOOD_DONATION_PROJECTS_LIST = 'Services/OUTPs.svc/REST/BD_getProjectsHaveBDClinics';
var GET_BLOOD_DONATION_FREE_SLOTS = 'Services/OUTPs.svc/REST/BD_GetFreeSlots';
class AppGlobal { class AppGlobal {
static var context; static var context;

@ -1898,5 +1898,6 @@ const Map localizedValues = {
"continueCash": {"en": "Continue as cash", "ar": "تواصل نقدا"}, "continueCash": {"en": "Continue as cash", "ar": "تواصل نقدا"},
"updateInsurance": {"en": "Update insurance", "ar": "تحديث التأمين"}, "updateInsurance": {"en": "Update insurance", "ar": "تحديث التأمين"},
"downloadReport": {"en": "Download Report", "ar": "تحميل تقرير المختبر"}, "downloadReport": {"en": "Download Report", "ar": "تحميل تقرير المختبر"},
"selectHospitalBloodDonation": {"en": "Please select the hospital you want to book an appointment with: ", "ar": "يرجى اختيار المستشفى الذي تريد حجز موعد معه:"},
"habibCallCenter": {"en": "Please contact AlHabib call center to update your insurance manually.", "ar": "يرجى الاتصال بمركز اتصال الحبيب لتحديث التأمين الخاص بك يدوياً."}, "habibCallCenter": {"en": "Please contact AlHabib call center to update your insurance manually.", "ar": "يرجى الاتصال بمركز اتصال الحبيب لتحديث التأمين الخاص بك يدوياً."},
}; };

@ -0,0 +1,25 @@
class BloodDonationFreeSlotsResponseModel {
int clinicID;
int doctorID;
String freeTimeSlots;
int projectID;
BloodDonationFreeSlotsResponseModel(
{this.clinicID, this.doctorID, this.freeTimeSlots, this.projectID});
BloodDonationFreeSlotsResponseModel.fromJson(Map<String, dynamic> json) {
clinicID = json['ClinicID'];
doctorID = json['DoctorID'];
freeTimeSlots = json['FreeTimeSlots'];
projectID = json['ProjectID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ClinicID'] = this.clinicID;
data['DoctorID'] = this.doctorID;
data['FreeTimeSlots'] = this.freeTimeSlots;
data['ProjectID'] = this.projectID;
return data;
}
}

@ -0,0 +1,46 @@
class BloodDonationProjectsListResponse {
int rowID;
int iD;
int projectID;
int numberOfRooms;
bool isActive;
int createdBy;
String createdOn;
dynamic editedBy;
dynamic editedON;
String projectName;
dynamic projectNameN;
BloodDonationProjectsListResponse(
{this.rowID, this.iD, this.projectID, this.numberOfRooms, this.isActive, this.createdBy, this.createdOn, this.editedBy, this.editedON, this.projectName, this.projectNameN});
BloodDonationProjectsListResponse.fromJson(Map<String, dynamic> json) {
rowID = json['RowID'];
iD = json['ID'];
projectID = json['ProjectID'];
numberOfRooms = json['NumberOfRooms'];
isActive = json['IsActive'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
editedBy = json['EditedBy'];
editedON = json['EditedON'];
projectName = json['ProjectName'];
projectNameN = json['ProjectNameN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['RowID'] = this.rowID;
data['ID'] = this.iD;
data['ProjectID'] = this.projectID;
data['NumberOfRooms'] = this.numberOfRooms;
data['IsActive'] = this.isActive;
data['CreatedBy'] = this.createdBy;
data['CreatedOn'] = this.createdOn;
data['EditedBy'] = this.editedBy;
data['EditedON'] = this.editedON;
data['ProjectName'] = this.projectName;
data['ProjectNameN'] = this.projectNameN;
return data;
}
}

@ -70,4 +70,31 @@ class BloodDonationService extends BaseService {
throw error; throw error;
} }
} }
Future<Map> getBloodDonationProjectsList() async {
Map<String, dynamic> request;
request = {};
dynamic localRes;
await baseAppClient.post(GET_BLOOD_DONATION_PROJECTS_LIST, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getBloodDonationFreeSlots(int clinicID, int projectID) async {
Map<String, dynamic> request;
request = {"ClinicID": clinicID, "ProjectID": projectID};
dynamic localRes;
await baseAppClient.post(GET_BLOOD_DONATION_FREE_SLOTS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
} }

@ -150,7 +150,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217; // body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; // body['MobileNo'] = "531940021";
// body['PatientID'] = 4767512; //3844083 // body['PatientID'] = 3648924; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574

@ -5,12 +5,15 @@ import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dar
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
import 'package:diplomaticquarterapp/pages/Blood/blood_donation_book_appointment.dart';
import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart'; import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -21,7 +24,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
enum Gender { Male, Female, NON } enum Gender { Male, Female, NON }
enum Blood { Oplus, Ominus, Aplus, Aminus, Bplus, Bminus, ABplus, ABminus, NON } enum Blood { Oplus, Ominus, Aplus, Aminus, Bplus, Bminus, ABplus, ABminus, NON }
class BloodDonationPage extends StatefulWidget { class BloodDonationPage extends StatefulWidget {
@ -134,7 +139,6 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
), ),
SizedBox(height: 12), SizedBox(height: 12),
if (projectProvider.isLogin && model.state != ViewState.Busy) if (projectProvider.isLogin && model.state != ViewState.Busy)
CommonDropDownView( CommonDropDownView(
TranslationBase.of(context).city, TranslationBase.of(context).city,
model.CitiesModelList.isNotEmpty model.CitiesModelList.isNotEmpty
@ -272,10 +276,46 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
), ),
), ),
), ),
DefaultButton( Container(
TranslationBase.of(context).save, color: CustomColors.appBackgroudGreyColor,
checkedValue margin: EdgeInsets.all(14),
? () async { height: 45.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Expanded(
flex: 1,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
height: 45.0,
child: CustomTextButton(
backgroundColor: CustomColors.green,
elevation: 0,
onPressed: () {
Navigator.push(context, FadePage(page: BloodDonationBookAppointment()));
},
child: Text(TranslationBase.of(context).bookAppo.toUpperCase(),
style: TextStyle(
fontSize: 16.0,
color: Colors.white,
)),
),
),
),
mWidth(7),
Expanded(
flex: 1,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
height: 45.0,
child: CustomTextButton(
backgroundColor: Color(0xffc5272d),
elevation: 0,
onPressed: () async {
if (_selectedHospital == null) { if (_selectedHospital == null) {
AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); AppToast.showErrorToast(message: TranslationBase.of(context).selectCity);
return; return;
@ -290,10 +330,36 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
} else { } else {
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model.error);
} }
} },
: null, child: Text(TranslationBase.of(context).save.toUpperCase(), style: TextStyle(fontSize: 16.0, color: Colors.white)),
disabledColor: CustomColors.grey2, ),
).insideContainer ),
),
],
),
),
// DefaultButton(
// TranslationBase.of(context).save,
// checkedValue
// ? () async {
// if (_selectedHospital == null) {
// AppToast.showErrorToast(message: TranslationBase.of(context).selectCity);
// return;
// }
// bloodDetails.city = _selectedHospital.description;
// bloodDetails.cityCode = _selectedHospital.iD.toString();
// bloodDetails.gender = _selectedGenderIndex;
// bloodDetails.bloodGroup = getBlood(_selectedBloodTypeIndex);
// await model.updateBloodGroup(bloodDetails);
// if (model.state == ViewState.Idle) {
// AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage);
// } else {
// AppToast.showErrorToast(message: model.error);
// }
// }
// : null,
// disabledColor: CustomColors.grey2,
// ).insideContainer
], ],
), ),
), ),

File diff suppressed because one or more lines are too long

@ -0,0 +1,502 @@
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_donation_free_slots_response.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_donation_projects_list_response.dart';
import 'package:diplomaticquarterapp/core/service/blood/blood_donation_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
import 'package:diplomaticquarterapp/pages/Blood/blood_donation_appointment_terms_conditions.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';
import '../AlHabibMedicalService/h2o/h20_setting.dart';
class BloodDonationBookAppointment extends StatefulWidget {
const BloodDonationBookAppointment();
static bool areSlotsAvailable = false;
static DateTime selectedAppoDateTime;
static String selectedDate;
static String selectedTime;
@override
State<BloodDonationBookAppointment> createState() => _BloodDonationBookAppointmentState();
}
class _BloodDonationBookAppointmentState extends State<BloodDonationBookAppointment> with TickerProviderStateMixin {
Map<DateTime, List> _events;
AnimationController _animationController;
CalendarController _calendarController;
List<BloodDonationProjectsListResponse> bloodDonationProjectsListResponse = [];
int _selectedProjectID = 0;
int _clinicID = 0;
int _doctorID = 0;
String selectedProjectName = "";
List<TimeSlot> docFreeSlots = [];
List<TimeSlot> dayEvents = [];
var selectedDate = "";
dynamic selectedDateJSON;
dynamic jsonFreeSlots;
int selectedButtonIndex = 0;
List<BloodDonationFreeSlotsResponseModel> bloodDonationFreeSlotsResponse = [];
ProjectViewModel projectViewModel;
ScrollController _scrollController;
var checkedValue = false;
@override
void initState() {
final _selectedDay = DateTime.now();
super.initState();
_events = {
_selectedDay: ['Event A0']
};
_scrollController = new ScrollController();
_calendarController = CalendarController();
_animationController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 50),
);
WidgetsBinding.instance.addPostFrameCallback((_) {
getBloodDonationProjectsList();
});
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
backgroundColor: Color(0xffF7F7F7),
showNewAppBarTitle: true,
isShowDecPage: true,
description: TranslationBase.of(context).bloodDonationInfo,
appBarTitle: TranslationBase.of(context).bloodD,
body: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.all(21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(TranslationBase.of(context).selectHospitalBloodDonation, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
mHeight(12),
CommonDropDownView(
TranslationBase.of(context).selectProject,
selectedProjectName,
() {
List<RadioSelectionDialogModel> list = [];
bloodDonationProjectsListResponse.forEach((element) {
list.add(RadioSelectionDialogModel(element.projectName, element.projectID));
});
showDialog(
context: context,
builder: (cxt) => RadioSelectionDialog(
listData: list,
selectedIndex: 0,
onValueSelected: (index) {
print(index);
_selectedProjectID = index;
selectedProjectName = bloodDonationProjectsListResponse.firstWhere((element) => element.projectID == index).projectName;
getBloodDonationFreeSlots();
setState(() {});
},
),
);
},
).withBorderedContainer,
mHeight(12),
Container(
decoration: cardRadius(12),
child: _buildTableCalendarWithBuilders(projectViewModel),
),
mHeight(12),
Text(selectedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
mHeight(8),
BloodDonationBookAppointment.areSlotsAvailable
? Container(
height: 40,
child: ListView.builder(
controller: _scrollController,
scrollDirection: Axis.horizontal,
itemCount: dayEvents.length,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 0 : 5.0, left: index == 0 ? 0 : 5),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
side: BorderSide(
color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border
style: BorderStyle.solid, //Style of the border
width: 1.5, //width of the border
),
),
minWidth: MediaQuery.of(context).size.width * 0.2,
child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)),
);
},
),
)
: Center(
child: Padding(
padding: const EdgeInsets.only(left: 12.0, right: 12.0),
child: Text(TranslationBase.of(context).noSlotsError, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.grey)),
),
),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
TranslationBase.of(context).viewTermsConditions + ":",
style: TextStyle(fontWeight: FontWeight.w600, color: Color(0xff2E303A), fontSize: 14, letterSpacing: -0.56),
),
InkWell(
onTap: () {
Navigator.of(context).push(FadePage(page: BloodDonationAppointmentTermsConditions()));
},
child: Text(
TranslationBase.of(context).clickHere,
style: TextStyle(fontWeight: FontWeight.w600, color: Colors.blue, fontSize: 14, letterSpacing: -0.56),
),
)
],
),
SizedBox(height: 12),
Row(
children: [
Checkbox(
onChanged: (bool value) {
setState(() {
checkedValue = value;
});
},
value: checkedValue,
activeColor: Color(0xFFc5272d),
),
Text(
TranslationBase.of(context).iAgreeToTheTermsAndConditions,
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold),
),
],
),
],
),
),
),
bottomSheet: Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.081,
width: double.infinity,
padding: EdgeInsets.all(12.0),
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: DefaultButton(
TranslationBase.of(context).bookAppo,
() async {
if (BloodDonationBookAppointment.areSlotsAvailable) {
if(checkedValue) {
insertBloodDonationAppointment();
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms);
}
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot);
}
},
textColor: Colors.white,
color: CustomColors.green,
),
),
],
),
),
);
}
void insertBloodDonationAppointment() {
DoctorsListService service = new DoctorsListService();
final timeSlot = BloodDonationBookAppointment.selectedAppoDateTime;
GifLoaderDialogUtils.showMyDialog(context);
service
.insertAppointment(
_doctorID, _clinicID, _selectedProjectID, BloodDonationBookAppointment.selectedTime, BloodDonationBookAppointment.selectedDate, 45, context, null, null, null, projectViewModel)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
Navigator.of(context).pop();
} else {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: res['ErrorEndUserMessage'],
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () async {
// openAppSettings();
Navigator.pop(context);
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
// AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: err,
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () async {
// openAppSettings();
Navigator.pop(context);
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
});
}
void _onDaySelected(DateTime day, ProjectViewModel projectViewModel) {
final DateFormat formatter = DateFormat('yyyy-MM-dd');
setState(() {
this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, projectViewModel.isArabic ? "ar" : "en");
openTimeSlotsPickerForDate(day, docFreeSlots);
BloodDonationBookAppointment.selectedDate = formatter.format(day);
_calendarController.selectedDate = day;
print(BloodDonationBookAppointment.selectedDate);
});
}
Widget _buildTableCalendarWithBuilders(ProjectViewModel projectViewModel) {
return SfCalendar(
controller: _calendarController,
minDate: DateTime.now(),
showNavigationArrow: true,
headerStyle: CalendarHeaderStyle(textAlign: TextAlign.center, textStyle: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46)),
viewHeaderStyle: ViewHeaderStyle(dayTextStyle: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.black)),
view: CalendarView.month,
todayHighlightColor: CustomColors.green,
selectionDecoration: containerColorRadiusBorderWidthCircular(Colors.transparent, 4, CustomColors.green, 2.5),
cellBorderColor: Colors.white,
dataSource: MeetingDataSource(_getDataSource()),
monthViewSettings: const MonthViewSettings(appointmentDisplayMode: MonthAppointmentDisplayMode.indicator, showTrailingAndLeadingDates: false, appointmentDisplayCount: 1),
onTap: (CalendarTapDetails details) {
_calendarController.selectedDate = details.date;
_onDaySelected(details.date, projectViewModel);
},
);
}
Widget getNormalButton(int index) {
return CustomTextButton(
backgroundColor: Colors.white,
elevation: 0,
side: BorderSide(
color: Colors.black, //Color of the border
style: BorderStyle.solid, //Style of the border
width: 1.5 //width of the border
),
onPressed: () {
final timeslot = dayEvents[index];
BloodDonationBookAppointment.selectedAppoDateTime = timeslot.end;
setState(() {
selectedButtonIndex = index;
BloodDonationBookAppointment.selectedTime = dayEvents[index].isoTime;
print(BloodDonationBookAppointment.selectedTime);
});
},
child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, color: Color(0xFF60686b))),
);
}
Widget getSelectedButton(int index) {
return CustomTextButton(
backgroundColor: CustomColors.green,
elevation: 0,
side: BorderSide(
color: CustomColors.green, //Color of the border
style: BorderStyle.solid, //Style of the border
width: 1.5 //width of the border
),
onPressed: () {
setState(() {
selectedButtonIndex = index;
BloodDonationBookAppointment.selectedTime = dayEvents[index].isoTime;
print(BloodDonationBookAppointment.selectedTime);
});
},
child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, color: Colors.white)),
);
}
getBloodDonationFreeSlots() {
BloodDonationService service = new BloodDonationService();
GifLoaderDialogUtils.showMyDialog(context);
service.getBloodDonationFreeSlots(134, _selectedProjectID).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["MessageStatus"] == 1) {
res['BD_FreeSlots'].forEach((element) {
bloodDonationFreeSlotsResponse.add(BloodDonationFreeSlotsResponseModel.fromJson(element));
});
print(bloodDonationFreeSlotsResponse.length);
_getJSONSlots().then((value) => {
setState(() => {_clinicID = bloodDonationFreeSlotsResponse[0].clinicID, _doctorID = bloodDonationFreeSlotsResponse[0].doctorID, _events.clear(), _events = value})
});
} else {
AppToast.showErrorToast(message: res["ErrorEndUserMessage"]);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
openTimeSlotsPickerForDate(DateTime dateStart, List<TimeSlot> freeSlots) {
dayEvents.clear();
DateTime dateStartObj = new DateTime(dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0);
freeSlots.forEach((v) {
if (v.start == dateStartObj) dayEvents.add(v);
});
setState(() {
if (dayEvents.length != 0) {
BloodDonationBookAppointment.areSlotsAvailable = true;
selectedButtonIndex = 0;
BloodDonationBookAppointment.selectedTime = dayEvents[selectedButtonIndex].isoTime;
} else
BloodDonationBookAppointment.areSlotsAvailable = false;
});
}
Future<Map<DateTime, List>> _getJSONSlots() async {
Map<DateTime, List> _eventsParsed;
List<FreeSlot> slotsList = [];
DateTime date;
final DateFormat formatter = DateFormat('HH:mm');
final DateFormat dateFormatter = DateFormat('yyyy-MM-dd');
for (var i = 0; i < bloodDonationFreeSlotsResponse.length; i++) {
date = DateUtil.convertStringToDate(bloodDonationFreeSlotsResponse[i].freeTimeSlots);
slotsList.add(FreeSlot(date, ['slot']));
docFreeSlots.add(TimeSlot(isoTime: formatter.format(date), start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), end: date));
}
_eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
setState(() {
BloodDonationBookAppointment.selectedDate = dateFormatter.format(DateUtil.convertStringToDate(bloodDonationFreeSlotsResponse[0].freeTimeSlots));
selectedDate = DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(bloodDonationFreeSlotsResponse[0].freeTimeSlots));
selectedDateJSON = bloodDonationFreeSlotsResponse[0].freeTimeSlots;
});
openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
_calendarController.selectedDate = DateUtil.convertStringToDate(selectedDateJSON);
return _eventsParsed;
}
getBloodDonationProjectsList() {
BloodDonationService service = new BloodDonationService();
GifLoaderDialogUtils.showMyDialog(context);
service.getBloodDonationProjectsList().then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['BD_getProjectsHaveBDClinics']);
if (res["MessageStatus"] == 1) {
res['BD_getProjectsHaveBDClinics'].forEach((element) {
bloodDonationProjectsListResponse.add(BloodDonationProjectsListResponse.fromJson(element));
});
print(bloodDonationProjectsListResponse.length);
} else {
AppToast.showErrorToast(message: res["ErrorEndUserMessage"]);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
List<Meeting> _getDataSource() {
final List<Meeting> meetings = <Meeting>[];
_events.forEach((key, value) {
final DateTime startTime = DateTime(key.year, key.month, key.day, 9, 0, 0);
final DateTime endTime = startTime.add(const Duration(minutes: 20));
meetings.add(Meeting("", startTime, endTime, CustomColors.green, false));
});
return meetings;
}
}
class MeetingDataSource extends CalendarDataSource {
MeetingDataSource(List<Meeting> source) {
appointments = source;
}
@override
DateTime getStartTime(int index) {
return _getMeetingData(index).from;
}
@override
DateTime getEndTime(int index) {
return _getMeetingData(index).to;
}
@override
String getSubject(int index) {
return _getMeetingData(index).eventName;
}
@override
Color getColor(int index) {
return _getMeetingData(index).background;
}
@override
bool isAllDay(int index) {
return _getMeetingData(index).isAllDay;
}
Meeting _getMeetingData(int index) {
final dynamic meeting = appointments[index];
Meeting meetingData;
if (meeting is Meeting) {
meetingData = meeting;
}
return meetingData;
}
}
class Meeting {
Meeting(this.eventName, this.from, this.to, this.background, this.isAllDay);
String eventName;
DateTime from;
DateTime to;
Color background;
bool isAllDay;
}

@ -335,7 +335,6 @@ class _BookConfirmState extends State<BookConfirm> {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
Future.delayed(new Duration(milliseconds: 500), () { Future.delayed(new Duration(milliseconds: 500), () {
// checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context);
getToDoCount(); getToDoCount();
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
}); });

@ -156,6 +156,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
widget.appo.clinicID == 23 || widget.appo.clinicID == 23 ||
widget.appo.clinicID == 253 || widget.appo.clinicID == 253 ||
widget.appo.clinicID == 265 || widget.appo.clinicID == 265 ||
widget.appo.clinicID == 134 ||
widget.appo.isExecludeDoctor || widget.appo.isExecludeDoctor ||
widget.appo.isLiveCareAppointment) { widget.appo.isLiveCareAppointment) {
_tabController.index = _tabController.previousIndex; _tabController.index = _tabController.previousIndex;
@ -173,6 +174,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
widget.appo.clinicID == 47 || widget.appo.clinicID == 47 ||
widget.appo.clinicID == 265 || widget.appo.clinicID == 265 ||
widget.appo.clinicID == 253 || widget.appo.clinicID == 253 ||
widget.appo.clinicID == 134 ||
widget.appo.isExecludeDoctor || widget.appo.isExecludeDoctor ||
widget.appo.isLiveCareAppointment widget.appo.isLiveCareAppointment
? Tab( ? Tab(

@ -73,7 +73,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
// bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule"); // bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule");
bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") || bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47 || widget.appo.clinicID == 134) && appoButtonsList[index].caller == "openReschedule") ||
(widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc")); (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc"));
return InkWell( return InkWell(
onTap: shouldEnable onTap: shouldEnable

@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart';
import 'package:diplomaticquarterapp/pages/Blood/blood_donation_appointment_terms_conditions.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
@ -555,6 +556,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
case 30: case 30:
getAppoQR(context, appo); getAppoQR(context, appo);
break; break;
case 40:
openInstructions(appo);
break;
case 50: case 50:
confirmAppointment(appo); confirmAppointment(appo);
break; break;
@ -566,6 +570,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
} }
} }
openInstructions(AppoitmentAllHistoryResultList appo) {
if (appo.clinicID == 134) {
Navigator.of(context).push(FadePage(page: BloodDonationAppointmentTermsConditions()));
}
}
Color getNextActionButtonColor(nextAction) { Color getNextActionButtonColor(nextAction) {
switch (nextAction) { switch (nextAction) {
case 0: case 0:

@ -177,6 +177,7 @@ class ClinicListService extends BaseService {
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getCountries() async { Future<Map> getCountries() async {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
dynamic localRes; dynamic localRes;

@ -2908,6 +2908,7 @@ class TranslationBase {
String get updateInsuranceText => localizedValues["updateInsurance"][locale.languageCode]; String get updateInsuranceText => localizedValues["updateInsurance"][locale.languageCode];
String get downloadReport => localizedValues["downloadReport"][locale.languageCode]; String get downloadReport => localizedValues["downloadReport"][locale.languageCode];
String get habibCallCenter => localizedValues["habibCallCenter"][locale.languageCode]; String get habibCallCenter => localizedValues["habibCallCenter"][locale.languageCode];
String get selectHospitalBloodDonation => localizedValues["selectHospitalBloodDonation"][locale.languageCode];
} }

@ -35,9 +35,9 @@ class MyInAppBrowser extends InAppBrowser {
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS

@ -76,9 +76,9 @@ class DoctorHeader extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (_speciality.isNotEmpty) if (_speciality != null && _speciality.isNotEmpty)
Text( Text(
_speciality, _speciality != "null" ? _speciality : "",
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
), ),
headerModel.invoiceNo.isNotEmpty ? MyRichText(TranslationBase.of(context).invoiceNo + ":", headerModel.invoiceNo, projectViewModel.isArabic) : Container(), headerModel.invoiceNo.isNotEmpty ? MyRichText(TranslationBase.of(context).invoiceNo + ":", headerModel.invoiceNo, projectViewModel.isArabic) : Container(),

Loading…
Cancel
Save