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

merge-requests/389/head
Mohammad Aljammal 5 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_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; 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 BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; 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_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
///Prescriptions ///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS = const GET_PRESCRIPTIONS_ALL_ORDERS =
@ -246,7 +247,6 @@ const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh'; 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
var selectedPatientType = 1; var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************ //*********change value to decode json from Dropdown ************

@ -277,7 +277,7 @@ const Map<String, Map<String, String>> localizedValues = {
"doc-name": {"en": "Doctor Name", "ar": "اسم الطبيب"}, "doc-name": {"en": "Doctor Name", "ar": "اسم الطبيب"},
"clinicname": {"en": "Clinic Name", "ar": "اسم العيادة"}, "clinicname": {"en": "Clinic Name", "ar": "اسم العيادة"},
"sick-leave-date": {"en": "Sick leave date ", "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': 'تفاصيل القبول: '}, 'admissionDetail': {'en': 'ADMISSION DETAIL: ', 'ar': 'تفاصيل القبول: '},
'dateTime': {'en': 'DATE / TIME:', 'ar': 'التاريخ / الوقت:'}, 'dateTime': {'en': 'DATE / TIME:', 'ar': 'التاريخ / الوقت:'},
'date': {'en': 'Date', 'ar': 'التاريخ'}, 'date': {'en': 'Date', 'ar': 'التاريخ'},
@ -302,8 +302,8 @@ const Map<String, Map<String, String>> localizedValues = {
"ar": "يرجى ادخال هذا الحقل" "ar": "يرجى ادخال هذا الحقل"
}, },
'no-sickleve-applied': { 'no-sickleve-applied': {
'en': "No sick leave applied", 'en': "No sick leave available, apply Now",
'ar': 'لم تطبق إجازة مرضية' 'ar': 'لا توجد إجازة مرضية متاحة ، تقدم بطلب الآن'
}, },
'applynow': {'en': "Apply Now", 'ar': 'قدم الآن'}, 'applynow': {'en': "Apply Now", 'ar': 'قدم الآن'},
'add-sickleave': {'en': "ADD SICK LEAVE", 'ar': 'أضف إجازة مرضية'}, 'add-sickleave': {'en': "ADD SICK LEAVE", 'ar': 'أضف إجازة مرضية'},
@ -394,7 +394,7 @@ const Map<String, Map<String, String>> localizedValues = {
'painManagement': {'en': "Pain Management", 'ar': 'إدارة الألم'}, 'painManagement': {'en': "Pain Management", 'ar': 'إدارة الألم'},
'holiday': {'en': "Holiday", 'ar': 'يوم الاجازة'}, 'holiday': {'en': "Holiday", 'ar': 'يوم الاجازة'},
'to': {'en': "To", 'ar': 'إلى'}, 'to': {'en': "To", 'ar': 'إلى'},
'coveringDoctor': {'en': "Covering Doctor", 'ar': 'تغطية دكتور'}, 'coveringDoctor': {'en': "Covering Doctor: ", 'ar': ' :تغطية دكتور'},
'requestLeave': {'en': 'Request Leave', 'ar': 'طلب إجازة'}, 'requestLeave': {'en': 'Request Leave', 'ar': 'طلب إجازة'},
'pleaseEnterDate': { 'pleaseEnterDate': {
'en': 'Please enter leave start date', 'en': 'Please enter leave start date',
@ -785,7 +785,30 @@ const Map<String, Map<String, String>> localizedValues = {
"prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, "prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"},
"notes": {"en": "Notes", "ar": "ملاحظات"}, "notes": {"en": "Notes", "ar": "ملاحظات"},
"dailyDoses": {"en": "Daily Doses", "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/core/viewModel/medical_file_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.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/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.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/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/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-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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_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:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class MedicalFilePage extends StatefulWidget { class MedicalFilePage extends StatefulWidget {
@override @override
@ -21,6 +28,9 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
return BaseView<MedicalFileViewModel>( return BaseView<MedicalFileViewModel>(
onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId),
builder: builder:
@ -32,18 +42,45 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
baseViewModel: model, baseViewModel: model,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
color: Colors.white,
child: Column( child: Column(
// mainAxisAlignment: model.medicalFileList.length != 0 && // mainAxisAlignment: model.medicalFileList.length != 0 &&
// model.medicalFileList != null // model.medicalFileList != null
// ? MainAxisAlignment.start // ? MainAxisAlignment.start
// : MainAxisAlignment.center, // : MainAxisAlignment.center,
children: [ children: [
PatientPageHeaderWidget(patient), PatientProfileHeaderNewDesign(
Divider( patient, patient.patientType.toString(), arrivalType),
height: 1.0, Padding(
thickness: 1.0, padding:
color: Colors.grey, 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 != null &&
model.medicalFileList.length != 0) model.medicalFileList.length != 0)
@ -60,66 +97,155 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
horizontal: 12.0, vertical: 8.0), horizontal: 12.0, vertical: 8.0),
child: InkWell( child: InkWell(
child: Container( 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( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( Row(
TranslationBase.of(context).branch + children: [
": ", AppText(
fontWeight: FontWeight.w700, model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.doctorName,
fontWeight: FontWeight.w700,
fontSize: 17.0,
fontFamily: 'Poppins',
)
],
), ),
AppText(model Row(
.medicalFileList[0] children: [
.entityList[0] AppText(
.timelines[index] Helpers.convertStringToDate(model
.projectName), .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( Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
AppText( Padding(
TranslationBase.of(context) padding: const EdgeInsets.all(8.0),
.doctorName child: Column(
.toUpperCase() + children: [
": ", ClipRRect(
fontWeight: FontWeight.w700, borderRadius:
), BorderRadius.all(
Expanded( Radius.circular(30)),
child: AppText( child: Image.network(
model 'https://previews.123rf.com/images/yupiramos/yupiramos1705/yupiramos170524444/78443570-a-female-doctor-avatar-character-vector-illustration-design.jpg',
.medicalFileList[0] fit: BoxFit.cover,
.entityList[0] width: 60,
.timelines[index] height: 70,
.doctorName, ),
fontWeight: FontWeight.w700, ),
],
), ),
), ),
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( Row(
mainAxisAlignment:
MainAxisAlignment.end,
children: [ children: [
AppText( Column(
TranslationBase.of(context) children: [
.clinicName + Icon(
": ", Icons.remove_red_eye,
fontWeight: FontWeight.w700, size: 30.0,
), )
AppText( ],
model )
.medicalFileList[0]
.entityList[0]
.timelines[index]
.clinicName,
),
], ],
), ),
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, gender: patient.genderDescription,
encounterNumber: index, encounterNumber: index,
pp: patient.patientId, pp: patient.patientId,
patient: patient,
)), )),
); );
}, },
), ),
); );
}) })
: Container( : Column(
child: AppText( children: [
'THERES NO MEDICAL FILE FOR THIS Patient', Container(
), child: AppText(
'THERES NO MEDICAL FILE FOR THIS Patient',
),
),
SizedBox(
height: 400,
)
],
) )
], ],
), ),

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

@ -225,6 +225,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
return SingleChildScrollView( return SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 1.45, height: MediaQuery.of(context).size.height * 1.45,
color: Color(0xffF8F8F8),
child: Padding( child: Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 12.0, vertical: 10.0), horizontal: 12.0, vertical: 10.0),
@ -232,9 +233,26 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.spaceEvenly, //mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
AppText( Row(
TranslationBase.of(context).medicines.toUpperCase(), children: [
fontWeight: FontWeight.w900, 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( SizedBox(
height: spaceBetweenTextFileds, height: spaceBetweenTextFileds,
@ -248,6 +266,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container( Container(
height: MediaQuery.of(context).size.height * height: MediaQuery.of(context).size.height *
0.070, 0.070,
color: Colors.white,
child: InkWell( child: InkWell(
onTap: model.allMedicationList != null onTap: model.allMedicationList != null
? () { ? () {
@ -340,17 +359,17 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
itemID: _selectedMedication itemID: _selectedMedication
.itemId); .itemId);
}, },
decoration: decoration: textFieldSelectorDecoration(
textFieldSelectorDecoration( TranslationBase.of(context)
TranslationBase.of(context) .searchMedicineNameHere,
.searchMedicineNameHere, _selectedMedication != null
_selectedMedication != null ? _selectedMedication
? _selectedMedication .description +
.description + ('${_selectedMedication.genericName}')
('${_selectedMedication.genericName}') : null,
: null, false,
true, suffixIcon:
), Icon(Icons.search)),
enabled: false, enabled: false,
), ),
), ),
@ -361,7 +380,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container( Container(
child: Row( child: Row(
children: [ children: [
AppText('Order Type'), AppText(
'Order Type',
fontWeight: FontWeight.w600,
),
Radio( Radio(
activeColor: Color(0xFFB9382C), activeColor: Color(0xFFB9382C),
value: 1, value: 1,
@ -445,6 +467,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
width: 10.0, width: 10.0,
), ),
Container( Container(
color: Colors.white,
width: MediaQuery.of(context) width: MediaQuery.of(context)
.size .size
.width * .width *
@ -489,7 +512,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: TextField( child: TextField(
decoration: decoration:
textFieldSelectorDecoration( textFieldSelectorDecoration(
'UNIT Type', 'UNIT',
units != null units != null
? units['description'] ? units['description']
: null, : null,
@ -504,6 +527,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell( child: InkWell(
onTap: model.itemMedicineListRoute != null onTap: model.itemMedicineListRoute != null
? () { ? () {
@ -553,6 +577,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell( child: InkWell(
onTap: model.itemMedicineList != null onTap: model.itemMedicineList != null
? () { ? () {
@ -620,6 +645,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell( child: InkWell(
onTap: model.medicationDoseTimeList != onTap: model.medicationDoseTimeList !=
null null
@ -667,6 +693,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
width: double.infinity, width: double.infinity,
color: Colors.white,
child: Row( child: Row(
children: [ children: [
Container( Container(
@ -692,7 +719,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
indication != null indication != null
? indication['name'] ? indication['name']
: null, : null,
true), false),
enabled: true, enabled: true,
readOnly: true, readOnly: true,
), ),
@ -703,6 +730,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.size .size
.width * .width *
0.65, 0.65,
color: Colors.white,
child: InkWell( child: InkWell(
onTap: indicationList != null onTap: indicationList != null
? () { ? () {
@ -722,7 +750,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
indication != null indication != null
? indication['name'] ? indication['name']
: null, : null,
true), false),
enabled: true, enabled: true,
readOnly: true, readOnly: true,
), ),
@ -734,22 +762,21 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell( child: InkWell(
onTap: () => onTap: () =>
selectDate(context, widget.model), selectDate(context, widget.model),
child: TextField( child: TextField(
decoration: decoration: textFieldSelectorDecoration(
Helpers.textFieldSelectorDecoration( TranslationBase.of(context).date,
TranslationBase.of(context) selectedDate != null
.date, ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
selectedDate != null : null,
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" true,
: null, suffixIcon: Icon(
true, Icons.calendar_today,
suffixIcon: Icon( color: Colors.black,
Icons.calendar_today, )),
color: Colors.black,
)),
enabled: false, enabled: false,
), ),
), ),
@ -757,6 +784,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell( child: InkWell(
onTap: model.medicationDurationList != onTap: model.medicationDurationList !=
null null
@ -825,6 +853,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell( child: InkWell(
onTap: model.allMedicationList != null onTap: model.allMedicationList != null
? () { ? () {
@ -857,7 +886,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
"UOM", "UOM",
uom != null ? uom : null, uom != null ? uom : null,
true), false),
//enabled: false, //enabled: false,
readOnly: true, readOnly: true,
), ),
@ -866,6 +895,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell( child: InkWell(
onTap: model.allMedicationList != null onTap: model.allMedicationList != null
? () { ? () {
@ -901,7 +931,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
? "Box Quantity: " + ? "Box Quantity: " +
model.boxQuintity.toString() model.boxQuintity.toString()
: null, : null,
true), false),
//enabled: false, //enabled: false,
readOnly: true, readOnly: true,
), ),
@ -932,8 +962,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
color: Color(0xff359846),
title: TranslationBase.of(context) title: TranslationBase.of(context)
.addMedication, .addMedication,
fontWeight: FontWeight.w600,
onPressed: () { onPressed: () {
// formKey.currentState.save(); // formKey.currentState.save();
// Navigator.pop(context); // Navigator.pop(context);
@ -1093,11 +1125,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
disabledBorder: OutlineInputBorder( disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
hintText: selectedText != null ? selectedText : hintText, hintText: selectedText != null ? selectedText : hintText,
@ -1105,13 +1137,22 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
? suffixIcon != null ? suffixIcon != null
? suffixIcon ? suffixIcon
: Icon( : Icon(
Icons.arrow_drop_down, Icons.keyboard_arrow_down_sharp,
color: Colors.black, color: Color(0xff2E303A),
) )
: null, : null,
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 14, fontSize: 13,
color: Colors.grey.shade600, 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( NetworkBaseView(
baseViewModel: widget.model, baseViewModel: widget.model,
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.45, height: MediaQuery.of(context).size.height * 0.55,
child: Center( child: Center(
child: Container( child: Container(
margin: EdgeInsets.only(top: 15), margin: EdgeInsets.only(top: 15),
@ -120,61 +120,70 @@ class _EntityListCheckboxSearchWidgetState
historyInfo.procedureName, historyInfo.procedureName,
variant: "bodyText", variant: "bodyText",
bold: true, bold: true,
color: Colors.black), color: Color(0xff575757)),
), ),
), ),
], ],
), ),
children: [ children: [
Container( Container(
child: Row( child: Padding(
children: [ padding: EdgeInsets.symmetric(
AppText(TranslationBase.of(context) horizontal: 12),
.orderType), child: Row(
Radio( children: [
activeColor: Color(0xFFB9382C), AppText(
value: 0, TranslationBase.of(context)
groupValue: selectedType, .orderType),
onChanged: (value) { Radio(
historyInfo.type = activeColor: Color(0xFFB9382C),
setSelectedType(value) value: 0,
.toString(); groupValue: selectedType,
onChanged: (value) {
historyInfo.type =
setSelectedType(value)
.toString();
historyInfo.type = historyInfo.type =
value.toString(); value.toString();
}, },
), ),
Text('routine'), Text('routine'),
Radio( Radio(
activeColor: Color(0xFFB9382C), activeColor: Color(0xFFB9382C),
groupValue: selectedType, groupValue: selectedType,
value: 1, value: 1,
onChanged: (value) { onChanged: (value) {
historyInfo.type = historyInfo.type =
setSelectedType(value) setSelectedType(value)
.toString(); .toString();
historyInfo.type = historyInfo.type =
value.toString(); value.toString();
}, },
), ),
Text(TranslationBase.of(context) Text(TranslationBase.of(context)
.urgent), .urgent),
], ],
),
), ),
), ),
SizedBox( SizedBox(
height: 15.0, height: 15.0,
), ),
TextFields( Padding(
hintText: padding: EdgeInsets.symmetric(
TranslationBase.of(context).remarks, horizontal: 12),
//controller: remarksController, child: TextFields(
onChanged: (value) { hintText: TranslationBase.of(context)
historyInfo.remarks = value; .remarks,
}, //controller: remarksController,
minLines: 3, onChanged: (value) {
maxLines: 5, 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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_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/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:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -18,287 +20,257 @@ class AddRescheduleLeavScreen extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
return BaseView<SickLeaveViewModel>( return BaseView<SickLeaveViewModel>(
onModelReady: (model) => onModelReady: (model) =>
{model.getRescheduleLeave(), model.getCoveringDoctors()}, {model.getRescheduleLeave(), model.getCoveringDoctors()},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).rescheduleLeaves, appBarTitle: TranslationBase.of(context).rescheduleLeaves,
body: model.getReschduleLeave.length > 0 body: SingleChildScrollView(
? SingleChildScrollView( child: Column(children: [
child: Column( Container(
children: [ width: MediaQuery.of(context).size.width,
SizedBox(height: 50), margin: EdgeInsets.all(10),
Container( padding:
margin: EdgeInsets.only(left: 10, right: 10, top: 20, bottom: 20),
EdgeInsets.only(left: 15, right: 15, top: 20), decoration: BoxDecoration(
decoration: BoxDecoration( color: HexColor('#EAEAEA'),
borderRadius: borderRadius: BorderRadius.all(Radius.circular(20))),
BorderRadius.all(Radius.circular(6.0)), child: Column(
border: Border.all( mainAxisAlignment: MainAxisAlignment.center,
width: 1.0, color: HexColor("#CCCCCC"))), children: [
padding: EdgeInsets.all(5), Container(
child: Column( margin: EdgeInsets.all(10),
crossAxisAlignment: CrossAxisAlignment.start, decoration: BoxDecoration(
children: [ color: Colors.grey,
InkWell( borderRadius: BorderRadius.circular(10)),
child: Row( child: IconButton(
children: [ icon: Icon(
Expanded( Icons.add,
flex: 4, size: 35,
child: AppText( color: Colors.white,
TranslationBase.of(context) ),
.requestLeave), onPressed: () {
), openLeave(
IconButton( context,
icon: Icon( false,
Icons.add_circle, );
color: Colors.red, }),
)) ),
], Padding(
) child: AppText(
// AppTextFormField( TranslationBase.of(context).applyForReschedule,
// hintText: fontWeight: FontWeight.bold,
// TranslationBase.of(context).requestLeave, fontFamily: 'Poppins',
// borderColor: Colors.white, fontSize: 18,
// prefix: IconButton( color: HexColor('#7E7E7E')),
// icon: Icon( padding: EdgeInsets.all(10),
// Icons.add_circle, ),
// color: Colors.red, ],
// )), ),
// // textInputType: TextInputType.text, ),
// readOnly: true, Column(
// onTap: () { children: model.getReschduleLeave
// openLeave( .map<Widget>((GetRescheduleLeavesResponse item) {
// context, return RoundedContainer(
// false, child: Column(
// ); children: [
// return false; Container(
// }, decoration: BoxDecoration(
// inputFormatter: ONLY_LETTERS, border: Border(
// ) left: BorderSide(
, color: item.status == 1
onTap: () { ? Colors.green
openLeave( : item.status == 2
context, ? HexColor('#CC9B14')
false, : Colors.red[800],
); width: 5.0,
}, ))),
) padding: EdgeInsets.only(left: 10, right: 10),
], child: Row(
), mainAxisAlignment: MainAxisAlignment.start,
), children: <Widget>[
Column( Expanded(
children: model.getReschduleLeave.map<Widget>( flex: 4,
(GetRescheduleLeavesResponse item) { child: Wrap(
return CardWithBgWidgetNew( children: <Widget>[
widget: Column( Column(
children: [ crossAxisAlignment:
Container( CrossAxisAlignment.start,
padding: children: <Widget>[
EdgeInsets.only(left: 10, right: 10), Row(
child: Row( mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.start, children: [
children: <Widget>[ Container(
Expanded( padding: EdgeInsets.all(3),
flex: 4, margin:
child: Wrap( EdgeInsets.only(top: 10),
children: <Widget>[ child: AppText(
Column( item.status == 1
crossAxisAlignment: ? TranslationBase.of(
CrossAxisAlignment.start, context)
children: <Widget>[ .approved
Container( : item.status == 2
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
? TranslationBase.of( ? TranslationBase.of(
context) context)
.offTime .pending
: TranslationBase.of( : TranslationBase.of(
context) context)
.holiday + .rejected,
' ', fontWeight: FontWeight.bold,
fontWeight: color: item.status == 1
FontWeight.bold, ? Colors.green
)), : item.status == 2
Row( ? HexColor('#CC9B14')
children: [ : Colors.red[800],
Flexible( fontSize: 14,
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,
), ),
], ),
), Padding(
), padding:
(item.status == 2) EdgeInsets.only(top: 10),
? Expanded( child: AppText(
flex: 1, DateUtils
child: IconButton( .convertStringToDateFormat(
icon: Icon( item.dateTimeTo,
Icons.edit_outlined, 'yyyy-MM-dd HH:mm'),
size: 30, fontWeight: FontWeight.bold,
),
// color: Colors.green, //Colors.black,
onPressed: () => {
openLeave(context, true,
extendedData: item)
},
)) ))
: SizedBox(), ]),
], SizedBox(
)), height: 5,
SizedBox( ),
height: 10, Container(
), child: AppText(
Divider( item.requisitionType == 1
height: 1, ? TranslationBase.of(context)
), .offTime
], : TranslationBase.of(context)
)); .holiday +
}).toList(), ' ',
) fontWeight: FontWeight.bold,
], )),
), SizedBox(
) height: 5,
: new Builder(builder: (context) { ),
return Center( Row(children: [
child: SingleChildScrollView( AppText(TranslationBase.of(context)
child: Column( .startDate),
mainAxisAlignment: MainAxisAlignment.center, AppText(
children: [ DateUtils.convertStringToDateFormat(
Container( item.dateTimeFrom,
padding: EdgeInsets.all(40), 'yyyy-MM-dd HH:mm'),
decoration: BoxDecoration( fontWeight: FontWeight.bold,
border: Border.all( )
color: HexColor('#B8382C'), width: 4),
borderRadius: // overflow:
BorderRadius.all(Radius.circular(100))), // TextOverflow.ellipsis,
child: IconButton( ]),
icon: Icon(
Icons.add, // overflow:
size: 35, // TextOverflow.ellipsis,
),
onPressed: () { SizedBox(
openLeave( height: 5,
context, ),
false, Row(
); children: [
}), AppText(TranslationBase.of(context)
), .endDate),
Padding( AppText(
child: AppText( DateUtils
TranslationBase.of(context).noReScheduleLeave, .convertStringToDateFormat(
fontWeight: FontWeight.bold, 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}) { openLeave(BuildContext context, isExtend, {extendedData}) {
showModalBottomSheet( // showModalBottomSheet(
context: context, // context: context,
builder: (context) { // builder: (context) {
return new Container( // return new Container(
child: RescheduleLeaveScreen( // child: RescheduleLeaveScreen(
isExtend, // isExtend,
extendedData, // extendedData,
)); // ));
}); // });
Navigator.push(
context,
FadePage(
page: RescheduleLeaveScreen(
isExtend,
extendedData,
),
),
);
} }
getDoctor(model, doctorId) { getDoctor(model, doctorId) {

@ -114,12 +114,13 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
model2.getCoveringDoctors() model2.getCoveringDoctors()
}, },
builder: (_, model2, w) => GestureDetector( builder: (_, model2, w) => GestureDetector(
onTap: (){ onTap: () {
FocusScope.of(context).requestFocus(new FocusNode()); FocusScope.of(context).requestFocus(new FocusNode());
}, },
child: AppScaffold( child: AppScaffold(
baseViewModel: model2, baseViewModel: model2,
isShowAppBar: false, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).rescheduleLeaves,
body: Center( body: Center(
child: Container( child: Container(
margin: EdgeInsets.only(top: 10), margin: EdgeInsets.only(top: 10),
@ -127,119 +128,127 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
widthFactor: 0.9, widthFactor: 0.9,
child: ListView( child: ListView(
children: [ children: [
Container( // Container(
margin: EdgeInsets.all(8), // margin: EdgeInsets.all(8),
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: // borderRadius: BorderRadius.all(
BorderRadius.all(Radius.circular(6.0)), // Radius.circular(6.0)),
border: Border.all( // border: Border.all(
width: 1.0, // width: 1.0,
color: HexColor("#CCCCCC"))), // color: HexColor("#CCCCCC"))),
width: double.infinity, // width: double.infinity,
child: Padding( // child: Padding(
padding: EdgeInsets.only( // padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, // top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9, // bottom:
right: SizeConfig.widthMultiplier * 3, // SizeConfig.widthMultiplier * 0.9,
left: SizeConfig.widthMultiplier * 3), // right: SizeConfig.widthMultiplier * 3,
child: Column( // left: SizeConfig.widthMultiplier * 3),
crossAxisAlignment: // child: Column(
CrossAxisAlignment.start, // crossAxisAlignment:
children: [ // CrossAxisAlignment.start,
Row( // children: [
mainAxisSize: MainAxisSize.max, // Row(
children: <Widget>[ // mainAxisSize: MainAxisSize.max,
Expanded( // children: <Widget>[
// add Expanded to have your dropdown button fill remaining space // Expanded(
child: DropdownButtonHideUnderline( // // add Expanded to have your dropdown button fill remaining space
child: new IgnorePointer( // child:
ignoring: true, // DropdownButtonHideUnderline(
child: DropdownButton( // child: new IgnorePointer(
focusColor: Colors.grey, // ignoring: true,
isExpanded: true, // child: DropdownButton(
dropdownColor: // focusColor:
Colors.grey, // Colors.grey,
value: getClinicName( // isExpanded: true,
model) ?? // dropdownColor:
"", // Colors.grey,
iconSize: 0, // value: getClinicName(
elevation: 16, // model) ??
selectedItemBuilder: // "",
(BuildContext // iconSize: 0,
context) { // elevation: 16,
return model // selectedItemBuilder:
.getClinicNameList() // (BuildContext
.map((item) { // context) {
return Row( // return model
mainAxisSize: // .getClinicNameList()
MainAxisSize // .map((item) {
.max, // return Row(
children: <Widget>[ // mainAxisSize:
AppText( // MainAxisSize
item, // .max,
fontSize: SizeConfig // children: <
.textMultiplier * // Widget>[
2.1, // AppText(
color: Colors // item,
.grey[500], // fontSize:
), // SizeConfig.textMultiplier *
], // 2.1,
); // color: Colors
}).toList(); // .grey[
}, // 500],
onChanged: (newValue) => // ),
{}, // ],
items: model // );
.getClinicNameList() // }).toList();
.map((item) { // },
return DropdownMenuItem( // onChanged:
value: // (newValue) =>
item.toString(), // {},
child: Text( // items: model
item, // .getClinicNameList()
textAlign: // .map((item) {
TextAlign.end, // return DropdownMenuItem(
), // value: item
); // .toString(),
}).toList(), // child: Text(
))), // item,
), // textAlign:
], // TextAlign
) // .end,
], // ),
), // );
)), // }).toList(),
// ))),
// ),
// ],
// )
// ],
// ),
// )),
Container( // Container(
margin: EdgeInsets.all(8), // margin: EdgeInsets.all(8),
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: // borderRadius:
BorderRadius.all(Radius.circular(6.0)), // BorderRadius.all(Radius.circular(6.0)),
border: Border.all( // border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))), // width: 1.0,
padding: EdgeInsets.all(5), // color: HexColor("#CCCCCC"))),
child: Column( // padding: EdgeInsets.all(5),
crossAxisAlignment: CrossAxisAlignment.start, // child: Column(
children: [ // crossAxisAlignment: CrossAxisAlignment.start,
new IgnorePointer( // children: [
ignoring: true, // new IgnorePointer(
child: AppTextFormField( // ignoring: true,
readOnly: true, // child: AppTextFormField(
hintText: profile != null // readOnly: true,
? profile['DoctorName'] // hintText: profile != null
: "", // ? profile['DoctorName']
borderColor: Colors.white, // : "",
onSaved: (value) {}, // borderColor: Colors.white,
inputFormatter: ONLY_NUMBERS)) // onSaved: (value) {},
], // inputFormatter: ONLY_NUMBERS))
), // ],
), // ),
// ),
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(
BorderRadius.all(Radius.circular(6.0)), Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"))), color: HexColor("#CCCCCC"))),
@ -247,7 +256,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9, bottom:
SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3), left: SizeConfig.widthMultiplier * 3),
child: Column( child: Column(
@ -262,7 +272,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: child:
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
child: DropdownButton( child:
DropdownButton(
// focusColor: Colors.grey, // focusColor: Colors.grey,
isExpanded: true, isExpanded: true,
value: offTime == null value: offTime == null
@ -272,12 +283,14 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
iconSize: 40, iconSize: 40,
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder:
(BuildContext context) { (BuildContext
context) {
return model2.allOffTime return model2.allOffTime
.map((item) { .map((item) {
return Row( return Row(
mainAxisSize: mainAxisSize:
MainAxisSize.max, MainAxisSize
.max,
children: <Widget>[ children: <Widget>[
AppText( AppText(
item[ item[
@ -297,12 +310,22 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
offTime = newValue; offTime = newValue;
}), }),
if (offTime == '1') if (offTime == '1')
{model2.getReasons(18)} {
model2
.getReasons(18)
}
else if (offTime == '2') else if (offTime == '2')
{model2.getReasons(19)} {
else if (offTime == '3' || model2
.getReasons(19)
}
else if (offTime ==
'3' ||
offTime == '5') offTime == '5')
{model2.getReasons(102)} {
model2
.getReasons(102)
}
}, },
items: model2.allOffTime items: model2.allOffTime
.map((item) { .map((item) {
@ -335,20 +358,21 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Radius.circular(6.0)), Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"))), color:
HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
AppTextFormField( AppTextFormField(
hintText: hintText: TranslationBase.of(
TranslationBase.of(context) context)
.fromDate, .fromDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(
icon: Icon( icon: Icon(Icons
Icons.calendar_today)), .calendar_today)),
textInputType: textInputType:
TextInputType.number, TextInputType.number,
controller: _toDateController, controller: _toDateController,
@ -372,11 +396,12 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
BorderRadius.all( BorderRadius.all(
Radius.circular(6.0)), Radius.circular(
6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: color: HexColor(
HexColor("#CCCCCC"))), "#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
@ -387,8 +412,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
TranslationBase.of( TranslationBase.of(
context) context)
.fromTime, .fromTime,
type: type: DateTimePickerType
DateTimePickerType.time, .time,
controller: _controller4, controller: _controller4,
onChanged: (val) => onChanged: (val) =>
fromTime = val, fromTime = val,
@ -411,11 +436,12 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
BorderRadius.all( BorderRadius.all(
Radius.circular(6.0)), Radius.circular(
6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: color: HexColor(
HexColor("#CCCCCC"))), "#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
@ -426,8 +452,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
TranslationBase.of( TranslationBase.of(
context) context)
.toTime, .toTime,
type: type: DateTimePickerType
DateTimePickerType.time, .time,
controller: _controller5, controller: _controller5,
onChanged: (val) => onChanged: (val) =>
toTime = val, toTime = val,
@ -457,23 +483,26 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Radius.circular(6.0)), Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"))), color:
HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
AppTextFormField( AppTextFormField(
hintText: TranslationBase.of( hintText:
context) TranslationBase.of(
.fromDate, context)
.fromDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(
icon: Icon(Icons icon: Icon(Icons
.calendar_today)), .calendar_today)),
textInputType: textInputType:
TextInputType.number, TextInputType.number,
controller: _toDateController, controller:
_toDateController,
onTap: () { onTap: () {
_presentDatePicker( _presentDatePicker(
'fromDate'); 'fromDate');
@ -493,21 +522,22 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Radius.circular(6.0)), Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"))), color:
HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
AppTextFormField( AppTextFormField(
hintText: TranslationBase hintText:
.of(context) TranslationBase
.toDate, .of(context)
.toDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(
icon: Icon( icon: Icon(Icons
Icons .calendar_today)),
.calendar_today)),
textInputType: textInputType:
TextInputType.number, TextInputType.number,
controller: controller:
@ -529,8 +559,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(
BorderRadius.all(Radius.circular(6.0)), Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"))), color: HexColor("#CCCCCC"))),
@ -538,7 +568,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9, bottom:
SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3), left: SizeConfig.widthMultiplier * 3),
child: Column( child: Column(
@ -553,7 +584,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: child:
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
child: DropdownButton( child:
DropdownButton(
focusColor: Colors.grey, focusColor: Colors.grey,
isExpanded: true, isExpanded: true,
value: reason == null value: reason == null
@ -564,12 +596,14 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
iconSize: 40, iconSize: 40,
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder:
(BuildContext context) { (BuildContext
context) {
return model2.allReasons return model2.allReasons
.map((item) { .map((item) {
return Row( return Row(
mainAxisSize: mainAxisSize:
MainAxisSize.max, MainAxisSize
.max,
children: <Widget>[ children: <Widget>[
AppText( AppText(
projectsProvider projectsProvider
@ -603,7 +637,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
projectsProvider projectsProvider
.isArabic .isArabic
? item['nameAr'] ? item['nameAr']
: item['nameEn'], : item[
'nameEn'],
textAlign: textAlign:
TextAlign.end, TextAlign.end,
), ),
@ -621,8 +656,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.all(
BorderRadius.all(Radius.circular(6.0)), Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"))), color: HexColor("#CCCCCC"))),
@ -630,7 +665,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9, top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9, bottom:
SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3), left: SizeConfig.widthMultiplier * 3),
child: Column( child: Column(
@ -649,33 +685,36 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
dropdownSearchDecoration: dropdownSearchDecoration:
InputDecoration( InputDecoration(
contentPadding: contentPadding:
EdgeInsets.all( EdgeInsets
0), .all(0),
border: InputBorder border:
.none), InputBorder
.none),
//maxHeight: 300, //maxHeight: 300,
items: model2 items: model2
.coveringDoctors .coveringDoctors
.map((item) { .map((item) {
return projectsProvider return projectsProvider
.isArabic .isArabic
? item['doctorNameN'] ? item[
: item['doctorName']; 'doctorNameN']
: item[
'doctorName'];
}).toList(), }).toList(),
// label: "Doctor List", // label: "Doctor List",
onChanged: (item) { onChanged: (item) {
model2.coveringDoctors model2.coveringDoctors
.forEach((newVal) => { .forEach(
if (newVal['doctorName'] == (newVal) => {
item || if (newVal['doctorName'] ==
newVal['doctorName'] == item ||
item) newVal['doctorName'] ==
{ item)
doctorID = {
newVal[ doctorID =
'DoctorID'] newVal['DoctorID']
} }
}); });
}, },
selectedItem: selectedItem:
getSelectedDoctor( getSelectedDoctor(
@ -693,8 +732,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
), ),
popupTitle: Container( popupTitle: Container(
height: 50, height: 50,
decoration: BoxDecoration( decoration:
color: Theme.of(context) BoxDecoration(
color: Theme.of(
context)
.primaryColorDark, .primaryColorDark,
borderRadius: borderRadius:
BorderRadius.only( BorderRadius.only(
@ -712,8 +753,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
style: TextStyle( style: TextStyle(
fontSize: 24, fontSize: 24,
fontWeight: fontWeight:
FontWeight.bold, FontWeight
color: Colors.white, .bold,
color:
Colors.white,
), ),
), ),
), ),
@ -723,9 +766,11 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
borderRadius: borderRadius:
BorderRadius.only( BorderRadius.only(
topLeft: topLeft:
Radius.circular(24), Radius.circular(
24),
topRight: topRight:
Radius.circular(24), Radius.circular(
24),
), ),
), ),
), ),
@ -797,6 +842,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
], ],
), ),
)), )),
SizedBox(height: SizeConfig.screenHeight * .3),
Container( Container(
margin: EdgeInsets.all( margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5), SizeConfig.widthMultiplier * 5),
@ -805,8 +851,11 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
title: widget.isUpdate == true title: widget.isUpdate == true
? TranslationBase.of(context).update ? TranslationBase.of(context)
: TranslationBase.of(context).add, .updateReschedule
: TranslationBase.of(context)
.addReschedule,
color: HexColor('#359846'),
onPressed: () { onPressed: () {
if (offTime == '1' || offTime == '2') { if (offTime == '1' || offTime == '2') {
if (widget.isUpdate == true) { if (widget.isUpdate == true) {
@ -837,7 +886,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
), ),
), ),
), ),
))); )));
} }
getProfile() async { 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/models/sickleave/get_all_sickleave_response.dart';
import 'package:doctor_app_flutter/screens/base/base_view.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/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/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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-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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_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/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:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -25,19 +29,94 @@ class AddSickLeavScreen extends StatelessWidget {
onModelReady: (model) => model.getSickLeave(patient.patientMRN), onModelReady: (model) => model.getSickLeave(patient.patientMRN),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false,
appBarTitle: TranslationBase.of(context).sickleave, appBarTitle: TranslationBase.of(context).sickleave,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column(children: [ 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 model.getAllSIckLeave.length > 0
? Column( ? Column(
children: model.getAllSIckLeave children: model.getAllSIckLeave
.map<Widget>((GetAllSickLeaveResponse item) { .map<Widget>((GetAllSickLeaveResponse item) {
return CardWithBgWidgetNew( return RoundedContainer(
widget: Column( child: Column(
children: [ children: [
Container( 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( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -66,42 +145,77 @@ class AddSickLeavScreen extends StatelessWidget {
context) context)
.all, .all,
fontWeight: FontWeight.bold, 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] Row(
: item.status == 2 children: [
? Colors.green AppText(TranslationBase.of(
: Colors.black, context)
.daysSickleave),
AppText(
item.noOfDays.toString(),
fontWeight: FontWeight.bold,
),
],
), ),
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context)
.leaveStartDate + .startDate +
' ', ' ',
fontWeight: FontWeight.bold,
), ),
Flexible( Flexible(
child: Text( child: AppText(
item.startDate, DateUtils
overflow: .convertStringToDateFormat(
TextOverflow.ellipsis, item.startDate,
'dd-MMM-yyyy'),
fontWeight: FontWeight.bold,
)) ))
], ],
), ),
AppText( Row(
item.noOfDays.toString() + mainAxisAlignment:
' ' + MainAxisAlignment
TranslationBase.of(context) .spaceBetween,
.daysSickleave, children: [
fontWeight: FontWeight.bold, AppText(
), item.remarks ?? "",
Row(children: [ ),
AppText( (item.status == 1 ||
item.remarks ?? "", 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( 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(), }).toList(),
) )
: new Builder(builder: (context) { : new Builder(builder: (context) {
return Container( return Column(
height: MediaQuery.of(context).size.height * .7, crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
mainAxisAlignment: MainAxisAlignment.center, Padding(
children: [ padding: EdgeInsets.all(10),
Container( child: Column(
padding: EdgeInsets.all(40), crossAxisAlignment: CrossAxisAlignment.start,
decoration: BoxDecoration( children: [
border: Border.all( AppText(
color: HexColor('#B8382C'), width: 4), TranslationBase.of(context).patient,
borderRadius: fontWeight: FontWeight.bold,
BorderRadius.all(Radius.circular(100))), ),
child: IconButton( AppText(
icon: Icon( TranslationBase.of(context).sickLeave,
Icons.add, fontSize: 24,
size: 35, fontWeight: FontWeight.bold,
), ),
onPressed: () { ],
openSickLeave( )),
context, Container(
false, width: SizeConfig.screenWidth,
); margin: EdgeInsets.only(
}), left: 20, right: 20, top: 20, bottom: 20),
), padding: EdgeInsets.all(20),
Padding( decoration: BoxDecoration(
child: AppText( borderRadius: BorderRadius.circular(10),
TranslationBase.of(context) color: HexColor('#EAEAEA')),
.noSickLeaveApplied, child: Column(
fontWeight: FontWeight.bold, mainAxisAlignment: MainAxisAlignment.start,
), children: [
padding: EdgeInsets.all(10), Container(
), child: Container(
AppText( decoration: BoxDecoration(
TranslationBase.of(context).applyNow, color: Colors.grey,
fontWeight: FontWeight.bold, borderRadius:
color: HexColor('#B8382C'), 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, openSickLeave(BuildContext context, isExtend,
{GetAllSickLeaveResponse extendedData}) { {GetAllSickLeaveResponse extendedData}) {
showModalBottomSheet( // showModalBottomSheet(
context: context, // context: context,
builder: (context) { // builder: (context) {
return new Container( // return new Container(
child: SickLeaveScreen( // child:
appointmentNo: isExtend == true Navigator.push(
? extendedData.appointmentNo context,
: patient.appointmentNo, //extendedData.appointmentNo, FadePage(
patientMRN: isExtend == true page: SickLeaveScreen(
? extendedData.patientMRN appointmentNo: isExtend == true
: patient.patientMRN, ? extendedData.appointmentNo
isExtended: isExtend, : patient.appointmentNo, //extendedData.appointmentNo,
extendedData: extendedData, patientMRN: isExtend == true
patient: patient)); ? 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/models/sickleave/get_all_sickleave_response.dart';
import 'package:doctor_app_flutter/screens/base/base_view.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/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/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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-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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_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/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -23,22 +26,34 @@ class ShowSickLeaveScreen extends StatelessWidget {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
return BaseView<SickLeaveViewModel>( return BaseView<SickLeaveViewModel>(
onModelReady: (model) => model.getSickLeave(patient.patientMRN ?? patient.patientId), onModelReady: (model) =>
model.getSickLeave(patient.patientMRN ?? patient.patientId),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).sickleave, appBarTitle: TranslationBase.of(context).sickleave,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
PatientPageHeaderWidget(patient), PatientProfileHeaderNewDesign(
patient, routeArgs['patientType'], routeArgs['arrivalType']),
Column( Column(
children: model.getAllSIckLeave children: model.getAllSIckLeave
.map<Widget>((GetAllSickLeaveResponse item) { .map<Widget>((GetAllSickLeaveResponse item) {
return CardWithBgWidgetNew( return RoundedContainer(
widget: Column( child: Column(
children: [ children: [
Container( 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( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -66,41 +81,74 @@ class ShowSickLeaveScreen extends StatelessWidget {
context) context)
.all, .all,
fontWeight: FontWeight.bold, 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] Row(
: item.status == 2 children: [
? Colors.green AppText(TranslationBase.of(context)
: Colors.black, .daysSickleave),
AppText(
item.noOfDays.toString(),
fontWeight: FontWeight.bold,
),
],
), ),
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context)
.leaveStartDate + .startDate +
' ', ' ',
fontWeight: FontWeight.bold,
), ),
Flexible( Flexible(
child: Text( child: AppText(
item.startDate, DateUtils
overflow: TextOverflow.ellipsis, .convertStringToDateFormat(
item.startDate,
'dd-MMM-yyyy'),
fontWeight: FontWeight.bold,
)) ))
], ],
), ),
AppText( Row(
item.noOfDays.toString() + mainAxisAlignment:
' ' + MainAxisAlignment.spaceBetween,
TranslationBase.of(context) children: [
.daysSickleave, AppText(
fontWeight: FontWeight.bold, item.remarks ?? "",
), ),
Row(children: [ (item.status == 1 ||
AppText( item.status == 2)
item.remarks ?? "", ? 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( SizedBox(
@ -109,15 +157,8 @@ class ShowSickLeaveScreen extends StatelessWidget {
], ],
), ),
), ),
], ],
)), )),
SizedBox(
height: 20,
),
Divider(
height: 1,
),
], ],
)); ));
}).toList(), }).toList(),
@ -128,6 +169,4 @@ class ShowSickLeaveScreen extends StatelessWidget {
), ),
); );
} }
} }

@ -89,7 +89,10 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
}, },
child: AppScaffold( child: AppScaffold(
baseViewModel: model2, baseViewModel: model2,
isShowAppBar: false, appBarTitle: widget.isExtended == true
? TranslationBase.of(context).extendSickLeave
: TranslationBase.of(context).addSickLeave,
isShowAppBar: true,
body: Center( body: Center(
child: Container( child: Container(
margin: EdgeInsets.only(top: 10), margin: EdgeInsets.only(top: 10),
@ -97,29 +100,40 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
widthFactor: 0.9, widthFactor: 0.9,
child: ListView( child: ListView(
children: [ children: [
Padding( // Padding(
child: AppText( // child: AppText(
widget.isExtended == true // widget.isExtended == true
? TranslationBase.of(context) // ? TranslationBase.of(context)
.extendSickLeave // .extendSickLeave
: TranslationBase.of(context) // : TranslationBase.of(context)
.addSickLeave, // .addSickLeave,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), // ),
padding: EdgeInsets.all(10)), // padding: EdgeInsets.all(10)),
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"))), color: HexColor("#CCCCCC"),
),
color: Colors.white),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Padding(
padding: EdgeInsets.only(
top: 5, left: 10, right: 10),
child: AppText(
TranslationBase.of(context)
.sickLeave +
' ' +
TranslationBase.of(context)
.days)),
AppTextFormField( AppTextFormField(
borderColor: Colors.white, borderColor: Colors.white,
onChanged: (value) { onChanged: (value) {
@ -132,8 +146,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
hintText: widget.extendedData != null hintText: widget.extendedData != null
? widget.extendedData.noOfDays ? widget.extendedData.noOfDays
.toString() .toString()
: TranslationBase.of(context) : '',
.sickLeaveDays,
// validator: (value) { // validator: (value) {
// return TextValidator().validateName(value); // return TextValidator().validateName(value);
// }, // },
@ -146,25 +159,28 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius:
Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0, color: HexColor("#CCCCCC")),
color: HexColor("#CCCCCC"))), color: Colors.white,
),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
// AppText( Padding(
// TranslationBase.of(context).sickLeaveDate, padding: EdgeInsets.only(
// fontSize: 10, top: 5, left: 10, right: 10),
// ), child: AppText(
TranslationBase.of(context)
.sickLeaveDate,
)),
AppTextFormField( AppTextFormField(
hintText: widget.extendedData != null hintText: widget.extendedData != null
? widget.extendedData.startDate ? widget.extendedData.startDate
: TranslationBase.of(context) : '',
.sickLeaveDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(
icon: Icon(Icons.calendar_today)), icon: Icon(Icons.calendar_today)),
@ -188,11 +204,12 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: 10, left: 10, right: 10), top: 10, left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius:
Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0, color: HexColor("#CCCCCC")),
color: HexColor("#CCCCCC"))), color: Colors.white,
),
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
@ -205,10 +222,12 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
// AppText( Padding(
// TranslationBase.of(context).clinicName, padding: EdgeInsets.only(top: 5),
// fontSize: 10, child: AppText(
// ), TranslationBase.of(context)
.clinicName,
)),
Row( Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
@ -291,19 +310,23 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0, color: HexColor("#CCCCCC")),
color: HexColor("#CCCCCC"))), color: Colors.white,
),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// AppText( Padding(
// TranslationBase.of(context).doctorName, padding: EdgeInsets.only(
// fontSize: 10, top: 5, left: 10, right: 10),
// ), child: AppText(
TranslationBase.of(context)
.doctorName,
)),
new IgnorePointer( new IgnorePointer(
ignoring: true, ignoring: true,
child: AppTextFormField( child: AppTextFormField(
@ -324,19 +347,22 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0, color: HexColor("#CCCCCC")),
color: HexColor("#CCCCCC"))), color: Colors.white,
),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// AppText( Padding(
// TranslationBase.of(context).remarks, padding: EdgeInsets.only(
// fontSize: 10, top: 5, left: 10, right: 10),
// ), child: AppText(
TranslationBase.of(context).remarks,
)),
TextField( TextField(
maxLines: 3, maxLines: 3,
decoration: InputDecoration( decoration: InputDecoration(
@ -344,8 +370,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
border: InputBorder.none, border: InputBorder.none,
hintText: widget.extendedData != null hintText: widget.extendedData != null
? widget.extendedData.remarks ? widget.extendedData.remarks
: TranslationBase.of(context) : ''),
.remarks),
onChanged: (value) { onChanged: (value) {
addSickLeave.remarks = value; addSickLeave.remarks = value;
if (widget.extendedData != null) { if (widget.extendedData != null) {
@ -365,7 +390,9 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
AppButton( AppButton(
title: widget.isExtended == true title: widget.isExtended == true
? TranslationBase.of(context).extend ? TranslationBase.of(context).extend
: TranslationBase.of(context).add, : TranslationBase.of(context)
.addSickLeaverequest,
color: Colors.green,
onPressed: () async { onPressed: () async {
if (widget.isExtended) { if (widget.isExtended) {
await model2.extendSickLeave( 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}"; 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]; localizedValues['add-sickleave'][locale.languageCode];
String get add => localizedValues['add'][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 approved => localizedValues['approved'][locale.languageCode];
String get extended => localizedValues['extended'][locale.languageCode]; String get extended => localizedValues['extended'][locale.languageCode];
@ -1145,26 +1148,46 @@ class TranslationBase {
String get billNo => localizedValues['BillNo'][locale.languageCode]; String get billNo => localizedValues['BillNo'][locale.languageCode];
String get labResults => localizedValues['labResults'][locale.languageCode]; String get labResults => localizedValues['labResults'][locale.languageCode];
String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; String get sendSuc => localizedValues['sendSuc'][locale.languageCode];
String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; String get specialResult =>
String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; localizedValues['SpecialResult'][locale.languageCode];
String get showMoreBtn => localizedValues['show-more-btn'][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 fileNumber => localizedValues['fileNumber'][locale.languageCode];
String get reschedule => localizedValues['reschedule'][locale.languageCode]; String get reschedule => localizedValues['reschedule'][locale.languageCode];
String get leaves => localizedValues['leaves'][locale.languageCode]; String get leaves => localizedValues['leaves'][locale.languageCode];
String get openRad => localizedValues['open-rad'][locale.languageCode]; String get openRad => localizedValues['open-rad'][locale.languageCode];
String get totalApproval => localizedValues['totalApproval'][locale.languageCode]; String get totalApproval =>
String get procedureStatus => localizedValues['procedureStatus'][locale.languageCode]; localizedValues['totalApproval'][locale.languageCode];
String get procedureStatus =>
localizedValues['procedureStatus'][locale.languageCode];
String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; String get unusedCount => localizedValues['unusedCount'][locale.languageCode];
String get companyName => localizedValues['companyName'][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 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 notes => localizedValues['notes'][locale.languageCode];
String get dailyDoses => localizedValues['dailyDoses'][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> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,8 +1,9 @@
import 'package:doctor_app_flutter/config/size_config.dart'; 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/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/util/helpers.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_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/card_with_bg_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -16,58 +17,83 @@ class MyScheduleWidget extends StatelessWidget {
List<WorkingHours> workingHours = Helpers.getWorkingHours( List<WorkingHours> workingHours = Helpers.getWorkingHours(
workingHoursTable.workingHours, workingHoursTable.workingHours,
); );
return CardWithBgWidgetNew( return Row(
widget: Container( mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: [
Column( SizedBox(
children: [ height: 10,
Divider( ),
height: 1, AppText(
color: Colors.grey, workingHoursTable.dayName,
thickness: 1.0, fontSize: 2.5 * SizeConfig.textMultiplier,
), fontFamily: 'Poppins',
], // fontSize: 18
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Row( AppText(
children: <Widget>[ ' ${workingHoursTable.date.day} ${(DateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}',
AppText( fontSize: 2.5 * SizeConfig.textMultiplier,
workingHoursTable.dayName, fontWeight: FontWeight.w700,
fontSize: 2.5 * SizeConfig.textMultiplier,
), fontFamily: 'Poppins',
AppText( // fontSize: 18
' ${workingHoursTable.date.day}/${workingHoursTable.date.month}/${workingHoursTable.date.year}',
fontSize: 2.2 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
),
],
), ),
Column( ],
crossAxisAlignment: CrossAxisAlignment.start, ),
children: workingHours.map((work) { Container(
return Container( width: MediaQuery.of(context).size.width * 0.55,
child: Column( child: CardWithBgWidget(
children: <Widget>[ bgColor: DateUtils.isToday(workingHoursTable.date)
SizedBox( ? Colors.green[500]
height: 5, : Colors.transparent,
), // hasBorder: false,
AppText( widget: Container(
work.from + ' - ' + work.to, child: Column(
fontSize: 2.0 * SizeConfig.textMultiplier, crossAxisAlignment: CrossAxisAlignment.start,
fontWeight: FontWeight.w300, 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,
), ),
); Column(
}).toList(), 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', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
) )
: AppText( : patientInfo.arrivedOn != null
DateUtils.convertStringToDateFormat( ? AppText(
patientInfo.arrivedOn, DateUtils.convertStringToDateFormat(
'MM-dd-yyyy HH:mm'), patientInfo.arrivedOn,
fontFamily: 'Poppins', 'MM-dd-yyyy HH:mm'),
fontWeight: FontWeight.w600, fontFamily: 'Poppins',
) fontWeight: FontWeight.w600,
)
: SizedBox()
], ],
)) ))
: SizedBox(), : SizedBox(),
@ -124,7 +126,9 @@ class PatientCard extends StatelessWidget {
AppText( AppText(
patientInfo.nationalityName != null patientInfo.nationalityName != null
? patientInfo.nationalityName ? patientInfo.nationalityName
: patientInfo.nationality, : patientInfo.nationality != null
? patientInfo.nationality
: "",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14,
), ),
@ -286,29 +290,29 @@ class PatientCard extends StatelessWidget {
children: [ children: [
Container( Container(
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: BorderRadius.only( // borderRadius: BorderRadius.only(
bottomRight: Radius.circular(8), // bottomRight: Radius.circular(8),
topLeft: Radius.circular(8), // topLeft: Radius.circular(8),
), // ),
color: patientInfo.appointmentType == // color: patientInfo.appointmentType ==
'Regular' && // 'Regular' &&
patientInfo.visitTypeId == 100 // patientInfo.visitTypeId == 100
? HexColor('#D02127') // ? HexColor('#D02127')
: patientInfo.appointmentType == // : patientInfo.appointmentType ==
'Walkin' // 'Walkin'
? HexColor('#28323A') // ? HexColor('#28323A')
: HexColor('#6C7379'), // : HexColor('#6C7379'),
), // ),
child: Image.asset( child: Image.asset(
patientInfo.appointmentType == patientInfo.appointmentType ==
'Regular' && 'Regular' &&
patientInfo.visitTypeId == 100 patientInfo.visitTypeId == 100
? 'assets/images/type-livecare.png' ? 'assets/images/livecare.png'
: patientInfo.appointmentType == : patientInfo.appointmentType ==
'Walkin' 'Walkin'
? 'assets/images/type-walkin.png' ? 'assets/images/walkin.png'
: 'assets/images/type-booked.png', : 'assets/images/booked.png',
height: 25, height: 25,
width: 35, width: 35,
)), )),

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

@ -31,14 +31,6 @@ class _AppDrawerState extends State<AppDrawer> {
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
ProjectViewModel projectsProvider; ProjectViewModel projectsProvider;
// @override
// void didChangeDependencies() {
// super.didChangeDependencies();
// // if (_isInit) {
// getDocProfile(); // TODO: Refactor this code to prevent errors in the cosole.
// // }
// _isInit = false;
// }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -47,127 +39,112 @@ class _AppDrawerState extends State<AppDrawer> {
return RoundedContainer( return RoundedContainer(
child: Container( child: Container(
color: Colors.white, color: Colors.white,
// margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2),
child: Drawer( child: Drawer(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
flex: 4, flex: 4,
child: ListView(padding: EdgeInsets.zero, children: <Widget>[ child: ListView(padding: EdgeInsets.zero, children: <Widget>[
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 20),
height: SizeConfig.heightMultiplier * 50, height: SizeConfig.heightMultiplier * 50,
child: InkWell( child: Column(
child: DrawerHeader( crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.center, Container(
children: <Widget>[ child: Image.asset(
Container( 'assets/images/dr_app_logo.png',
child: Image.asset( ),
'assets/images/logo.png', margin: EdgeInsets.only(top: 10, bottom: 15),
), ),
margin: EdgeInsets.only(top: 10, bottom: 15), SizedBox(height: 15),
), if (authProvider.doctorProfile != null)
SizedBox( InkWell(
height: 1, onTap: () {
child: Container( Navigator.of(context).pushNamed(PROFILE, arguments: {
color: Colors.black26, 'title': authProvider.doctorProfile.doctorName,
), "doctorProfileall": authProvider.doctorProfile
), });
SizedBox(height: 15), },
InkWell( child: Column(
onTap: () { crossAxisAlignment: CrossAxisAlignment.start,
Navigator.of(context) children: [
.pushNamed(PROFILE, arguments: { Padding(
'title': authProvider.doctorProfile.doctorName, padding: EdgeInsets.only(top: 10),
"doctorProfileall": authProvider.doctorProfile child: AppText(
}); TranslationBase.of(context).dr +
}, authProvider.doctorProfile?.doctorName,
child: Column( fontWeight: FontWeight.bold,
children: [ color: Color(0xFF2E303A),
authProvider.doctorProfile != null fontFamily: 'Poppins',
? CircleAvatar( fontSize: SizeConfig.textMultiplier * 2.5,
radius: ),
SizeConfig.imageSizeMultiplier * 12, ),
// radius: (52) Padding(
child: ClipRRect( padding: EdgeInsets.only(top: 5),
borderRadius: BorderRadius.circular(50), child: AppText(
child: Image.network( authProvider.doctorProfile?.clinicDescription,
authProvider fontWeight: FontWeight.w600,
.doctorProfile.doctorImageURL, color: Color(0xFF2E303A),
fit: BoxFit.fill, fontSize: SizeConfig.textMultiplier * 2,
width: 700, fontFamily: 'Poppins',
), ))
), ],
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;
},
), ),
], ),
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( SizedBox(
child: DrawerItem( height: 40,
TranslationBase.of(context).settings, Icons.settings),
onTap: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(SETTINGS);
},
), ),
InkWell( Container(
child: DrawerItem( margin: EdgeInsets.symmetric(horizontal: 20),
TranslationBase.of(context).reschedule, child: Column(
DoctorApp.leaves, children: [
subTitle: TranslationBase.of(context).leaves, 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( child: Align(
alignment: FractionalOffset.bottomCenter, alignment: FractionalOffset.bottomCenter,
child: Container( child: Container(
child: Column( child: Row(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.center,
Text("Powered by"), children: <Widget>[
Image.asset( Container(
'assets/images/cs_logo_container.png', width: MediaQuery.of(context).size.width *0.3,
width: SizeConfig.imageSizeMultiplier * 30, 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); ProjectViewModel projectProvider = Provider.of(context);
return Container( return Container(
margin: EdgeInsets.symmetric(vertical: 10.0), margin: EdgeInsets.symmetric(vertical: 10.0),
width: double.infinity, // width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all( border: Border.all(
color: hasBorder ? HexColor('#707070') : Colors.transparent, color: hasBorder ? HexColor('#707070') : Colors.transparent,
width: hasBorder ? 2.0 : 0), width: hasBorder ? 0.30 : 0),
), ),
child: Material( child: Material(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),

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

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

Loading…
Cancel
Save