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

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 B

@ -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": "تمديد طلب الإجازة المرضية"
},
}; };

@ -3,7 +3,9 @@ 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/patients/profile/patient_profile_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.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-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.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';
@ -19,6 +21,7 @@ class MedicalFileDetails extends StatefulWidget {
String gender; String gender;
int encounterNumber; int encounterNumber;
int pp; int pp;
PatiantInformtion patient;
MedicalFileDetails( MedicalFileDetails(
{this.age, {this.age,
@ -26,7 +29,8 @@ class MedicalFileDetails extends StatefulWidget {
this.lastName, this.lastName,
this.gender, this.gender,
this.encounterNumber, this.encounterNumber,
this.pp}); this.pp,
this.patient});
@override @override
_MedicalFileDetailsState createState() => _MedicalFileDetailsState( _MedicalFileDetailsState createState() => _MedicalFileDetailsState(
@ -35,7 +39,9 @@ class MedicalFileDetails extends StatefulWidget {
lastName: lastName, lastName: lastName,
gender: gender, gender: gender,
encounterNumber: encounterNumber, encounterNumber: encounterNumber,
pp: pp); pp: pp,
patient: patient,
);
} }
class _MedicalFileDetailsState extends State<MedicalFileDetails> { class _MedicalFileDetailsState extends State<MedicalFileDetails> {
@ -45,6 +51,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
String lastName; String lastName;
String gender; String gender;
int pp; int pp;
PatiantInformtion patient;
_MedicalFileDetailsState( _MedicalFileDetailsState(
{this.age, {this.age,
@ -52,7 +59,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
this.lastName, this.lastName,
this.gender, this.gender,
this.encounterNumber, this.encounterNumber,
this.pp}); this.pp,
this.patient});
bool isPhysicalExam = false; bool isPhysicalExam = false;
bool isProcedureExpand = false; bool isProcedureExpand = false;
bool isHistoryExpand = false; bool isHistoryExpand = false;
@ -72,60 +80,10 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Center( child: Center(
child: Container( child: Container(
color: Colors.white,
child: Column( child: Column(
children: [ children: [
Padding( PatientProfileHeaderNewDesign(patient,
padding: EdgeInsets.all(8.0), patient.patientType.toString(), patient.arrivedOn),
child: Row(
children: <Widget>[
AvatarWidget(
Icon(
gender == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
),
SizedBox(
width: 20,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
firstName + ' ' + lastName,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Row(
children: [
AppText(
TranslationBase.of(context).age2,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 5.0,
),
AppText(
age,
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
),
],
)
],
),
),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey,
),
model.medicalFileList.length != 0 && model.medicalFileList.length != 0 &&
model model
.medicalFileList[0] .medicalFileList[0]
@ -138,87 +96,100 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
? Padding( ? Padding(
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Container( child: Container(
child: Column(
children: [
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(
children: [ children: [
AppText( if (model.medicalFileList.length !=
TranslationBase.of(context).visitDate + 0 &&
": ",
fontWeight: FontWeight.w700,
),
if (model.medicalFileList.length != 0 &&
model model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[encounterNumber] .timelines[
encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations .consulations
.length != .length !=
0) 0)
AppText(model Expanded(
child: AppText(
model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[encounterNumber] .timelines[
encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.appointmentDate .doctorName
.toString()), .toUpperCase(),
SizedBox(width: 35.0), fontWeight: FontWeight.w700,
// AppText( ),
// 'Appt Date : ', ),
// fontWeight: FontWeight.w700,
// ),
// AppText(
// '23/12/2020',
// ),
], ],
), ),
if (model.medicalFileList.length != 0)
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).doctorName + TranslationBase.of(context)
": ".toUpperCase(), .clinic +
fontWeight: FontWeight.w700, ": ",
), ),
if (model.medicalFileList.length != 0 && if (model.medicalFileList
.length !=
0 &&
model model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[encounterNumber] .timelines[
encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations .consulations
.length != .length !=
0) 0)
Expanded( AppText(
child: AppText(
model model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[encounterNumber] .timelines[
encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.doctorName .clinicName,
.toUpperCase(),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
),
], ],
), ),
if (model.medicalFileList.length != 0)
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context)
.clinicName + .episode +
": ", ": ",
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
if (model.medicalFileList.length != 0 && if (model.medicalFileList.length !=
0 &&
model model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[encounterNumber] .timelines[
encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations .consulations
.length != .length !=
@ -230,22 +201,27 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.timelines[encounterNumber] .timelines[encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.clinicName, .episodeID
.toString(),
fontWeight: FontWeight.w700,
), ),
], ],
), ),
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).episode + TranslationBase.of(context)
.visitDate +
": ", ": ",
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
if (model.medicalFileList.length != 0 && if (model.medicalFileList.length !=
0 &&
model model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[encounterNumber] .timelines[
encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations .consulations
.length != .length !=
@ -257,17 +233,24 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.timelines[encounterNumber] .timelines[encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.episodeID .appointmentDate
.toString(), .toString(),
fontWeight: FontWeight.w700,
),
SizedBox(width: 35.0),
// AppText(
// 'Appt Date : ',
// fontWeight: FontWeight.w700,
// ),
// AppText(
// '23/12/2020',
// ),
],
), ),
], ],
), ),
SizedBox(height: 15.0),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey.shade400,
), ),
SizedBox(height: 25.0), SizedBox(height: 25.0),
if (model.medicalFileList.length != 0 && if (model.medicalFileList.length != 0 &&
model model
@ -278,7 +261,23 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations .consulations
.length != .length !=
0) 0)
HeaderBodyExpandableNotifier( 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: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row( headerWidget: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
@ -286,7 +285,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row( Row(
children: [ children: [
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(
context)
.historyOfPresentIllness .historyOfPresentIllness
.toUpperCase(), .toUpperCase(),
variant: isHistoryExpand variant: isHistoryExpand
@ -294,7 +294,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
: '', : '',
bold: isHistoryExpand bold: isHistoryExpand
? true ? true
: false, : true,
color: Colors.black), color: Colors.black),
], ],
), ),
@ -311,7 +311,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
], ],
), ),
bodyWidget: ListView.builder( bodyWidget: ListView.builder(
//physics: , physics:
NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model itemCount: model
@ -322,14 +323,15 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations[0] .consulations[0]
.lstCheifComplaint .lstCheifComplaint
.length, .length,
itemBuilder: itemBuilder: (BuildContext ctxt,
(BuildContext ctxt, int index) { int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Container( child: Container(
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment
.center,
children: [ children: [
Row( Row(
children: [ children: [
@ -338,19 +340,22 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
model model
.medicalFileList[ .medicalFileList[
0] 0]
.entityList[0] .entityList[
0]
.timelines[ .timelines[
encounterNumber] encounterNumber]
.timeLineEvents[ .timeLineEvents[
0] 0]
.consulations[0] .consulations[
0]
.lstCheifComplaint[ .lstCheifComplaint[
index] index]
.hOPI .hOPI
.trim(), .trim(),
), ),
), ),
SizedBox(width: 35.0), SizedBox(
width: 35.0),
], ],
), ),
], ],
@ -360,14 +365,12 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
}), }),
isExpand: isHistoryExpand, isExpand: isHistoryExpand,
), ),
SizedBox(
height: 30,
), ),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
), ),
// SizedBox(
// height: 30,
// ),
SizedBox( SizedBox(
height: 30, height: 30,
), ),
@ -380,7 +383,23 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations .consulations
.length != .length !=
0) 0)
HeaderBodyExpandableNotifier( 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: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row( headerWidget: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
@ -388,15 +407,17 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row( Row(
children: [ children: [
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(
context)
.assessment .assessment
.toUpperCase(), .toUpperCase(),
variant: isAssessmentExpand variant:
isAssessmentExpand
? "bodyText" ? "bodyText"
: '', : '',
bold: isAssessmentExpand bold: isAssessmentExpand
? true ? true
: false, : true,
color: Colors.black), color: Colors.black),
], ],
), ),
@ -413,7 +434,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
], ],
), ),
bodyWidget: ListView.builder( bodyWidget: ListView.builder(
//physics: , physics:
NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model itemCount: model
@ -424,21 +446,23 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations[0] .consulations[0]
.lstAssessments .lstAssessments
.length, .length,
itemBuilder: itemBuilder: (BuildContext ctxt,
(BuildContext ctxt, int index) { int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Container( child: Container(
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment
.center,
children: [ children: [
Row( Row(
children: [ children: [
AppText( AppText(
'ICD', 'ICD',
fontWeight: fontWeight:
FontWeight.w700, FontWeight
.w700,
), ),
AppText( AppText(
model model
@ -447,18 +471,22 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.entityList[0] .entityList[0]
.timelines[ .timelines[
encounterNumber] encounterNumber]
.timeLineEvents[0] .timeLineEvents[
.consulations[0] 0]
.consulations[
0]
.lstAssessments[ .lstAssessments[
index] index]
.iCD10 .iCD10
.trim(), .trim(),
), ),
SizedBox(width: 35.0), SizedBox(
width: 35.0),
AppText( AppText(
'Condition: ', 'Condition: ',
fontWeight: fontWeight:
FontWeight.w700, FontWeight
.w700,
), ),
AppText( AppText(
model model
@ -467,8 +495,10 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.entityList[0] .entityList[0]
.timelines[ .timelines[
encounterNumber] encounterNumber]
.timeLineEvents[0] .timeLineEvents[
.consulations[0] 0]
.consulations[
0]
.lstAssessments[ .lstAssessments[
index] index]
.condition .condition
@ -485,13 +515,16 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.entityList[0] .entityList[0]
.timelines[ .timelines[
encounterNumber] encounterNumber]
.timeLineEvents[0] .timeLineEvents[
.consulations[0] 0]
.consulations[
0]
.lstAssessments[ .lstAssessments[
index] index]
.description, .description,
fontWeight: fontWeight:
FontWeight.w700, FontWeight
.w700,
) )
], ],
), ),
@ -500,14 +533,17 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
AppText( AppText(
'Type: ', 'Type: ',
fontWeight: fontWeight:
FontWeight.w700, FontWeight
.w700,
), ),
AppText(model AppText(model
.medicalFileList[0] .medicalFileList[
0]
.entityList[0] .entityList[0]
.timelines[ .timelines[
encounterNumber] encounterNumber]
.timeLineEvents[0] .timeLineEvents[
0]
.consulations[0] .consulations[0]
.lstAssessments[ .lstAssessments[
index] index]
@ -519,13 +555,15 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
), ),
AppText( AppText(
model model
.medicalFileList[0] .medicalFileList[
0]
.entityList[0] .entityList[0]
.timelines[ .timelines[
encounterNumber] encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.lstAssessments[index] .lstAssessments[
index]
.remarks .remarks
.trim(), .trim(),
), ),
@ -544,14 +582,16 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
}), }),
isExpand: isAssessmentExpand, isExpand: isAssessmentExpand,
), ),
SizedBox(
height: 30,
), ),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
), ),
// SizedBox(
// height: 30,
// ),
// Container(
// width: double.infinity,
// height: 1,
// color: Color(0xffCCCCCC),
// ),
SizedBox( SizedBox(
height: 30, height: 30,
), ),
@ -564,7 +604,23 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations .consulations
.length != .length !=
0) 0)
HeaderBodyExpandableNotifier( 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: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row( headerWidget: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
@ -572,7 +628,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row( Row(
children: [ children: [
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(
context)
.test .test
.toUpperCase(), .toUpperCase(),
variant: isProcedureExpand variant: isProcedureExpand
@ -580,7 +637,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
: '', : '',
bold: isProcedureExpand bold: isProcedureExpand
? true ? true
: false, : true,
color: Colors.black), color: Colors.black),
], ],
), ),
@ -609,61 +666,85 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations[0] .consulations[0]
.lstProcedure .lstProcedure
.length, .length,
itemBuilder: itemBuilder: (BuildContext ctxt,
(BuildContext ctxt, int index) { int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Container( child: Container(
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment
.center,
children: [ children: [
Row( Row(
children: [
Column(
children: [ children: [
AppText( AppText(
'Procedure ID: ', 'Procedure ID: ',
fontWeight: fontWeight:
FontWeight.w700, FontWeight
.w700,
), ),
AppText( AppText(
model model
.medicalFileList[ .medicalFileList[
0] 0]
.entityList[0] .entityList[
0]
.timelines[ .timelines[
encounterNumber] encounterNumber]
.timeLineEvents[0] .timeLineEvents[
.consulations[0] 0]
.consulations[
0]
.lstProcedure[ .lstProcedure[
index] index]
.procedureId .procedureId
.trim(), .trim(),
), ),
SizedBox(width: 35.0), ],
),
SizedBox(
width: 35.0),
Column(
children: [
AppText( AppText(
'Order Date: ', 'Order Date: ',
fontWeight: fontWeight:
FontWeight.w700, FontWeight
.w700,
), ),
Expanded( AppText(
child: AppText( Helpers.getDateFormatted(
DateTime
.parse(
model model
.medicalFileList[ .medicalFileList[
0] 0]
.entityList[0] .entityList[
0]
.timelines[ .timelines[
encounterNumber] encounterNumber]
.timeLineEvents[ .timeLineEvents[
0] 0]
.consulations[0] .consulations[
0]
.lstProcedure[ .lstProcedure[
index] index]
.orderDate .orderDate
.trim(), .trim(),
)),
fontSize:
13.5,
), ),
],
), ),
], ],
), ),
SizedBox(
height: 20.0,
),
Row( Row(
children: [ children: [
Expanded( Expanded(
@ -671,17 +752,20 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
model model
.medicalFileList[ .medicalFileList[
0] 0]
.entityList[0] .entityList[
0]
.timelines[ .timelines[
encounterNumber] encounterNumber]
.timeLineEvents[ .timeLineEvents[
0] 0]
.consulations[0] .consulations[
0]
.lstProcedure[ .lstProcedure[
index] index]
.procName, .procName,
fontWeight: fontWeight:
FontWeight.w700, FontWeight
.w700,
), ),
) )
], ],
@ -691,16 +775,20 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
AppText( AppText(
'CPT Code : ', 'CPT Code : ',
fontWeight: fontWeight:
FontWeight.w700, FontWeight
.w700,
), ),
AppText(model AppText(model
.medicalFileList[0] .medicalFileList[
0]
.entityList[0] .entityList[0]
.timelines[ .timelines[
encounterNumber] encounterNumber]
.timeLineEvents[0] .timeLineEvents[
0]
.consulations[0] .consulations[0]
.lstProcedure[index] .lstProcedure[
index]
.patientID .patientID
.toString()), .toString()),
], ],
@ -723,14 +811,16 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
}), }),
isExpand: isProcedureExpand, isExpand: isProcedureExpand,
), ),
SizedBox(
height: 30,
), ),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
), ),
// SizedBox(
// height: 30,
// ),
// Container(
// width: double.infinity,
// height: 1,
// color: Color(0xffCCCCCC),
// ),
SizedBox( SizedBox(
height: 30, height: 30,
), ),
@ -743,7 +833,23 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations .consulations
.length != .length !=
0) 0)
HeaderBodyExpandableNotifier( 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: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row( headerWidget: Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
@ -751,7 +857,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
Row( Row(
children: [ children: [
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(
context)
.physicalSystemExamination .physicalSystemExamination
.toUpperCase(), .toUpperCase(),
variant: isPhysicalExam variant: isPhysicalExam
@ -759,7 +866,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
: '', : '',
bold: isPhysicalExam bold: isPhysicalExam
? true ? true
: false, : true,
color: Colors.black), color: Colors.black),
], ],
), ),
@ -788,8 +895,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.consulations[0] .consulations[0]
.lstPhysicalExam .lstPhysicalExam
.length, .length,
itemBuilder: itemBuilder: (BuildContext ctxt,
(BuildContext ctxt, int index) { int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Container( child: Container(
@ -800,14 +907,17 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
AppText( AppText(
'Exam Type: ', 'Exam Type: ',
fontWeight: fontWeight:
FontWeight.w700, FontWeight
.w700,
), ),
AppText(model AppText(model
.medicalFileList[0] .medicalFileList[
0]
.entityList[0] .entityList[0]
.timelines[ .timelines[
encounterNumber] encounterNumber]
.timeLineEvents[0] .timeLineEvents[
0]
.consulations[0] .consulations[0]
.lstPhysicalExam[ .lstPhysicalExam[
index] index]
@ -823,13 +933,16 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.entityList[0] .entityList[0]
.timelines[ .timelines[
encounterNumber] encounterNumber]
.timeLineEvents[0] .timeLineEvents[
.consulations[0] 0]
.consulations[
0]
.lstPhysicalExam[ .lstPhysicalExam[
index] index]
.examDesc, .examDesc,
fontWeight: fontWeight:
FontWeight.w700, FontWeight
.w700,
) )
], ],
), ),
@ -838,14 +951,17 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
AppText( AppText(
'Abnormal: ', 'Abnormal: ',
fontWeight: fontWeight:
FontWeight.w700, FontWeight
.w700,
), ),
AppText(model AppText(model
.medicalFileList[0] .medicalFileList[
0]
.entityList[0] .entityList[0]
.timelines[ .timelines[
encounterNumber] encounterNumber]
.timeLineEvents[0] .timeLineEvents[
0]
.consulations[0] .consulations[0]
.lstPhysicalExam[ .lstPhysicalExam[
index] index]
@ -857,7 +973,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
), ),
AppText( AppText(
model model
.medicalFileList[0] .medicalFileList[
0]
.entityList[0] .entityList[0]
.timelines[ .timelines[
encounterNumber] encounterNumber]
@ -882,14 +999,16 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
}), }),
isExpand: isPhysicalExam, isExpand: isPhysicalExam,
), ),
),
),
SizedBox( SizedBox(
height: 30, height: 30,
), ),
Container( // Container(
width: double.infinity, // width: double.infinity,
height: 1, // height: 1,
color: Color(0xffCCCCCC), // color: Color(0xffCCCCCC),
), // ),
], ],
), ),
), ),

@ -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,67 +97,156 @@ 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: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).branch + model
": ", .medicalFileList[0]
.entityList[0]
.timelines[index]
.doctorName,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 17.0,
fontFamily: 'Poppins',
)
],
),
Row(
children: [
AppText(
Helpers.convertStringToDate(model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.date)
.day
.toString() +
"/",
),
AppText(
Helpers.convertStringToDate(model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.date)
.month
.toString() +
"/",
), ),
AppText(model AppText(
Helpers.convertStringToDate(
model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[index] .timelines[index]
.projectName), .date)
.year
.toString(),
),
],
)
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
ClipRRect(
borderRadius:
BorderRadius.all(
Radius.circular(30)),
child: Image.network(
'https://previews.123rf.com/images/yupiramos/yupiramos1705/yupiramos170524444/78443570-a-female-doctor-avatar-character-vector-illustration-design.jpg',
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
], ],
), ),
),
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context)
.doctorName .clinic +
.toUpperCase() +
": ", ": ",
fontWeight: FontWeight.w700,
), ),
Expanded( AppText(
child: AppText(
model model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[index] .timelines[index]
.doctorName, .clinicName,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w600,
),
), ),
], ],
), ),
Row( Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context)
.clinicName + .branch +
": ", ": ",
fontWeight: FontWeight.w700,
), ),
AppText( AppText(
model model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[index] .timelines[index]
.clinicName, .projectName,
fontWeight: FontWeight.w600,
), ),
], ],
), ),
SizedBox(height: 10.0), ],
Divider( ),
height: 1.0, ],
thickness: 1.0, ),
color: Colors.grey.shade400, Row(
mainAxisAlignment:
MainAxisAlignment.end,
children: [
Column(
children: [
Icon(
Icons.remove_red_eye,
size: 30.0,
) )
], ],
)
],
),
],
), ),
), ),
onTap: () { onTap: () {
@ -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(
children: [
Container(
child: AppText( child: AppText(
'THERES NO MEDICAL FILE FOR THIS Patient', '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,16 +225,34 @@ 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),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.spaceEvenly, //mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).medicines.toUpperCase(), 'New Prescription Order',
fontWeight: FontWeight.w900, 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,8 +359,7 @@ 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
@ -349,8 +367,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.description + .description +
('${_selectedMedication.genericName}') ('${_selectedMedication.genericName}')
: null, : null,
true, false,
), 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,14 +762,13 @@ 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)
.date,
selectedDate != null selectedDate != null
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null, : null,
@ -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,16 +120,20 @@ 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: Padding(
padding: EdgeInsets.symmetric(
horizontal: 12),
child: Row( child: Row(
children: [ children: [
AppText(TranslationBase.of(context) AppText(
TranslationBase.of(context)
.orderType), .orderType),
Radio( Radio(
activeColor: Color(0xFFB9382C), activeColor: Color(0xFFB9382C),
@ -163,12 +167,16 @@ class _EntityListCheckboxSearchWidgetState
], ],
), ),
), ),
),
SizedBox( SizedBox(
height: 15.0, height: 15.0,
), ),
TextFields( Padding(
hintText: padding: EdgeInsets.symmetric(
TranslationBase.of(context).remarks, horizontal: 12),
child: TextFields(
hintText: TranslationBase.of(context)
.remarks,
//controller: remarksController, //controller: remarksController,
onChanged: (value) { onChanged: (value) {
historyInfo.remarks = value; historyInfo.remarks = value;
@ -176,6 +184,7 @@ class _EntityListCheckboxSearchWidgetState
minLines: 3, minLines: 3,
maxLines: 5, maxLines: 5,
), ),
),
], ],
), ),
DividerWithSpacesAround(), DividerWithSpacesAround(),

@ -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';
@ -24,82 +26,69 @@ class AddRescheduleLeavScreen extends StatelessWidget {
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(
children: [
SizedBox(height: 50),
Container( Container(
margin: width: MediaQuery.of(context).size.width,
EdgeInsets.only(left: 15, right: 15, top: 20), margin: EdgeInsets.all(10),
padding:
EdgeInsets.only(left: 10, right: 10, top: 20, bottom: 20),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: color: HexColor('#EAEAEA'),
BorderRadius.all(Radius.circular(6.0)), borderRadius: BorderRadius.all(Radius.circular(20))),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center,
children: [
InkWell(
child: Row(
children: [ children: [
Expanded( Container(
flex: 4, margin: EdgeInsets.all(10),
child: AppText( decoration: BoxDecoration(
TranslationBase.of(context) color: Colors.grey,
.requestLeave), borderRadius: BorderRadius.circular(10)),
), child: IconButton(
IconButton(
icon: Icon( icon: Icon(
Icons.add_circle, Icons.add,
color: Colors.red, size: 35,
)) color: Colors.white,
], ),
) onPressed: () {
// AppTextFormField(
// hintText:
// TranslationBase.of(context).requestLeave,
// borderColor: Colors.white,
// prefix: IconButton(
// icon: Icon(
// Icons.add_circle,
// color: Colors.red,
// )),
// // textInputType: TextInputType.text,
// readOnly: true,
// onTap: () {
// openLeave(
// context,
// false,
// );
// return false;
// },
// inputFormatter: ONLY_LETTERS,
// )
,
onTap: () {
openLeave( openLeave(
context, context,
false, false,
); );
}, }),
) ),
Padding(
child: AppText(
TranslationBase.of(context).applyForReschedule,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 18,
color: HexColor('#7E7E7E')),
padding: EdgeInsets.all(10),
),
], ],
), ),
), ),
Column( Column(
children: model.getReschduleLeave.map<Widget>( children: model.getReschduleLeave
(GetRescheduleLeavesResponse item) { .map<Widget>((GetRescheduleLeavesResponse item) {
return CardWithBgWidgetNew( return RoundedContainer(
widget: Column( child: Column(
children: [ children: [
Container( Container(
padding: decoration: BoxDecoration(
EdgeInsets.only(left: 10, right: 10), border: Border(
left: BorderSide(
color: item.status == 1
? Colors.green
: item.status == 2
? HexColor('#CC9B14')
: Colors.red[800],
width: 5.0,
))),
padding: EdgeInsets.only(left: 10, right: 10),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 4, flex: 4,
@ -109,13 +98,18 @@ class AddRescheduleLeavScreen extends StatelessWidget {
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Container( Container(
padding: padding: EdgeInsets.all(3),
EdgeInsets.all(3), margin:
EdgeInsets.only(top: 10),
child: AppText( child: AppText(
item.status == 1 item.status == 1
? TranslationBase ? TranslationBase.of(
.of(context) context)
.approved .approved
: item.status == 2 : item.status == 2
? TranslationBase.of( ? TranslationBase.of(
@ -124,181 +118,159 @@ class AddRescheduleLeavScreen extends StatelessWidget {
: TranslationBase.of( : TranslationBase.of(
context) context)
.rejected, .rejected,
fontWeight: fontWeight: FontWeight.bold,
FontWeight.bold,
color: Colors.white,
),
color: item.status == 1 color: item.status == 1
? Colors.green ? Colors.green
: item.status == 2 : item.status == 2
? Colors ? HexColor('#CC9B14')
.yellow[800]
: Colors.red[800], : Colors.red[800],
fontSize: 14,
), ),
),
Padding(
padding:
EdgeInsets.only(top: 10),
child: AppText(
DateUtils
.convertStringToDateFormat(
item.dateTimeTo,
'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold,
))
]),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Container( Container(
child: AppText( child: AppText(
item.requisitionType == 1 item.requisitionType == 1
? TranslationBase.of( ? TranslationBase.of(context)
context)
.offTime .offTime
: TranslationBase.of( : TranslationBase.of(context)
context)
.holiday + .holiday +
' ', ' ',
fontWeight: fontWeight: FontWeight.bold,
FontWeight.bold,
)), )),
Row( SizedBox(
children: [ height: 5,
Flexible( ),
child: Text( Row(children: [
DateUtils.convertStringToDateFormat( AppText(TranslationBase.of(context)
item .startDate),
.dateTimeFrom, AppText(
'yyyy-MM-dd HH:mm') +
' ' +
TranslationBase.of(
context)
.to +
' ' +
DateUtils.convertStringToDateFormat( DateUtils.convertStringToDateFormat(
item.dateTimeTo, item.dateTimeFrom,
'yyyy-MM-dd HH:mm') 'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold,
)
// overflow: // overflow:
// TextOverflow.ellipsis, // TextOverflow.ellipsis,
)) ]),
// overflow:
// TextOverflow.ellipsis,
SizedBox(
height: 5,
),
Row(
children: [
AppText(TranslationBase.of(context)
.endDate),
AppText(
DateUtils
.convertStringToDateFormat(
item.dateTimeTo,
'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold,
)
], ],
), ),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
model.coveringDoctors.length > 0
? Row(children: [
AppText( AppText(
TranslationBase.of( TranslationBase.of(context)
context)
.coveringDoctor, .coveringDoctor,
fontWeight:
FontWeight.bold,
), ),
model.coveringDoctors
.length >
0
? Row(children: [
AppText(getDoctor(
model
.coveringDoctors,
item.coveringDoctorId))
])
: SizedBox(),
AppText( AppText(
TranslationBase.of( getDoctor(
context) model.coveringDoctors,
.reasons, item.coveringDoctorId),
fontWeight: fontWeight: FontWeight.bold,
FontWeight.bold, )
),
model.allReasons.length > 0
? Row(children: [
AppText(getReasons(
model
.allReasons,
item.reasonId))
]) ])
: SizedBox(), : SizedBox(),
], // AppText(
), // TranslationBase.of(context)
SizedBox( // .reasons,
width: 10, // fontWeight: FontWeight.bold,
), // ),
], Row(
), mainAxisAlignment:
), MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: EdgeInsets.only(
bottom: 5),
child: AppText(getReasons(
model.allReasons,
item.reasonId))),
(item.status == 2) (item.status == 2)
? Expanded( ? IconButton(
flex: 1, icon: Image.asset(
child: IconButton( 'assets/images/edit.png'),
icon: Icon(
Icons.edit_outlined,
size: 30,
),
// color: Colors.green, //Colors.black, // color: Colors.green, //Colors.black,
onPressed: () => { onPressed: () => {
openLeave(context, true, openLeave(context, true,
extendedData: item) extendedData: item)
}, },
)) )
: SizedBox(), : SizedBox(),
]),
], ],
)), ),
SizedBox( SizedBox(
height: 10, width: 10,
),
],
), ),
Divider(
height: 1,
), ),
], ],
)); )),
}).toList(),
)
], ],
), ),
)
: new Builder(builder: (context) {
return Center(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.all(40),
decoration: BoxDecoration(
border: Border.all(
color: HexColor('#B8382C'), width: 4),
borderRadius:
BorderRadius.all(Radius.circular(100))),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
),
onPressed: () {
openLeave(
context,
false,
); );
}), }).toList(),
),
Padding(
child: AppText(
TranslationBase.of(context).noReScheduleLeave,
fontWeight: FontWeight.bold,
),
padding: EdgeInsets.all(10),
),
AppText(
TranslationBase.of(context).applyNow,
fontWeight: FontWeight.bold,
color: HexColor('#B8382C'),
) )
], ]))),
), );
));
}),
));
} }
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,
// extendedData,
// ));
// });
Navigator.push(
context,
FadePage(
page: RescheduleLeaveScreen(
isExtend, isExtend,
extendedData, extendedData,
)); ),
}); ),
);
} }
getDoctor(model, doctorId) { getDoctor(model, doctorId) {

@ -119,7 +119,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
}, },
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,14 +483,16 @@ 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:
TranslationBase.of(
context) context)
.fromDate, .fromDate,
borderColor: Colors.white, borderColor: Colors.white,
@ -473,7 +501,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
.calendar_today)), .calendar_today)),
textInputType: textInputType:
TextInputType.number, TextInputType.number,
controller: _toDateController, controller:
_toDateController,
onTap: () { onTap: () {
_presentDatePicker( _presentDatePicker(
'fromDate'); 'fromDate');
@ -493,20 +522,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: TranslationBase hintText:
TranslationBase
.of(context) .of(context)
.toDate, .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,
@ -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,9 +685,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
dropdownSearchDecoration: dropdownSearchDecoration:
InputDecoration( InputDecoration(
contentPadding: contentPadding:
EdgeInsets.all( EdgeInsets
0), .all(0),
border: InputBorder border:
InputBorder
.none), .none),
//maxHeight: 300, //maxHeight: 300,
items: model2 items: model2
@ -659,21 +696,23 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
.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(
(newVal) => {
if (newVal['doctorName'] == if (newVal['doctorName'] ==
item || item ||
newVal['doctorName'] == newVal['doctorName'] ==
item) item)
{ {
doctorID = doctorID =
newVal[ newVal['DoctorID']
'DoctorID']
} }
}); });
}, },
@ -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) {

@ -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,64 +145,59 @@ class AddSickLeavScreen extends StatelessWidget {
context) context)
.all, .all,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white,
),
color: item.status == 1 color: item.status == 1
? Colors.yellow[800] ? Colors.yellow[800]
: item.status == 2 : item.status == 2
? Colors.green ? Colors.green
: Colors.black, : Colors.black,
), ),
),
Row( Row(
children: [ children: [
AppText(TranslationBase.of(
context)
.daysSickleave),
AppText( AppText(
TranslationBase.of(context) item.noOfDays.toString(),
.leaveStartDate +
' ',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
Flexible(
child: Text(
item.startDate,
overflow:
TextOverflow.ellipsis,
))
], ],
), ),
Row(
children: [
AppText( AppText(
item.noOfDays.toString() +
' ' +
TranslationBase.of(context) TranslationBase.of(context)
.daysSickleave, .startDate +
' ',
),
Flexible(
child: AppText(
DateUtils
.convertStringToDateFormat(
item.startDate,
'dd-MMM-yyyy'),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
))
],
), ),
Row(children: [ Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
AppText( AppText(
item.remarks ?? "", item.remarks ?? "",
)
]),
],
),
SizedBox(
width: 20,
),
],
),
),
(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,
), ),
(item.status == 1 ||
item.status == 2)
? IconButton(
icon: Image.asset(
'assets/images/edit.png'),
// color: Colors.green, //Colors.black, // color: Colors.green, //Colors.black,
onPressed: () => { onPressed: () => {
if (item.status == 1) if (item.status ==
1)
{ {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of( TranslationBase.of(
@ -132,41 +206,73 @@ class AddSickLeavScreen extends StatelessWidget {
} }
else else
{ {
openSickLeave(context, true, openSickLeave(
extendedData: item) context,
true,
extendedData:
item)
} }
}, },
)) )
: SizedBox(), : SizedBox()
]),
], ],
)), ),
SizedBox( SizedBox(
height: 20, width: 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,
children: [
Padding(
padding: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).patient,
fontWeight: FontWeight.bold,
),
AppText(
TranslationBase.of(context).sickLeave,
fontSize: 24,
fontWeight: FontWeight.bold,
),
],
)),
Container(
width: SizeConfig.screenWidth,
margin: EdgeInsets.only(
left: 20, right: 20, top: 20, bottom: 20),
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: HexColor('#EAEAEA')),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Container( Container(
padding: EdgeInsets.all(40), child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( color: Colors.grey,
color: HexColor('#B8382C'), width: 4),
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(100))), BorderRadius.circular(10)),
padding: EdgeInsets.all(3),
child: IconButton( child: IconButton(
icon: Icon( icon: Icon(
Icons.add, Icons.add,
size: 35, size: 35,
color: Colors.white,
), ),
onPressed: () { onPressed: () {
openSickLeave( openSickLeave(
@ -174,33 +280,40 @@ class AddSickLeavScreen extends StatelessWidget {
false, false,
); );
}), }),
), )),
Padding( Padding(
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context)
.noSickLeaveApplied, .noSickLeaveApplied,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), fontFamily: 'Poppins',
fontSize: 16,
textAlign: TextAlign.center,
color: HexColor('#7E7E7E')),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
), ),
AppText( ],
TranslationBase.of(context).applyNow, )),
fontWeight: FontWeight.bold, SizedBox(
color: HexColor('#B8382C'), 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:
Navigator.push(
context,
FadePage(
page: SickLeaveScreen(
appointmentNo: isExtend == true appointmentNo: isExtend == true
? extendedData.appointmentNo ? extendedData.appointmentNo
: patient.appointmentNo, //extendedData.appointmentNo, : patient.appointmentNo, //extendedData.appointmentNo,
@ -209,7 +322,6 @@ class AddSickLeavScreen extends StatelessWidget {
: patient.patientMRN, : patient.patientMRN,
isExtended: isExtend, isExtended: isExtend,
extendedData: extendedData, extendedData: extendedData,
patient: patient)); 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,40 +81,73 @@ class ShowSickLeaveScreen extends StatelessWidget {
context) context)
.all, .all,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white,
),
color: item.status == 1 color: item.status == 1
? Colors.yellow[800] ? Colors.yellow[800]
: item.status == 2 : item.status == 2
? Colors.green ? Colors.green
: Colors.black, : Colors.black,
), ),
),
Row( Row(
children: [ children: [
AppText(TranslationBase.of(context)
.daysSickleave),
AppText( AppText(
TranslationBase.of(context) item.noOfDays.toString(),
.leaveStartDate +
' ',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
Flexible(
child: Text(
item.startDate,
overflow: TextOverflow.ellipsis,
))
], ],
), ),
Row(
children: [
AppText( AppText(
item.noOfDays.toString() +
' ' +
TranslationBase.of(context) TranslationBase.of(context)
.daysSickleave, .startDate +
' ',
),
Flexible(
child: AppText(
DateUtils
.convertStringToDateFormat(
item.startDate,
'dd-MMM-yyyy'),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
))
],
), ),
Row(children: [ Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
AppText( AppText(
item.remarks ?? "", item.remarks ?? "",
),
(item.status == 1 ||
item.status == 2)
? IconButton(
icon: Image.asset(
'assets/images/edit.png'),
// color: Colors.green, //Colors.black,
onPressed: () => {
if (item.status == 1)
{
DrAppToastMsg.showErrorToast(
TranslationBase.of(
context)
.sickleaveonhold)
}
// else
// {
// openSickLeave(
// context,
// true,
// extendedData:
// item)
// }
},
) )
: SizedBox()
]), ]),
], ],
), ),
@ -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,16 +100,16 @@ 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(
@ -114,12 +117,23 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
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>[
@ -294,16 +313,20 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
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(
@ -327,16 +350,19 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
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,36 +17,58 @@ 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, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: [
Column( Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Divider(
height: 1,
color: Colors.grey,
thickness: 1.0,
),
],
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Row(
children: <Widget>[
AppText( AppText(
workingHoursTable.dayName, workingHoursTable.dayName,
fontSize: 2.5 * SizeConfig.textMultiplier, fontSize: 2.5 * SizeConfig.textMultiplier,
fontFamily: 'Poppins',
// fontSize: 18
),
SizedBox(
height: 10,
), ),
AppText( AppText(
' ${workingHoursTable.date.day}/${workingHoursTable.date.month}/${workingHoursTable.date.year}', ' ${workingHoursTable.date.day} ${(DateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}',
fontSize: 2.2 * SizeConfig.textMultiplier, fontSize: 2.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300, fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
// fontSize: 18
), ),
], ],
), ),
Container(
width: MediaQuery.of(context).size.width * 0.55,
child: CardWithBgWidget(
bgColor: DateUtils.isToday(workingHoursTable.date)
? Colors.green[500]
: Colors.transparent,
// hasBorder: false,
widget: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if (DateUtils.isToday(workingHoursTable.date))
AppText(
"Today",
fontSize: 2.5 * SizeConfig.textMultiplier,
fontFamily: 'Poppins',
color: Colors.green[500],
// fontSize: 18
),
SizedBox(
height: 10,
),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: workingHours.map((work) { children: workingHours.map((work) {
@ -68,6 +91,9 @@ class MyScheduleWidget extends StatelessWidget {
], ],
), ),
), ),
),
),
],
); );
} }
} }

@ -84,13 +84,15 @@ class PatientCard extends StatelessWidget {
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
) )
: AppText( : patientInfo.arrivedOn != null
? AppText(
DateUtils.convertStringToDateFormat( DateUtils.convertStringToDateFormat(
patientInfo.arrivedOn, patientInfo.arrivedOn,
'MM-dd-yyyy HH:mm'), 'MM-dd-yyyy HH:mm'),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, 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,110 +39,70 @@ 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: DrawerHeader(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: [
Container( Container(
child: Image.asset( child: Image.asset(
'assets/images/logo.png', 'assets/images/dr_app_logo.png',
), ),
margin: EdgeInsets.only(top: 10, bottom: 15), margin: EdgeInsets.only(top: 10, bottom: 15),
), ),
SizedBox(
height: 1,
child: Container(
color: Colors.black26,
),
),
SizedBox(height: 15), SizedBox(height: 15),
if (authProvider.doctorProfile != null)
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.of(context) Navigator.of(context).pushNamed(PROFILE, arguments: {
.pushNamed(PROFILE, arguments: {
'title': authProvider.doctorProfile.doctorName, 'title': authProvider.doctorProfile.doctorName,
"doctorProfileall": authProvider.doctorProfile "doctorProfileall": authProvider.doctorProfile
}); });
}, },
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
authProvider.doctorProfile != null Padding(
? CircleAvatar(
radius:
SizeConfig.imageSizeMultiplier * 12,
// radius: (52)
child: ClipRRect(
borderRadius: BorderRadius.circular(50),
child: Image.network(
authProvider
.doctorProfile.doctorImageURL,
fit: BoxFit.fill,
width: 700,
),
),
backgroundColor: Colors.transparent,
)
: SizedBox(),
authProvider.doctorProfile != null
? Padding(
padding: EdgeInsets.only(top: 10), padding: EdgeInsets.only(top: 10),
child: AppText( child: AppText(
TranslationBase.of(context).dr + TranslationBase.of(context).dr +
authProvider authProvider.doctorProfile?.doctorName,
.doctorProfile?.doctorName,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 2, fontFamily: 'Poppins',
)) fontSize: SizeConfig.textMultiplier * 2.5,
: SizedBox(),
],
), ),
), ),
RaisedButton( Padding(
shape: RoundedRectangleBorder( padding: EdgeInsets.only(top: 5),
borderRadius: BorderRadius.circular(18.0),
side: BorderSide(color: Colors.red)),
child: AppText( child: AppText(
TranslationBase.of(context).logout, authProvider.doctorProfile?.clinicDescription,
color: Colors.white, fontWeight: FontWeight.w600,
), color: Color(0xFF2E303A),
onPressed: () async { fontSize: SizeConfig.textMultiplier * 2,
Navigator.pop(context); fontFamily: 'Poppins',
await helpers.logout(); ))
projectsProvider.isLogin = false;
},
),
], ],
), ),
), ),
), SizedBox(height: 15),
),
InkWell(
child: DrawerItem(
TranslationBase.of(context).settings, Icons.settings),
onTap: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(SETTINGS);
},
),
InkWell( InkWell(
child: DrawerItem( child: DrawerItem(
TranslationBase.of(context).reschedule, TranslationBase.of(context).rescheduleLeaves,
// " or " +
// TranslationBase.of(context).leaves,
DoctorApp.leaves, DoctorApp.leaves,
subTitle: TranslationBase.of(context).leaves, // subTitle: ,
), ),
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -159,16 +111,41 @@ class _AppDrawerState extends State<AppDrawer> {
)); ));
}, },
), ),
],
),
),
SizedBox(
height: 40,
),
Container(
margin: EdgeInsets.symmetric(horizontal: 20),
child: Column(
children: [
InkWell(
child: DrawerItem(
TranslationBase.of(context).logout, Icons.settings),
onTap: () async {
Navigator.pop(context);
await helpers.logout();
projectsProvider.isLogin = false;
},
),
InkWell( InkWell(
child: DrawerItem( child: DrawerItem(
TranslationBase.of(context).qr + projectsProvider.isArabic
TranslationBase.of(context).reader, ? TranslationBase.of(context).lanEnglish
: TranslationBase.of(context).lanArabic,
DoctorApp.qr_code), DoctorApp.qr_code),
onTap: () { onTap: () {
Navigator.pop(context); if (projectsProvider.isArabic)
Navigator.of(context).pushNamed(QR_READER); projectsProvider.changeLanguage('en');
else
projectsProvider.changeLanguage('ar');
}, },
), ),
],
),
),
]), ]),
), ),
Expanded( Expanded(
@ -179,12 +156,33 @@ class _AppDrawerState extends State<AppDrawer> {
child: Align( child: Align(
alignment: FractionalOffset.bottomCenter, alignment: FractionalOffset.bottomCenter,
child: Container( child: Container(
child: Column( child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Text("Powered by"), Container(
width: MediaQuery.of(context).size.width *0.3,
child: RichText(
text: TextSpan(
text: 'Powered by',
style: TextStyle(
color: Color(0xFF989898),
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2,
fontFamily: 'Poppins',),
children: <TextSpan>[
TextSpan(text: ' Cloud Solutions',
style: TextStyle(
color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 2,
fontFamily: 'Poppins',),
)
]
),),
),
// Text("Powered by"),
Image.asset( Image.asset(
'assets/images/cs_logo_container.png', 'assets/images/cs_logo_container.png',
width: SizeConfig.imageSizeMultiplier * 30, 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(
width: MediaQuery.of(context).size.width *0.45,
child: Expanded(
child: AppText(
widget.title, widget.title,
color: widget.color ?? Colors.black,
textOverflow: TextOverflow.ellipsis,
// fontWeight: FontWeight.bold,
// margin: 5,
marginLeft: 5, marginLeft: 5,
marginRight: 5, marginRight: 5,
fontSize: SizeConfig.textMultiplier * 2.3, color:widget.color ??Color(0xFF2E303A),
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