Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into patient_app_services

merge-requests/389/head
Mohammad Aljammal 4 years ago
commit 6fbd2076d4

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 B

@ -4,7 +4,7 @@ const MAX_SMALL_SCREEN = 660;
const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]";
// const BASE_URL = 'https://hmgwebservices.com/';
//const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
@ -234,6 +234,7 @@ const GET_PAtIENTS_INSURANCE_APPROVALS =
const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS =
@ -246,7 +247,6 @@ const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************

@ -277,7 +277,7 @@ const Map<String, Map<String, String>> localizedValues = {
"doc-name": {"en": "Doctor Name", "ar": "اسم الطبيب"},
"clinicname": {"en": "Clinic Name", "ar": "اسم العيادة"},
"sick-leave-date": {"en": "Sick leave date ", "ar": "تاريخ الاجازة."},
"sick-leave-days": {"en": "Sick leave days", "ar": "عدد ايام الاجازة."},
"sick-leave-days": {"en": "Leave Days: ", "ar": " :أيام الإجازة"},
'admissionDetail': {'en': 'ADMISSION DETAIL: ', 'ar': 'تفاصيل القبول: '},
'dateTime': {'en': 'DATE / TIME:', 'ar': 'التاريخ / الوقت:'},
'date': {'en': 'Date', 'ar': 'التاريخ'},
@ -302,8 +302,8 @@ const Map<String, Map<String, String>> localizedValues = {
"ar": "يرجى ادخال هذا الحقل"
},
'no-sickleve-applied': {
'en': "No sick leave applied",
'ar': 'لم تطبق إجازة مرضية'
'en': "No sick leave available, apply Now",
'ar': 'لا توجد إجازة مرضية متاحة ، تقدم بطلب الآن'
},
'applynow': {'en': "Apply Now", 'ar': 'قدم الآن'},
'add-sickleave': {'en': "ADD SICK LEAVE", 'ar': 'أضف إجازة مرضية'},
@ -394,7 +394,7 @@ const Map<String, Map<String, String>> localizedValues = {
'painManagement': {'en': "Pain Management", 'ar': 'إدارة الألم'},
'holiday': {'en': "Holiday", 'ar': 'يوم الاجازة'},
'to': {'en': "To", 'ar': 'إلى'},
'coveringDoctor': {'en': "Covering Doctor", 'ar': 'تغطية دكتور'},
'coveringDoctor': {'en': "Covering Doctor: ", 'ar': ' :تغطية دكتور'},
'requestLeave': {'en': 'Request Leave', 'ar': 'طلب إجازة'},
'pleaseEnterDate': {
'en': 'Please enter leave start date',
@ -785,7 +785,30 @@ const Map<String, Map<String, String>> localizedValues = {
"prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"},
"notes": {"en": "Notes", "ar": "ملاحظات"},
"dailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"},
"searchWithOther": {
"en": "Search With Other Criteria",
"ar": "البحث بمعايير أخرى"
},
"hideOtherCriteria": {
"en": "Hide Other Criteria",
"ar": "إخفاء المعايير الأخرى"
},
"applyForReschedule": {
"en": "Apply for leave or reschedule",
"ar": "تقدم بطلب للحصول على إجازة أو إعادة جدولة"
},
"startDate": {"en": "Start Date: ", "ar": " :تاريخ البدء"},
"endDate": {"en": "End Date: ", "ar": " :تاريخ الانتهاء"},
"add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"},
"update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"},
"sick_leave": {"en": "Sick Leave", "ar": "أجازة مرضية"},
"addSickLeaveRequest": {
"en": "Add Sick Leave Request",
"ar": "إضافة طلب إجازة مرضية"
},
"extendSickLeaveRequest": {
"en": "Extend Sick Leave Request",
"ar": "تمديد طلب الإجازة المرضية"
},
};

File diff suppressed because it is too large Load Diff

@ -1,14 +1,21 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart';
import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class MedicalFilePage extends StatefulWidget {
@override
@ -21,6 +28,9 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
return BaseView<MedicalFileViewModel>(
onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId),
builder:
@ -32,18 +42,45 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
baseViewModel: model,
child: SingleChildScrollView(
child: Container(
color: Colors.white,
child: Column(
// mainAxisAlignment: model.medicalFileList.length != 0 &&
// model.medicalFileList != null
// ? MainAxisAlignment.start
// : MainAxisAlignment.center,
children: [
PatientPageHeaderWidget(patient),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey,
PatientProfileHeaderNewDesign(
patient, patient.patientType.toString(), arrivalType),
Padding(
padding:
EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
child: Container(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
children: [
AppText(
'Medical',
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),
],
),
Row(
children: [
AppText(
'Report',
fontSize: 30.0,
fontWeight: FontWeight.w700,
),
],
),
],
),
),
),
),
(model.medicalFileList != null &&
model.medicalFileList.length != 0)
@ -60,66 +97,155 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
horizontal: 12.0, vertical: 8.0),
child: InkWell(
child: Container(
width: double.infinity,
margin: EdgeInsets.only(
top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(
color: Colors.grey[200], width: 0.5),
),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
AppText(
TranslationBase.of(context).branch +
": ",
fontWeight: FontWeight.w700,
Row(
children: [
AppText(
model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.doctorName,
fontWeight: FontWeight.w700,
fontSize: 17.0,
fontFamily: 'Poppins',
)
],
),
AppText(model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.projectName),
Row(
children: [
AppText(
Helpers.convertStringToDate(model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.date)
.day
.toString() +
"/",
),
AppText(
Helpers.convertStringToDate(model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.date)
.month
.toString() +
"/",
),
AppText(
Helpers.convertStringToDate(
model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.date)
.year
.toString(),
),
],
)
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.doctorName
.toUpperCase() +
": ",
fontWeight: FontWeight.w700,
),
Expanded(
child: AppText(
model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.doctorName,
fontWeight: FontWeight.w700,
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
ClipRRect(
borderRadius:
BorderRadius.all(
Radius.circular(30)),
child: Image.network(
'https://previews.123rf.com/images/yupiramos/yupiramos1705/yupiramos170524444/78443570-a-female-doctor-avatar-character-vector-illustration-design.jpg',
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
],
),
),
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
children: [
AppText(
TranslationBase.of(context)
.clinic +
": ",
),
AppText(
model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.clinicName,
fontWeight: FontWeight.w600,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
AppText(
TranslationBase.of(context)
.branch +
": ",
),
AppText(
model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.projectName,
fontWeight: FontWeight.w600,
),
],
),
],
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.end,
children: [
AppText(
TranslationBase.of(context)
.clinicName +
": ",
fontWeight: FontWeight.w700,
),
AppText(
model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.clinicName,
),
Column(
children: [
Icon(
Icons.remove_red_eye,
size: 30.0,
)
],
)
],
),
SizedBox(height: 10.0),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey.shade400,
)
],
),
),
@ -135,16 +261,24 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
gender: patient.genderDescription,
encounterNumber: index,
pp: patient.patientId,
patient: patient,
)),
);
},
),
);
})
: Container(
child: AppText(
'THERES NO MEDICAL FILE FOR THIS Patient',
),
: Column(
children: [
Container(
child: AppText(
'THERES NO MEDICAL FILE FOR THIS Patient',
),
),
SizedBox(
height: 400,
)
],
)
],
),

@ -210,11 +210,14 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
InkWell(
child: this.isView == false
? AppText(
'Search With Other Critearia',
TranslationBase.of(context)
.searchWithOther,
color: Colors.red,
fontWeight: FontWeight.bold,
)
: AppText('Hide Other Criteria',
: AppText(
TranslationBase.of(context)
.hideOtherCriteria,
color: Colors.red,
fontWeight: FontWeight.bold),
onTap: () {

@ -225,6 +225,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
return SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 1.45,
color: Color(0xffF8F8F8),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 12.0, vertical: 10.0),
@ -232,9 +233,26 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
crossAxisAlignment: CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
AppText(
TranslationBase.of(context).medicines.toUpperCase(),
fontWeight: FontWeight.w900,
Row(
children: [
AppText(
'New Prescription Order',
fontWeight: FontWeight.w700,
fontSize: 20,
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.32,
),
InkWell(
child: Icon(
Icons.close,
size: 23.0,
),
onTap: () {
Navigator.pop(context);
},
)
],
),
SizedBox(
height: spaceBetweenTextFileds,
@ -248,6 +266,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container(
height: MediaQuery.of(context).size.height *
0.070,
color: Colors.white,
child: InkWell(
onTap: model.allMedicationList != null
? () {
@ -340,17 +359,17 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
itemID: _selectedMedication
.itemId);
},
decoration:
textFieldSelectorDecoration(
TranslationBase.of(context)
.searchMedicineNameHere,
_selectedMedication != null
? _selectedMedication
.description +
('${_selectedMedication.genericName}')
: null,
true,
),
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.searchMedicineNameHere,
_selectedMedication != null
? _selectedMedication
.description +
('${_selectedMedication.genericName}')
: null,
false,
suffixIcon:
Icon(Icons.search)),
enabled: false,
),
),
@ -361,7 +380,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container(
child: Row(
children: [
AppText('Order Type'),
AppText(
'Order Type',
fontWeight: FontWeight.w600,
),
Radio(
activeColor: Color(0xFFB9382C),
value: 1,
@ -445,6 +467,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
width: 10.0,
),
Container(
color: Colors.white,
width: MediaQuery.of(context)
.size
.width *
@ -489,7 +512,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: TextField(
decoration:
textFieldSelectorDecoration(
'UNIT Type',
'UNIT',
units != null
? units['description']
: null,
@ -504,6 +527,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap: model.itemMedicineListRoute != null
? () {
@ -553,6 +577,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap: model.itemMedicineList != null
? () {
@ -620,6 +645,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap: model.medicationDoseTimeList !=
null
@ -667,6 +693,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container(
height: screenSize.height * 0.070,
width: double.infinity,
color: Colors.white,
child: Row(
children: [
Container(
@ -692,7 +719,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
indication != null
? indication['name']
: null,
true),
false),
enabled: true,
readOnly: true,
),
@ -703,6 +730,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.size
.width *
0.65,
color: Colors.white,
child: InkWell(
onTap: indicationList != null
? () {
@ -722,7 +750,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
indication != null
? indication['name']
: null,
true),
false),
enabled: true,
readOnly: true,
),
@ -734,22 +762,21 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap: () =>
selectDate(context, widget.model),
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.date,
selectedDate != null
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).date,
selectedDate != null
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
@ -757,6 +784,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap: model.medicationDurationList !=
null
@ -825,6 +853,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap: model.allMedicationList != null
? () {
@ -857,7 +886,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
decoration: textFieldSelectorDecoration(
"UOM",
uom != null ? uom : null,
true),
false),
//enabled: false,
readOnly: true,
),
@ -866,6 +895,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap: model.allMedicationList != null
? () {
@ -901,7 +931,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
? "Box Quantity: " +
model.boxQuintity.toString()
: null,
true),
false),
//enabled: false,
readOnly: true,
),
@ -932,8 +962,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
color: Color(0xff359846),
title: TranslationBase.of(context)
.addMedication,
fontWeight: FontWeight.w600,
onPressed: () {
// formKey.currentState.save();
// Navigator.pop(context);
@ -1093,11 +1125,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
@ -1105,13 +1137,22 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
Icons.keyboard_arrow_down_sharp,
color: Color(0xff2E303A),
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
fontSize: 13,
color: Color(0xff2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
),
labelText: selectedText != null ? '$hintText\n$selectedText' : null,
labelStyle: TextStyle(
fontSize: 13,
color: Color(0xff2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
),
);
}

@ -0,0 +1,319 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
import 'entity_list_checkbox_search_widget.dart';
import 'entity_list_procedure_widget.dart';
valdateProcedure(ProcedureViewModel model, PatiantInformtion patient,
List<EntityList> entityList) async {
ProcedureValadteRequestModel procedureValadteRequestModel =
new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.appointmentNo;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
}
postProcedure(
{ProcedureViewModel model,
String remarks,
String orderType,
PatiantInformtion patient,
List<EntityList> entityList}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValadteRequestModel procedureValadteRequestModel =
new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.patientMRN;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
List<Procedures> controlsProcedure = List();
postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) {
procedureValadteRequestModel.procedure = [element.procedureId];
List<Controls> controls = List();
controls.add(
Controls(
code: "remarks",
controlValue: element.remarks != null ? element.remarks : ""),
);
controls.add(
Controls(code: "ordertype", controlValue: "0"),
);
controlsProcedure.add(Procedures(
category: element.categoryID,
procedure: element.procedureId,
controls: controls));
});
postProcedureReqModel.procedures = controlsProcedure;
await model.valadteProcedure(procedureValadteRequestModel);
if (model.state == ViewState.Idle) {
if (model.valadteProcedureList[0].entityList.length == 0) {
await model.postProcedure(postProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added');
}
} else {
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) {
helpers.showErrorToast(
model.valadteProcedureList[0].entityList[0].warringMessages);
}
}
} else {
helpers.showErrorToast(model.error);
}
}
void addSelectedLabOrder(
context, ProcedureViewModel model, PatiantInformtion patient) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext bc) {
return AddSelectedLabOrder(
model: model,
patient: patient,
);
});
}
class AddSelectedLabOrder extends StatefulWidget {
final ProcedureViewModel model;
final PatiantInformtion patient;
const AddSelectedLabOrder({Key key, this.model, this.patient})
: super(key: key);
@override
_AddSelectedLabOrderState createState() =>
_AddSelectedLabOrderState(patient: patient, model: model);
}
class _AddSelectedLabOrderState extends State<AddSelectedLabOrder> {
int selectedType;
ProcedureViewModel model;
PatiantInformtion patient;
_AddSelectedLabOrderState({this.patient, this.model});
TextEditingController procedureController = TextEditingController();
TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List();
List<EntityList> entityListProcedure = List();
dynamic selectedCategory;
setSelectedType(int val) {
setState(() {
selectedType = val;
});
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getProcedureCategory(
categoryName: "Laboratory", categoryID: "02"),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
NetworkBaseView(
baseViewModel: model,
child: DraggableScrollableSheet(
minChildSize: 0.90,
initialChildSize: 0.95,
maxChildSize: 1.0,
builder: (BuildContext context, ScrollController scrollController) {
return SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 1.20,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
'New Lab Order',
fontWeight: FontWeight.w900,
fontSize: 18.0,
),
SizedBox(
height: 10.0,
),
if (widget.model.categoriesList.length != 0)
NetworkBaseView(
baseViewModel: model,
child: EntityListCheckboxSearchWidget(
model: widget.model,
masterList:
widget.model.categoriesList[0].entityList,
removeHistory: (item) {
setState(() {
entityList.remove(item);
});
},
addHistory: (history) {
setState(() {
entityList.add(history);
});
},
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
)),
SizedBox(
height: 15.0,
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Container(
// child: Row(
// children: [
// AppText(
// TranslationBase.of(context).orderType),
// Radio(
// activeColor: Color(0xFFB9382C),
// value: 1,
// groupValue: selectedType,
// onChanged: (value) {
// setSelectedType(value);
// },
// ),
// Text('routine'),
// Radio(
// activeColor: Color(0xFFB9382C),
// groupValue: selectedType,
// value: 0,
// onChanged: (value) {
// setSelectedType(value);
// },
// ),
// Text(TranslationBase.of(context).urgent),
// ],
// ),
// ),
// SizedBox(
// height: 15.0,
// ),
// TextFields(
// hintText: TranslationBase.of(context).remarks,
// controller: remarksController,
// minLines: 3,
// maxLines: 5,
// ),
SizedBox(
height: 100.0,
),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context)
.addSelectedProcedures,
color: Color(0xff359846),
onPressed: () {
//print(entityList.toString());
onPressed:
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
"Fill the mandatory procedure details");
return;
}
Navigator.pop(context);
postProcedure(
orderType: selectedType.toString(),
entityList: entityList,
patient: patient,
model: widget.model,
remarks: remarksController.text);
},
),
],
),
),
],
)
],
),
),
),
);
}),
),
);
}
bool isEntityListSelected(EntityList masterKey) {
Iterable<EntityList> history = entityList
.where((element) => masterKey.procedureId == element.procedureId);
if (history.length > 0) {
return true;
}
return false;
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
}

@ -0,0 +1,319 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
import 'entity_list_checkbox_search_widget.dart';
import 'entity_list_procedure_widget.dart';
valdateProcedure(ProcedureViewModel model, PatiantInformtion patient,
List<EntityList> entityList) async {
ProcedureValadteRequestModel procedureValadteRequestModel =
new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.appointmentNo;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
}
postProcedure(
{ProcedureViewModel model,
String remarks,
String orderType,
PatiantInformtion patient,
List<EntityList> entityList}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValadteRequestModel procedureValadteRequestModel =
new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.patientMRN;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
List<Procedures> controlsProcedure = List();
postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) {
procedureValadteRequestModel.procedure = [element.procedureId];
List<Controls> controls = List();
controls.add(
Controls(
code: "remarks",
controlValue: element.remarks != null ? element.remarks : ""),
);
controls.add(
Controls(code: "ordertype", controlValue: "0"),
);
controlsProcedure.add(Procedures(
category: element.categoryID,
procedure: element.procedureId,
controls: controls));
});
postProcedureReqModel.procedures = controlsProcedure;
await model.valadteProcedure(procedureValadteRequestModel);
if (model.state == ViewState.Idle) {
if (model.valadteProcedureList[0].entityList.length == 0) {
await model.postProcedure(postProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added');
}
} else {
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) {
helpers.showErrorToast(
model.valadteProcedureList[0].entityList[0].warringMessages);
}
}
} else {
helpers.showErrorToast(model.error);
}
}
void addSelectedRadiologyOrder(
context, ProcedureViewModel model, PatiantInformtion patient) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext bc) {
return AddSelectedRadiologyOrder(
model: model,
patient: patient,
);
});
}
class AddSelectedRadiologyOrder extends StatefulWidget {
final ProcedureViewModel model;
final PatiantInformtion patient;
const AddSelectedRadiologyOrder({Key key, this.model, this.patient})
: super(key: key);
@override
_AddSelectedRadiologyOrderState createState() =>
_AddSelectedRadiologyOrderState(patient: patient, model: model);
}
class _AddSelectedRadiologyOrderState extends State<AddSelectedRadiologyOrder> {
int selectedType;
ProcedureViewModel model;
PatiantInformtion patient;
_AddSelectedRadiologyOrderState({this.patient, this.model});
TextEditingController procedureController = TextEditingController();
TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List();
List<EntityList> entityListProcedure = List();
dynamic selectedCategory;
setSelectedType(int val) {
setState(() {
selectedType = val;
});
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getProcedureCategory(
categoryName: "Radiology", categoryID: "03"),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
NetworkBaseView(
baseViewModel: model,
child: DraggableScrollableSheet(
minChildSize: 0.90,
initialChildSize: 0.95,
maxChildSize: 1.0,
builder: (BuildContext context, ScrollController scrollController) {
return SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 1.20,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
'New Radiology Order',
fontWeight: FontWeight.w900,
fontSize: 18.0,
),
SizedBox(
height: 10.0,
),
if (widget.model.categoriesList.length != 0)
NetworkBaseView(
baseViewModel: model,
child: EntityListCheckboxSearchWidget(
model: widget.model,
masterList:
widget.model.categoriesList[0].entityList,
removeHistory: (item) {
setState(() {
entityList.remove(item);
});
},
addHistory: (history) {
setState(() {
entityList.add(history);
});
},
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
)),
SizedBox(
height: 15.0,
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Container(
// child: Row(
// children: [
// AppText(
// TranslationBase.of(context).orderType),
// Radio(
// activeColor: Color(0xFFB9382C),
// value: 1,
// groupValue: selectedType,
// onChanged: (value) {
// setSelectedType(value);
// },
// ),
// Text('routine'),
// Radio(
// activeColor: Color(0xFFB9382C),
// groupValue: selectedType,
// value: 0,
// onChanged: (value) {
// setSelectedType(value);
// },
// ),
// Text(TranslationBase.of(context).urgent),
// ],
// ),
// ),
// SizedBox(
// height: 15.0,
// ),
// TextFields(
// hintText: TranslationBase.of(context).remarks,
// controller: remarksController,
// minLines: 3,
// maxLines: 5,
// ),
SizedBox(
height: 100.0,
),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context)
.addSelectedProcedures,
color: Color(0xff359846),
onPressed: () {
//print(entityList.toString());
onPressed:
if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast(
"Fill the mandatory procedure details");
return;
}
Navigator.pop(context);
postProcedure(
orderType: selectedType.toString(),
entityList: entityList,
patient: patient,
model: widget.model,
remarks: remarksController.text);
},
),
],
),
),
],
)
],
),
),
),
);
}),
),
);
}
bool isEntityListSelected(EntityList masterKey) {
Iterable<EntityList> history = entityList
.where((element) => masterKey.procedureId == element.procedureId);
if (history.length > 0) {
return true;
}
return false;
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
}

@ -69,7 +69,7 @@ class _EntityListCheckboxSearchWidgetState
NetworkBaseView(
baseViewModel: widget.model,
child: Container(
height: MediaQuery.of(context).size.height * 0.45,
height: MediaQuery.of(context).size.height * 0.55,
child: Center(
child: Container(
margin: EdgeInsets.only(top: 15),
@ -120,61 +120,70 @@ class _EntityListCheckboxSearchWidgetState
historyInfo.procedureName,
variant: "bodyText",
bold: true,
color: Colors.black),
color: Color(0xff575757)),
),
),
],
),
children: [
Container(
child: Row(
children: [
AppText(TranslationBase.of(context)
.orderType),
Radio(
activeColor: Color(0xFFB9382C),
value: 0,
groupValue: selectedType,
onChanged: (value) {
historyInfo.type =
setSelectedType(value)
.toString();
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 12),
child: Row(
children: [
AppText(
TranslationBase.of(context)
.orderType),
Radio(
activeColor: Color(0xFFB9382C),
value: 0,
groupValue: selectedType,
onChanged: (value) {
historyInfo.type =
setSelectedType(value)
.toString();
historyInfo.type =
value.toString();
},
),
Text('routine'),
Radio(
activeColor: Color(0xFFB9382C),
groupValue: selectedType,
value: 1,
onChanged: (value) {
historyInfo.type =
setSelectedType(value)
.toString();
historyInfo.type =
value.toString();
},
),
Text('routine'),
Radio(
activeColor: Color(0xFFB9382C),
groupValue: selectedType,
value: 1,
onChanged: (value) {
historyInfo.type =
setSelectedType(value)
.toString();
historyInfo.type =
value.toString();
},
),
Text(TranslationBase.of(context)
.urgent),
],
historyInfo.type =
value.toString();
},
),
Text(TranslationBase.of(context)
.urgent),
],
),
),
),
SizedBox(
height: 15.0,
),
TextFields(
hintText:
TranslationBase.of(context).remarks,
//controller: remarksController,
onChanged: (value) {
historyInfo.remarks = value;
},
minLines: 3,
maxLines: 5,
Padding(
padding: EdgeInsets.symmetric(
horizontal: 12),
child: TextFields(
hintText: TranslationBase.of(context)
.remarks,
//controller: remarksController,
onChanged: (value) {
historyInfo.remarks = value;
},
minLines: 3,
maxLines: 5,
),
),
],
),

@ -7,6 +7,8 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
@ -18,287 +20,257 @@ class AddRescheduleLeavScreen extends StatelessWidget {
Widget build(BuildContext context) {
projectsProvider = Provider.of(context);
return BaseView<SickLeaveViewModel>(
onModelReady: (model) =>
{model.getRescheduleLeave(), model.getCoveringDoctors()},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).rescheduleLeaves,
body: model.getReschduleLeave.length > 0
? SingleChildScrollView(
child: Column(
children: [
SizedBox(height: 50),
Container(
margin:
EdgeInsets.only(left: 15, right: 15, top: 20),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
InkWell(
child: Row(
children: [
Expanded(
flex: 4,
child: AppText(
TranslationBase.of(context)
.requestLeave),
),
IconButton(
icon: Icon(
Icons.add_circle,
color: Colors.red,
))
],
)
// AppTextFormField(
// hintText:
// TranslationBase.of(context).requestLeave,
// borderColor: Colors.white,
// prefix: IconButton(
// icon: Icon(
// Icons.add_circle,
// color: Colors.red,
// )),
// // textInputType: TextInputType.text,
// readOnly: true,
// onTap: () {
// openLeave(
// context,
// false,
// );
// return false;
// },
// inputFormatter: ONLY_LETTERS,
// )
,
onTap: () {
openLeave(
context,
false,
);
},
)
],
),
),
Column(
children: model.getReschduleLeave.map<Widget>(
(GetRescheduleLeavesResponse item) {
return CardWithBgWidgetNew(
widget: Column(
children: [
Container(
padding:
EdgeInsets.only(left: 10, right: 10),
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
Expanded(
flex: 4,
child: Wrap(
children: <Widget>[
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
padding:
EdgeInsets.all(3),
child: AppText(
item.status == 1
? TranslationBase
.of(context)
.approved
: item.status == 2
? TranslationBase.of(
context)
.pending
: TranslationBase.of(
context)
.rejected,
fontWeight:
FontWeight.bold,
color: Colors.white,
),
color: item.status == 1
? Colors.green
: item.status == 2
? Colors
.yellow[800]
: Colors.red[800],
),
SizedBox(
height: 5,
),
Container(
child: AppText(
item.requisitionType == 1
onModelReady: (model) =>
{model.getRescheduleLeave(), model.getCoveringDoctors()},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).rescheduleLeaves,
body: SingleChildScrollView(
child: Column(children: [
Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.all(10),
padding:
EdgeInsets.only(left: 10, right: 10, top: 20, bottom: 20),
decoration: BoxDecoration(
color: HexColor('#EAEAEA'),
borderRadius: BorderRadius.all(Radius.circular(20))),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.circular(10)),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
color: Colors.white,
),
onPressed: () {
openLeave(
context,
false,
);
}),
),
Padding(
child: AppText(
TranslationBase.of(context).applyForReschedule,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 18,
color: HexColor('#7E7E7E')),
padding: EdgeInsets.all(10),
),
],
),
),
Column(
children: model.getReschduleLeave
.map<Widget>((GetRescheduleLeavesResponse item) {
return RoundedContainer(
child: Column(
children: [
Container(
decoration: BoxDecoration(
border: Border(
left: BorderSide(
color: item.status == 1
? Colors.green
: item.status == 2
? HexColor('#CC9B14')
: Colors.red[800],
width: 5.0,
))),
padding: EdgeInsets.only(left: 10, right: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
flex: 4,
child: Wrap(
children: <Widget>[
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Container(
padding: EdgeInsets.all(3),
margin:
EdgeInsets.only(top: 10),
child: AppText(
item.status == 1
? TranslationBase.of(
context)
.approved
: item.status == 2
? TranslationBase.of(
context)
.offTime
.pending
: TranslationBase.of(
context)
.holiday +
' ',
fontWeight:
FontWeight.bold,
)),
Row(
children: [
Flexible(
child: Text(
DateUtils.convertStringToDateFormat(
item
.dateTimeFrom,
'yyyy-MM-dd HH:mm') +
' ' +
TranslationBase.of(
context)
.to +
' ' +
DateUtils.convertStringToDateFormat(
item.dateTimeTo,
'yyyy-MM-dd HH:mm')
// overflow:
// TextOverflow.ellipsis,
))
],
),
SizedBox(
height: 5,
),
AppText(
TranslationBase.of(
context)
.coveringDoctor,
fontWeight:
FontWeight.bold,
),
model.coveringDoctors
.length >
0
? Row(children: [
AppText(getDoctor(
model
.coveringDoctors,
item.coveringDoctorId))
])
: SizedBox(),
AppText(
TranslationBase.of(
context)
.reasons,
fontWeight:
FontWeight.bold,
),
model.allReasons.length > 0
? Row(children: [
AppText(getReasons(
model
.allReasons,
item.reasonId))
])
: SizedBox(),
],
),
SizedBox(
width: 10,
context)
.rejected,
fontWeight: FontWeight.bold,
color: item.status == 1
? Colors.green
: item.status == 2
? HexColor('#CC9B14')
: Colors.red[800],
fontSize: 14,
),
],
),
),
(item.status == 2)
? Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.edit_outlined,
size: 30,
),
// color: Colors.green, //Colors.black,
onPressed: () => {
openLeave(context, true,
extendedData: item)
},
),
Padding(
padding:
EdgeInsets.only(top: 10),
child: AppText(
DateUtils
.convertStringToDateFormat(
item.dateTimeTo,
'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold,
))
: SizedBox(),
],
)),
SizedBox(
height: 10,
),
Divider(
height: 1,
),
],
));
}).toList(),
)
],
),
)
: new Builder(builder: (context) {
return Center(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.all(40),
decoration: BoxDecoration(
border: Border.all(
color: HexColor('#B8382C'), width: 4),
borderRadius:
BorderRadius.all(Radius.circular(100))),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
),
onPressed: () {
openLeave(
context,
false,
);
}),
),
Padding(
child: AppText(
TranslationBase.of(context).noReScheduleLeave,
fontWeight: FontWeight.bold,
]),
SizedBox(
height: 5,
),
Container(
child: AppText(
item.requisitionType == 1
? TranslationBase.of(context)
.offTime
: TranslationBase.of(context)
.holiday +
' ',
fontWeight: FontWeight.bold,
)),
SizedBox(
height: 5,
),
Row(children: [
AppText(TranslationBase.of(context)
.startDate),
AppText(
DateUtils.convertStringToDateFormat(
item.dateTimeFrom,
'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold,
)
// overflow:
// TextOverflow.ellipsis,
]),
// overflow:
// TextOverflow.ellipsis,
SizedBox(
height: 5,
),
Row(
children: [
AppText(TranslationBase.of(context)
.endDate),
AppText(
DateUtils
.convertStringToDateFormat(
item.dateTimeTo,
'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold,
)
],
),
SizedBox(
height: 5,
),
model.coveringDoctors.length > 0
? Row(children: [
AppText(
TranslationBase.of(context)
.coveringDoctor,
),
AppText(
getDoctor(
model.coveringDoctors,
item.coveringDoctorId),
fontWeight: FontWeight.bold,
)
])
: SizedBox(),
// AppText(
// TranslationBase.of(context)
// .reasons,
// fontWeight: FontWeight.bold,
// ),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: EdgeInsets.only(
bottom: 5),
child: AppText(getReasons(
model.allReasons,
item.reasonId))),
(item.status == 2)
? IconButton(
icon: Image.asset(
'assets/images/edit.png'),
// color: Colors.green, //Colors.black,
onPressed: () => {
openLeave(context, true,
extendedData: item)
},
)
: SizedBox(),
]),
],
),
SizedBox(
width: 10,
),
],
),
),
padding: EdgeInsets.all(10),
),
AppText(
TranslationBase.of(context).applyNow,
fontWeight: FontWeight.bold,
color: HexColor('#B8382C'),
)
],
),
));
}),
));
],
)),
],
),
);
}).toList(),
)
]))),
);
}
openLeave(BuildContext context, isExtend, {extendedData}) {
showModalBottomSheet(
context: context,
builder: (context) {
return new Container(
child: RescheduleLeaveScreen(
isExtend,
extendedData,
));
});
// showModalBottomSheet(
// context: context,
// builder: (context) {
// return new Container(
// child: RescheduleLeaveScreen(
// isExtend,
// extendedData,
// ));
// });
Navigator.push(
context,
FadePage(
page: RescheduleLeaveScreen(
isExtend,
extendedData,
),
),
);
}
getDoctor(model, doctorId) {

@ -114,12 +114,13 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
model2.getCoveringDoctors()
},
builder: (_, model2, w) => GestureDetector(
onTap: (){
FocusScope.of(context).requestFocus(new FocusNode());
},
child: AppScaffold(
onTap: () {
FocusScope.of(context).requestFocus(new FocusNode());
},
child: AppScaffold(
baseViewModel: model2,
isShowAppBar: false,
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).rescheduleLeaves,
body: Center(
child: Container(
margin: EdgeInsets.only(top: 10),
@ -127,119 +128,127 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
widthFactor: 0.9,
child: ListView(
children: [
Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
width: double.infinity,
child: Padding(
padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
// add Expanded to have your dropdown button fill remaining space
child: DropdownButtonHideUnderline(
child: new IgnorePointer(
ignoring: true,
child: DropdownButton(
focusColor: Colors.grey,
isExpanded: true,
dropdownColor:
Colors.grey,
value: getClinicName(
model) ??
"",
iconSize: 0,
elevation: 16,
selectedItemBuilder:
(BuildContext
context) {
return model
.getClinicNameList()
.map((item) {
return Row(
mainAxisSize:
MainAxisSize
.max,
children: <Widget>[
AppText(
item,
fontSize: SizeConfig
.textMultiplier *
2.1,
color: Colors
.grey[500],
),
],
);
}).toList();
},
onChanged: (newValue) =>
{},
items: model
.getClinicNameList()
.map((item) {
return DropdownMenuItem(
value:
item.toString(),
child: Text(
item,
textAlign:
TextAlign.end,
),
);
}).toList(),
))),
),
],
)
],
),
)),
// Container(
// margin: EdgeInsets.all(8),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.all(
// Radius.circular(6.0)),
// border: Border.all(
// width: 1.0,
// color: HexColor("#CCCCCC"))),
// width: double.infinity,
// child: Padding(
// padding: EdgeInsets.only(
// top: SizeConfig.widthMultiplier * 0.9,
// bottom:
// SizeConfig.widthMultiplier * 0.9,
// right: SizeConfig.widthMultiplier * 3,
// left: SizeConfig.widthMultiplier * 3),
// child: Column(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Row(
// mainAxisSize: MainAxisSize.max,
// children: <Widget>[
// Expanded(
// // add Expanded to have your dropdown button fill remaining space
// child:
// DropdownButtonHideUnderline(
// child: new IgnorePointer(
// ignoring: true,
// child: DropdownButton(
// focusColor:
// Colors.grey,
// isExpanded: true,
// dropdownColor:
// Colors.grey,
// value: getClinicName(
// model) ??
// "",
// iconSize: 0,
// elevation: 16,
// selectedItemBuilder:
// (BuildContext
// context) {
// return model
// .getClinicNameList()
// .map((item) {
// return Row(
// mainAxisSize:
// MainAxisSize
// .max,
// children: <
// Widget>[
// AppText(
// item,
// fontSize:
// SizeConfig.textMultiplier *
// 2.1,
// color: Colors
// .grey[
// 500],
// ),
// ],
// );
// }).toList();
// },
// onChanged:
// (newValue) =>
// {},
// items: model
// .getClinicNameList()
// .map((item) {
// return DropdownMenuItem(
// value: item
// .toString(),
// child: Text(
// item,
// textAlign:
// TextAlign
// .end,
// ),
// );
// }).toList(),
// ))),
// ),
// ],
// )
// ],
// ),
// )),
Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
new IgnorePointer(
ignoring: true,
child: AppTextFormField(
readOnly: true,
hintText: profile != null
? profile['DoctorName']
: "",
borderColor: Colors.white,
onSaved: (value) {},
inputFormatter: ONLY_NUMBERS))
],
),
),
// Container(
// margin: EdgeInsets.all(8),
// decoration: BoxDecoration(
// borderRadius:
// BorderRadius.all(Radius.circular(6.0)),
// border: Border.all(
// width: 1.0,
// color: HexColor("#CCCCCC"))),
// padding: EdgeInsets.all(5),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// new IgnorePointer(
// ignoring: true,
// child: AppTextFormField(
// readOnly: true,
// hintText: profile != null
// ? profile['DoctorName']
// : "",
// borderColor: Colors.white,
// onSaved: (value) {},
// inputFormatter: ONLY_NUMBERS))
// ],
// ),
// ),
Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
@ -247,7 +256,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: Padding(
padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9,
bottom:
SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3),
child: Column(
@ -262,7 +272,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
// add Expanded to have your dropdown button fill remaining space
child:
DropdownButtonHideUnderline(
child: DropdownButton(
child:
DropdownButton(
// focusColor: Colors.grey,
isExpanded: true,
value: offTime == null
@ -272,12 +283,14 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
iconSize: 40,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
(BuildContext
context) {
return model2.allOffTime
.map((item) {
return Row(
mainAxisSize:
MainAxisSize.max,
MainAxisSize
.max,
children: <Widget>[
AppText(
item[
@ -297,12 +310,22 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
offTime = newValue;
}),
if (offTime == '1')
{model2.getReasons(18)}
{
model2
.getReasons(18)
}
else if (offTime == '2')
{model2.getReasons(19)}
else if (offTime == '3' ||
{
model2
.getReasons(19)
}
else if (offTime ==
'3' ||
offTime == '5')
{model2.getReasons(102)}
{
model2
.getReasons(102)
}
},
items: model2.allOffTime
.map((item) {
@ -335,20 +358,21 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
color:
HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppTextFormField(
hintText:
TranslationBase.of(context)
.fromDate,
hintText: TranslationBase.of(
context)
.fromDate,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(
Icons.calendar_today)),
icon: Icon(Icons
.calendar_today)),
textInputType:
TextInputType.number,
controller: _toDateController,
@ -372,11 +396,12 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(
Radius.circular(6.0)),
Radius.circular(
6.0)),
border: Border.all(
width: 1.0,
color:
HexColor("#CCCCCC"))),
color: HexColor(
"#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
@ -387,8 +412,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
TranslationBase.of(
context)
.fromTime,
type:
DateTimePickerType.time,
type: DateTimePickerType
.time,
controller: _controller4,
onChanged: (val) =>
fromTime = val,
@ -411,11 +436,12 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(
Radius.circular(6.0)),
Radius.circular(
6.0)),
border: Border.all(
width: 1.0,
color:
HexColor("#CCCCCC"))),
color: HexColor(
"#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
@ -426,8 +452,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
TranslationBase.of(
context)
.toTime,
type:
DateTimePickerType.time,
type: DateTimePickerType
.time,
controller: _controller5,
onChanged: (val) =>
toTime = val,
@ -457,23 +483,26 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
color:
HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppTextFormField(
hintText: TranslationBase.of(
context)
.fromDate,
hintText:
TranslationBase.of(
context)
.fromDate,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(Icons
.calendar_today)),
textInputType:
TextInputType.number,
controller: _toDateController,
controller:
_toDateController,
onTap: () {
_presentDatePicker(
'fromDate');
@ -493,21 +522,22 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
color:
HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppTextFormField(
hintText: TranslationBase
.of(context)
.toDate,
hintText:
TranslationBase
.of(context)
.toDate,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(
Icons
.calendar_today)),
icon: Icon(Icons
.calendar_today)),
textInputType:
TextInputType.number,
controller:
@ -529,8 +559,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
@ -538,7 +568,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: Padding(
padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9,
bottom:
SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3),
child: Column(
@ -553,7 +584,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
// add Expanded to have your dropdown button fill remaining space
child:
DropdownButtonHideUnderline(
child: DropdownButton(
child:
DropdownButton(
focusColor: Colors.grey,
isExpanded: true,
value: reason == null
@ -564,12 +596,14 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
iconSize: 40,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
(BuildContext
context) {
return model2.allReasons
.map((item) {
return Row(
mainAxisSize:
MainAxisSize.max,
MainAxisSize
.max,
children: <Widget>[
AppText(
projectsProvider
@ -603,7 +637,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
projectsProvider
.isArabic
? item['nameAr']
: item['nameEn'],
: item[
'nameEn'],
textAlign:
TextAlign.end,
),
@ -621,8 +656,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
@ -630,7 +665,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: Padding(
padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9,
bottom:
SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3),
child: Column(
@ -649,33 +685,36 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
dropdownSearchDecoration:
InputDecoration(
contentPadding:
EdgeInsets.all(
0),
border: InputBorder
.none),
EdgeInsets
.all(0),
border:
InputBorder
.none),
//maxHeight: 300,
items: model2
.coveringDoctors
.map((item) {
return projectsProvider
.isArabic
? item['doctorNameN']
: item['doctorName'];
? item[
'doctorNameN']
: item[
'doctorName'];
}).toList(),
// label: "Doctor List",
onChanged: (item) {
model2.coveringDoctors
.forEach((newVal) => {
if (newVal['doctorName'] ==
item ||
newVal['doctorName'] ==
item)
{
doctorID =
newVal[
'DoctorID']
}
});
.forEach(
(newVal) => {
if (newVal['doctorName'] ==
item ||
newVal['doctorName'] ==
item)
{
doctorID =
newVal['DoctorID']
}
});
},
selectedItem:
getSelectedDoctor(
@ -693,8 +732,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
),
popupTitle: Container(
height: 50,
decoration: BoxDecoration(
color: Theme.of(context)
decoration:
BoxDecoration(
color: Theme.of(
context)
.primaryColorDark,
borderRadius:
BorderRadius.only(
@ -712,8 +753,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
style: TextStyle(
fontSize: 24,
fontWeight:
FontWeight.bold,
color: Colors.white,
FontWeight
.bold,
color:
Colors.white,
),
),
),
@ -723,9 +766,11 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
borderRadius:
BorderRadius.only(
topLeft:
Radius.circular(24),
Radius.circular(
24),
topRight:
Radius.circular(24),
Radius.circular(
24),
),
),
),
@ -797,6 +842,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
],
),
)),
SizedBox(height: SizeConfig.screenHeight * .3),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
@ -805,8 +851,11 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
children: <Widget>[
AppButton(
title: widget.isUpdate == true
? TranslationBase.of(context).update
: TranslationBase.of(context).add,
? TranslationBase.of(context)
.updateReschedule
: TranslationBase.of(context)
.addReschedule,
color: HexColor('#359846'),
onPressed: () {
if (offTime == '1' || offTime == '2') {
if (widget.isUpdate == true) {
@ -837,7 +886,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
),
),
),
)));
)));
}
getProfile() async {

@ -6,12 +6,16 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
@ -25,19 +29,94 @@ class AddSickLeavScreen extends StatelessWidget {
onModelReady: (model) => model.getSickLeave(patient.patientMRN),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
appBarTitle: TranslationBase.of(context).sickleave,
body: SingleChildScrollView(
child: Column(children: [
PatientPageHeaderWidget(patient),
PatientProfileHeaderNewDesign(
patient, routeArgs['patientType'], routeArgs['arrivalType']),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).patient,
fontWeight: FontWeight.bold,
),
AppText(
TranslationBase.of(context).sickLeave,
fontSize: 24,
fontWeight: FontWeight.bold,
),
],
)),
Container(
width: SizeConfig.screenWidth,
margin: EdgeInsets.only(
left: 20, right: 20, top: 10, bottom: 10),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: HexColor('#EAEAEA')),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
child: Container(
decoration: BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.circular(10)),
padding: EdgeInsets.all(3),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
color: Colors.white,
),
onPressed: () {
openSickLeave(
context,
false,
);
}),
)),
Padding(
child: AppText(
TranslationBase.of(context).noSickLeaveApplied,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 16,
textAlign: TextAlign.center,
color: HexColor('#7E7E7E')),
padding: EdgeInsets.all(10),
),
],
)),
],
),
model.getAllSIckLeave.length > 0
? Column(
children: model.getAllSIckLeave
.map<Widget>((GetAllSickLeaveResponse item) {
return CardWithBgWidgetNew(
widget: Column(
return RoundedContainer(
child: Column(
children: [
Container(
padding: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
border: Border(
left: BorderSide(
color: item.status == 1
? Colors.yellow[800]
: item.status == 2
? Colors.green
: Colors.black,
width: 5.0,
))),
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
@ -66,42 +145,77 @@ class AddSickLeavScreen extends StatelessWidget {
context)
.all,
fontWeight: FontWeight.bold,
color: Colors.white,
color: item.status == 1
? Colors.yellow[800]
: item.status == 2
? Colors.green
: Colors.black,
),
color: item.status == 1
? Colors.yellow[800]
: item.status == 2
? Colors.green
: Colors.black,
),
Row(
children: [
AppText(TranslationBase.of(
context)
.daysSickleave),
AppText(
item.noOfDays.toString(),
fontWeight: FontWeight.bold,
),
],
),
Row(
children: [
AppText(
TranslationBase.of(context)
.leaveStartDate +
.startDate +
' ',
fontWeight: FontWeight.bold,
),
Flexible(
child: Text(
item.startDate,
overflow:
TextOverflow.ellipsis,
child: AppText(
DateUtils
.convertStringToDateFormat(
item.startDate,
'dd-MMM-yyyy'),
fontWeight: FontWeight.bold,
))
],
),
AppText(
item.noOfDays.toString() +
' ' +
TranslationBase.of(context)
.daysSickleave,
fontWeight: FontWeight.bold,
),
Row(children: [
AppText(
item.remarks ?? "",
)
]),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
AppText(
item.remarks ?? "",
),
(item.status == 1 ||
item.status == 2)
? IconButton(
icon: Image.asset(
'assets/images/edit.png'),
// color: Colors.green, //Colors.black,
onPressed: () => {
if (item.status ==
1)
{
DrAppToastMsg.showErrorToast(
TranslationBase.of(
context)
.sickleaveonhold)
}
else
{
openSickLeave(
context,
true,
extendedData:
item)
}
},
)
: SizedBox()
]),
],
),
SizedBox(
@ -110,106 +224,104 @@ class AddSickLeavScreen extends StatelessWidget {
],
),
),
(item.status == 1 || item.status == 2)
? Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.open_in_full,
size: 25,
color: item.status == 1
? Colors.grey[400]
: Colors.black,
),
// color: Colors.green, //Colors.black,
onPressed: () => {
if (item.status == 1)
{
DrAppToastMsg.showErrorToast(
TranslationBase.of(
context)
.sickleaveonhold)
}
else
{
openSickLeave(context, true,
extendedData: item)
}
},
))
: SizedBox(),
],
)),
SizedBox(
height: 20,
),
Divider(
height: 1,
),
],
));
}).toList(),
)
: new Builder(builder: (context) {
return Container(
height: MediaQuery.of(context).size.height * .7,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.all(40),
decoration: BoxDecoration(
border: Border.all(
color: HexColor('#B8382C'), width: 4),
borderRadius:
BorderRadius.all(Radius.circular(100))),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
),
onPressed: () {
openSickLeave(
context,
false,
);
}),
),
Padding(
child: AppText(
TranslationBase.of(context)
.noSickLeaveApplied,
fontWeight: FontWeight.bold,
),
padding: EdgeInsets.all(10),
),
AppText(
TranslationBase.of(context).applyNow,
fontWeight: FontWeight.bold,
color: HexColor('#B8382C'),
)
],
));
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).patient,
fontWeight: FontWeight.bold,
),
AppText(
TranslationBase.of(context).sickLeave,
fontSize: 24,
fontWeight: FontWeight.bold,
),
],
)),
Container(
width: SizeConfig.screenWidth,
margin: EdgeInsets.only(
left: 20, right: 20, top: 20, bottom: 20),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: HexColor('#EAEAEA')),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
child: Container(
decoration: BoxDecoration(
color: Colors.grey,
borderRadius:
BorderRadius.circular(10)),
padding: EdgeInsets.all(3),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
color: Colors.white,
),
onPressed: () {
openSickLeave(
context,
false,
);
}),
)),
Padding(
child: AppText(
TranslationBase.of(context)
.noSickLeaveApplied,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 16,
textAlign: TextAlign.center,
color: HexColor('#7E7E7E')),
padding: EdgeInsets.all(10),
),
],
)),
SizedBox(
height: SizeConfig.screenHeight * .6,
)
],
);
}),
]))));
}
openSickLeave(BuildContext context, isExtend,
{GetAllSickLeaveResponse extendedData}) {
showModalBottomSheet(
context: context,
builder: (context) {
return new Container(
child: SickLeaveScreen(
appointmentNo: isExtend == true
? extendedData.appointmentNo
: patient.appointmentNo, //extendedData.appointmentNo,
patientMRN: isExtend == true
? extendedData.patientMRN
: patient.patientMRN,
isExtended: isExtend,
extendedData: extendedData,
patient: patient));
});
// showModalBottomSheet(
// context: context,
// builder: (context) {
// return new Container(
// child:
Navigator.push(
context,
FadePage(
page: SickLeaveScreen(
appointmentNo: isExtend == true
? extendedData.appointmentNo
: patient.appointmentNo, //extendedData.appointmentNo,
patientMRN: isExtend == true
? extendedData.patientMRN
: patient.patientMRN,
isExtended: isExtend,
extendedData: extendedData,
patient: patient)));
}
}

@ -6,12 +6,15 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
@ -23,22 +26,34 @@ class ShowSickLeaveScreen extends StatelessWidget {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
return BaseView<SickLeaveViewModel>(
onModelReady: (model) => model.getSickLeave(patient.patientMRN ?? patient.patientId),
onModelReady: (model) =>
model.getSickLeave(patient.patientMRN ?? patient.patientId),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).sickleave,
body: SingleChildScrollView(
child: Column(
children: [
PatientPageHeaderWidget(patient),
PatientProfileHeaderNewDesign(
patient, routeArgs['patientType'], routeArgs['arrivalType']),
Column(
children: model.getAllSIckLeave
.map<Widget>((GetAllSickLeaveResponse item) {
return CardWithBgWidgetNew(
widget: Column(
return RoundedContainer(
child: Column(
children: [
Container(
padding: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
border: Border(
left: BorderSide(
color: item.status == 1
? Colors.yellow[800]
: item.status == 2
? Colors.green
: Colors.black,
width: 5.0,
))),
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
@ -66,41 +81,74 @@ class ShowSickLeaveScreen extends StatelessWidget {
context)
.all,
fontWeight: FontWeight.bold,
color: Colors.white,
color: item.status == 1
? Colors.yellow[800]
: item.status == 2
? Colors.green
: Colors.black,
),
color: item.status == 1
? Colors.yellow[800]
: item.status == 2
? Colors.green
: Colors.black,
),
Row(
children: [
AppText(TranslationBase.of(context)
.daysSickleave),
AppText(
item.noOfDays.toString(),
fontWeight: FontWeight.bold,
),
],
),
Row(
children: [
AppText(
TranslationBase.of(context)
.leaveStartDate +
.startDate +
' ',
fontWeight: FontWeight.bold,
),
Flexible(
child: Text(
item.startDate,
overflow: TextOverflow.ellipsis,
child: AppText(
DateUtils
.convertStringToDateFormat(
item.startDate,
'dd-MMM-yyyy'),
fontWeight: FontWeight.bold,
))
],
),
AppText(
item.noOfDays.toString() +
' ' +
TranslationBase.of(context)
.daysSickleave,
fontWeight: FontWeight.bold,
),
Row(children: [
AppText(
item.remarks ?? "",
)
]),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
AppText(
item.remarks ?? "",
),
(item.status == 1 ||
item.status == 2)
? IconButton(
icon: Image.asset(
'assets/images/edit.png'),
// color: Colors.green, //Colors.black,
onPressed: () => {
if (item.status == 1)
{
DrAppToastMsg.showErrorToast(
TranslationBase.of(
context)
.sickleaveonhold)
}
// else
// {
// openSickLeave(
// context,
// true,
// extendedData:
// item)
// }
},
)
: SizedBox()
]),
],
),
SizedBox(
@ -109,15 +157,8 @@ class ShowSickLeaveScreen extends StatelessWidget {
],
),
),
],
)),
SizedBox(
height: 20,
),
Divider(
height: 1,
),
],
));
}).toList(),
@ -128,6 +169,4 @@ class ShowSickLeaveScreen extends StatelessWidget {
),
);
}
}

@ -89,7 +89,10 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
},
child: AppScaffold(
baseViewModel: model2,
isShowAppBar: false,
appBarTitle: widget.isExtended == true
? TranslationBase.of(context).extendSickLeave
: TranslationBase.of(context).addSickLeave,
isShowAppBar: true,
body: Center(
child: Container(
margin: EdgeInsets.only(top: 10),
@ -97,29 +100,40 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
widthFactor: 0.9,
child: ListView(
children: [
Padding(
child: AppText(
widget.isExtended == true
? TranslationBase.of(context)
.extendSickLeave
: TranslationBase.of(context)
.addSickLeave,
fontWeight: FontWeight.bold,
),
padding: EdgeInsets.all(10)),
// Padding(
// child: AppText(
// widget.isExtended == true
// ? TranslationBase.of(context)
// .extendSickLeave
// : TranslationBase.of(context)
// .addSickLeave,
// fontWeight: FontWeight.bold,
// ),
// padding: EdgeInsets.all(10)),
Container(
margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
width: 1.0,
color: HexColor("#CCCCCC"),
),
color: Colors.white),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
top: 5, left: 10, right: 10),
child: AppText(
TranslationBase.of(context)
.sickLeave +
' ' +
TranslationBase.of(context)
.days)),
AppTextFormField(
borderColor: Colors.white,
onChanged: (value) {
@ -132,8 +146,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
hintText: widget.extendedData != null
? widget.extendedData.noOfDays
.toString()
: TranslationBase.of(context)
.sickLeaveDays,
: '',
// validator: (value) {
// return TextValidator().validateName(value);
// },
@ -146,25 +159,28 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
Container(
margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC")),
color: Colors.white,
),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
// AppText(
// TranslationBase.of(context).sickLeaveDate,
// fontSize: 10,
// ),
Padding(
padding: EdgeInsets.only(
top: 5, left: 10, right: 10),
child: AppText(
TranslationBase.of(context)
.sickLeaveDate,
)),
AppTextFormField(
hintText: widget.extendedData != null
? widget.extendedData.startDate
: TranslationBase.of(context)
.sickLeaveDate,
: '',
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(Icons.calendar_today)),
@ -188,11 +204,12 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
margin: EdgeInsets.only(
top: 10, left: 10, right: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC")),
color: Colors.white,
),
width: double.infinity,
child: Padding(
padding: EdgeInsets.only(
@ -205,10 +222,12 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
// AppText(
// TranslationBase.of(context).clinicName,
// fontSize: 10,
// ),
Padding(
padding: EdgeInsets.only(top: 5),
child: AppText(
TranslationBase.of(context)
.clinicName,
)),
Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
@ -291,19 +310,23 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
Container(
margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC")),
color: Colors.white,
),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// AppText(
// TranslationBase.of(context).doctorName,
// fontSize: 10,
// ),
Padding(
padding: EdgeInsets.only(
top: 5, left: 10, right: 10),
child: AppText(
TranslationBase.of(context)
.doctorName,
)),
new IgnorePointer(
ignoring: true,
child: AppTextFormField(
@ -324,19 +347,22 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
Container(
margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC")),
color: Colors.white,
),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// AppText(
// TranslationBase.of(context).remarks,
// fontSize: 10,
// ),
Padding(
padding: EdgeInsets.only(
top: 5, left: 10, right: 10),
child: AppText(
TranslationBase.of(context).remarks,
)),
TextField(
maxLines: 3,
decoration: InputDecoration(
@ -344,8 +370,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
border: InputBorder.none,
hintText: widget.extendedData != null
? widget.extendedData.remarks
: TranslationBase.of(context)
.remarks),
: ''),
onChanged: (value) {
addSickLeave.remarks = value;
if (widget.extendedData != null) {
@ -365,7 +390,9 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
AppButton(
title: widget.isExtended == true
? TranslationBase.of(context).extend
: TranslationBase.of(context).add,
: TranslationBase.of(context)
.addSickLeaverequest,
color: Colors.green,
onPressed: () async {
if (widget.isExtended) {
await model2.extendSickLeave(

@ -302,4 +302,14 @@ class DateUtils {
}
return "$years ${TranslationBase.of(context).years} $months ${TranslationBase.of(context).months} $days ${TranslationBase.of(context).days}";
}
static bool isToday(DateTime dateTime){
DateTime todayDate = DateTime.now().toUtc();
if(dateTime.day == todayDate.day && dateTime.month == todayDate.month && dateTime.year == todayDate.year) {
return true;
}
return false;
}
}

@ -523,7 +523,10 @@ class TranslationBase {
localizedValues['add-sickleave'][locale.languageCode];
String get add => localizedValues['add'][locale.languageCode];
String get addSickLeaverequest =>
localizedValues['addSickLeaveRequest'][locale.languageCode];
String get extendSickLeaverequest =>
localizedValues['extendSickLeaveRequest'][locale.languageCode];
String get approved => localizedValues['approved'][locale.languageCode];
String get extended => localizedValues['extended'][locale.languageCode];
@ -1145,26 +1148,46 @@ class TranslationBase {
String get billNo => localizedValues['BillNo'][locale.languageCode];
String get labResults => localizedValues['labResults'][locale.languageCode];
String get sendSuc => localizedValues['sendSuc'][locale.languageCode];
String get specialResult => localizedValues['SpecialResult'][locale.languageCode];
String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode];
String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode];
String get specialResult =>
localizedValues['SpecialResult'][locale.languageCode];
String get noDataAvailable =>
localizedValues['noDataAvailable'][locale.languageCode];
String get showMoreBtn =>
localizedValues['show-more-btn'][locale.languageCode];
String get fileNumber => localizedValues['fileNumber'][locale.languageCode];
String get reschedule => localizedValues['reschedule'][locale.languageCode];
String get leaves => localizedValues['leaves'][locale.languageCode];
String get openRad => localizedValues['open-rad'][locale.languageCode];
String get totalApproval => localizedValues['totalApproval'][locale.languageCode];
String get procedureStatus => localizedValues['procedureStatus'][locale.languageCode];
String get totalApproval =>
localizedValues['totalApproval'][locale.languageCode];
String get procedureStatus =>
localizedValues['procedureStatus'][locale.languageCode];
String get unusedCount => localizedValues['unusedCount'][locale.languageCode];
String get companyName => localizedValues['companyName'][locale.languageCode];
String get procedureName => localizedValues['procedureName'][locale.languageCode];
String get procedureName =>
localizedValues['procedureName'][locale.languageCode];
String get usageStatus => localizedValues['usageStatus'][locale.languageCode];
String get prescriptions => localizedValues['prescriptions'][locale.languageCode];
String get prescriptions =>
localizedValues['prescriptions'][locale.languageCode];
String get notes => localizedValues['notes'][locale.languageCode];
String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode];
String get searchWithOther =>
localizedValues['searchWithOther'][locale.languageCode];
String get hideOtherCriteria =>
localizedValues['hideOtherCriteria'][locale.languageCode];
String get applyForReschedule =>
localizedValues['applyForReschedule'][locale.languageCode];
String get startDate => localizedValues['startDate'][locale.languageCode];
String get endDate => localizedValues['endDate'][locale.languageCode];
String get addReschedule =>
localizedValues['add-reschedule'][locale.languageCode];
String get updateReschedule =>
localizedValues['update-reschedule'][locale.languageCode];
String get sickLeave => localizedValues['sick_leave'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,8 +1,9 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -16,58 +17,83 @@ class MyScheduleWidget extends StatelessWidget {
List<WorkingHours> workingHours = Helpers.getWorkingHours(
workingHoursTable.workingHours,
);
return CardWithBgWidgetNew(
widget: Container(
child: Column(
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Column(
children: [
Divider(
height: 1,
color: Colors.grey,
thickness: 1.0,
),
],
children: [
SizedBox(
height: 10,
),
AppText(
workingHoursTable.dayName,
fontSize: 2.5 * SizeConfig.textMultiplier,
fontFamily: 'Poppins',
// fontSize: 18
),
SizedBox(
height: 10,
),
Row(
children: <Widget>[
AppText(
workingHoursTable.dayName,
fontSize: 2.5 * SizeConfig.textMultiplier,
),
AppText(
' ${workingHoursTable.date.day}/${workingHoursTable.date.month}/${workingHoursTable.date.year}',
fontSize: 2.2 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
),
],
AppText(
' ${workingHoursTable.date.day} ${(DateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}',
fontSize: 2.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
// fontSize: 18
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: workingHours.map((work) {
return Container(
child: Column(
children: <Widget>[
SizedBox(
height: 5,
),
AppText(
work.from + ' - ' + work.to,
fontSize: 2.0 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
],
),
Container(
width: MediaQuery.of(context).size.width * 0.55,
child: CardWithBgWidget(
bgColor: DateUtils.isToday(workingHoursTable.date)
? Colors.green[500]
: Colors.transparent,
// hasBorder: false,
widget: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if (DateUtils.isToday(workingHoursTable.date))
AppText(
"Today",
fontSize: 2.5 * SizeConfig.textMultiplier,
fontFamily: 'Poppins',
color: Colors.green[500],
// fontSize: 18
),
SizedBox(
height: 10,
),
);
}).toList(),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: workingHours.map((work) {
return Container(
child: Column(
children: <Widget>[
SizedBox(
height: 5,
),
AppText(
work.from + ' - ' + work.to,
fontSize: 2.0 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
);
}).toList(),
),
],
),
),
],
),
),
),
],
);
}
}

@ -84,13 +84,15 @@ class PatientCard extends StatelessWidget {
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
: AppText(
DateUtils.convertStringToDateFormat(
patientInfo.arrivedOn,
'MM-dd-yyyy HH:mm'),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
: patientInfo.arrivedOn != null
? AppText(
DateUtils.convertStringToDateFormat(
patientInfo.arrivedOn,
'MM-dd-yyyy HH:mm'),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
: SizedBox()
],
))
: SizedBox(),
@ -124,7 +126,9 @@ class PatientCard extends StatelessWidget {
AppText(
patientInfo.nationalityName != null
? patientInfo.nationalityName
: patientInfo.nationality,
: patientInfo.nationality != null
? patientInfo.nationality
: "",
fontWeight: FontWeight.bold,
fontSize: 14,
),
@ -286,29 +290,29 @@ class PatientCard extends StatelessWidget {
children: [
Container(
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(8),
topLeft: Radius.circular(8),
),
color: patientInfo.appointmentType ==
'Regular' &&
patientInfo.visitTypeId == 100
? HexColor('#D02127')
: patientInfo.appointmentType ==
'Walkin'
? HexColor('#28323A')
: HexColor('#6C7379'),
),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.only(
// bottomRight: Radius.circular(8),
// topLeft: Radius.circular(8),
// ),
// color: patientInfo.appointmentType ==
// 'Regular' &&
// patientInfo.visitTypeId == 100
// ? HexColor('#D02127')
// : patientInfo.appointmentType ==
// 'Walkin'
// ? HexColor('#28323A')
// : HexColor('#6C7379'),
// ),
child: Image.asset(
patientInfo.appointmentType ==
'Regular' &&
patientInfo.visitTypeId == 100
? 'assets/images/type-livecare.png'
? 'assets/images/livecare.png'
: patientInfo.appointmentType ==
'Walkin'
? 'assets/images/type-walkin.png'
: 'assets/images/type-booked.png',
? 'assets/images/walkin.png'
: 'assets/images/booked.png',
height: 25,
width: 35,
)),

@ -15,6 +15,7 @@ class AppButton extends StatefulWidget {
final Color fontColor;
final bool loading;
final bool disabled;
final FontWeight fontWeight;
AppButton(
{@required this.onPressed,
@ -25,7 +26,8 @@ class AppButton extends StatefulWidget {
this.padding = 13,
this.loading = false,
this.disabled = false,
this.fontColor = Colors.white});
this.fontColor = Colors.white,
this.fontWeight});
_AppButtonState createState() => _AppButtonState();
}
@ -76,6 +78,7 @@ class _AppButtonState extends State<AppButton> {
widget.title.toUpperCase(),
color: widget.fontColor,
fontSize: SizeConfig.textMultiplier * widget.fontSize,
fontWeight: widget.fontWeight,
),
],
),

@ -31,14 +31,6 @@ class _AppDrawerState extends State<AppDrawer> {
Helpers helpers = new Helpers();
ProjectViewModel projectsProvider;
// @override
// void didChangeDependencies() {
// super.didChangeDependencies();
// // if (_isInit) {
// getDocProfile(); // TODO: Refactor this code to prevent errors in the cosole.
// // }
// _isInit = false;
// }
@override
Widget build(BuildContext context) {
@ -47,127 +39,112 @@ class _AppDrawerState extends State<AppDrawer> {
return RoundedContainer(
child: Container(
color: Colors.white,
// margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2),
child: Drawer(
child: Column(children: <Widget>[
Expanded(
flex: 4,
child: ListView(padding: EdgeInsets.zero, children: <Widget>[
Container(
margin: EdgeInsets.symmetric(horizontal: 20),
height: SizeConfig.heightMultiplier * 50,
child: InkWell(
child: DrawerHeader(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
child: Image.asset(
'assets/images/logo.png',
),
margin: EdgeInsets.only(top: 10, bottom: 15),
),
SizedBox(
height: 1,
child: Container(
color: Colors.black26,
),
),
SizedBox(height: 15),
InkWell(
onTap: () {
Navigator.of(context)
.pushNamed(PROFILE, arguments: {
'title': authProvider.doctorProfile.doctorName,
"doctorProfileall": authProvider.doctorProfile
});
},
child: Column(
children: [
authProvider.doctorProfile != null
? CircleAvatar(
radius:
SizeConfig.imageSizeMultiplier * 12,
// radius: (52)
child: ClipRRect(
borderRadius: BorderRadius.circular(50),
child: Image.network(
authProvider
.doctorProfile.doctorImageURL,
fit: BoxFit.fill,
width: 700,
),
),
backgroundColor: Colors.transparent,
)
: SizedBox(),
authProvider.doctorProfile != null
? Padding(
padding: EdgeInsets.only(top: 10),
child: AppText(
TranslationBase.of(context).dr +
authProvider
.doctorProfile?.doctorName,
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: SizeConfig.textMultiplier * 2,
))
: SizedBox(),
],
),
),
RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0),
side: BorderSide(color: Colors.red)),
child: AppText(
TranslationBase.of(context).logout,
color: Colors.white,
),
onPressed: () async {
Navigator.pop(context);
await helpers.logout();
projectsProvider.isLogin = false;
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: Image.asset(
'assets/images/dr_app_logo.png',
),
margin: EdgeInsets.only(top: 10, bottom: 15),
),
SizedBox(height: 15),
if (authProvider.doctorProfile != null)
InkWell(
onTap: () {
Navigator.of(context).pushNamed(PROFILE, arguments: {
'title': authProvider.doctorProfile.doctorName,
"doctorProfileall": authProvider.doctorProfile
});
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 10),
child: AppText(
TranslationBase.of(context).dr +
authProvider.doctorProfile?.doctorName,
fontWeight: FontWeight.bold,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.5,
),
),
Padding(
padding: EdgeInsets.only(top: 5),
child: AppText(
authProvider.doctorProfile?.clinicDescription,
fontWeight: FontWeight.w600,
color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 2,
fontFamily: 'Poppins',
))
],
),
],
),
SizedBox(height: 15),
InkWell(
child: DrawerItem(
TranslationBase.of(context).rescheduleLeaves,
// " or " +
// TranslationBase.of(context).leaves,
DoctorApp.leaves,
// subTitle: ,
),
onTap: () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddRescheduleLeavScreen(),
// MyReferredPatient(),
));
},
),
),
],
),
),
InkWell(
child: DrawerItem(
TranslationBase.of(context).settings, Icons.settings),
onTap: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(SETTINGS);
},
SizedBox(
height: 40,
),
InkWell(
child: DrawerItem(
TranslationBase.of(context).reschedule,
DoctorApp.leaves,
subTitle: TranslationBase.of(context).leaves,
Container(
margin: EdgeInsets.symmetric(horizontal: 20),
child: Column(
children: [
InkWell(
child: DrawerItem(
TranslationBase.of(context).logout, Icons.settings),
onTap: () async {
Navigator.pop(context);
await helpers.logout();
projectsProvider.isLogin = false;
},
),
InkWell(
child: DrawerItem(
projectsProvider.isArabic
? TranslationBase.of(context).lanEnglish
: TranslationBase.of(context).lanArabic,
DoctorApp.qr_code),
onTap: () {
if (projectsProvider.isArabic)
projectsProvider.changeLanguage('en');
else
projectsProvider.changeLanguage('ar');
},
),
],
),
onTap: () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddRescheduleLeavScreen(),
// MyReferredPatient(),
));
},
),
InkWell(
child: DrawerItem(
TranslationBase.of(context).qr +
TranslationBase.of(context).reader,
DoctorApp.qr_code),
onTap: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(QR_READER);
},
),
]),
),
@ -179,14 +156,35 @@ class _AppDrawerState extends State<AppDrawer> {
child: Align(
alignment: FractionalOffset.bottomCenter,
child: Container(
child: Column(
children: <Widget>[
Text("Powered by"),
Image.asset(
'assets/images/cs_logo_container.png',
width: SizeConfig.imageSizeMultiplier * 30,
)
],
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width *0.3,
child: RichText(
text: TextSpan(
text: 'Powered by',
style: TextStyle(
color: Color(0xFF989898),
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2,
fontFamily: 'Poppins',),
children: <TextSpan>[
TextSpan(text: ' Cloud Solutions',
style: TextStyle(
color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 2,
fontFamily: 'Poppins',),
)
]
),),
),
// Text("Powered by"),
Image.asset(
'assets/images/cs_logo_container.png',
width: SizeConfig.imageSizeMultiplier * 20,
)
],
))))
]))
])),

@ -24,14 +24,14 @@ class CardWithBgWidget extends StatelessWidget {
ProjectViewModel projectProvider = Provider.of(context);
return Container(
margin: EdgeInsets.symmetric(vertical: 10.0),
width: double.infinity,
// width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(
color: hasBorder ? HexColor('#707070') : Colors.transparent,
width: hasBorder ? 2.0 : 0),
width: hasBorder ? 0.30 : 0),
),
child: Material(
borderRadius: BorderRadius.all(Radius.circular(10.0)),

@ -26,7 +26,7 @@ class _DrawerItemState extends State<DrawerItem> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10),
margin: EdgeInsets.only(top: 5, bottom: 5, left: 0, right: 0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
@ -39,15 +39,19 @@ class _DrawerItemState extends State<DrawerItem> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
widget.title,
color: widget.color ?? Colors.black,
textOverflow: TextOverflow.ellipsis,
// fontWeight: FontWeight.bold,
// margin: 5,
marginLeft: 5,
marginRight: 5,
fontSize: SizeConfig.textMultiplier * 2.3,
Container(
width: MediaQuery.of(context).size.width *0.45,
child: Expanded(
child: AppText(
widget.title,
marginLeft: 5,
marginRight: 5,
color:widget.color ??Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 2.0,
fontFamily: 'Poppins',
fontWeight: FontWeight.bold,
),
),
),
AppText(
widget.subTitle,

@ -566,7 +566,7 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.2"
version: "0.6.3-nullsafety.1"
json_annotation:
dependency: transitive
description:
@ -608,7 +608,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.3.0-nullsafety.4"
mime:
dependency: transitive
description:
@ -900,7 +900,7 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.1"
version: "1.10.0-nullsafety.2"
stream_channel:
dependency: transitive
description:
@ -1084,5 +1084,5 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=2.10.0 <2.11.0"
dart: ">=2.10.0 <=2.11.0-213.1.beta"
flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save