Merge branch 'sultan' into 'development'

Sultan

See merge request Cloud_Solution/doctor_app_flutter!385
merge-requests/386/merge
Mohammad Aljammal 5 years ago
commit 64f23187b6

@ -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': 'أضف إجازة مرضية'},
@ -802,4 +802,13 @@ const Map<String, Map<String, String>> localizedValues = {
"add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"}, "add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"},
"update-reschedule": {"en": "Update 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": "تمديد طلب الإجازة المرضية"
},
}; };

@ -26,7 +26,8 @@ class AddRescheduleLeavScreen extends StatelessWidget {
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).rescheduleLeaves, appBarTitle: TranslationBase.of(context).rescheduleLeaves,
body: Column(children: [ body: SingleChildScrollView(
child: Column(children: [
Container( Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
@ -68,180 +69,185 @@ class AddRescheduleLeavScreen extends StatelessWidget {
], ],
), ),
), ),
Container( Column(
height: MediaQuery.of(context).size.height * .65, children: model.getReschduleLeave
child: SingleChildScrollView( .map<Widget>((GetRescheduleLeavesResponse item) {
child: Column( return RoundedContainer(
children: model.getReschduleLeave child: Column(
.map<Widget>((GetRescheduleLeavesResponse item) { children: [
return RoundedContainer( Container(
child: Column( decoration: BoxDecoration(
children: [ border: Border(
Container( left: BorderSide(
decoration: BoxDecoration( color: item.status == 1
border: Border( ? Colors.green
left: BorderSide( : item.status == 2
color: item.status == 1 ? HexColor('#CC9B14')
? Colors.green : Colors.red[800],
: item.status == 2 width: 5.0,
? HexColor('#CC9B14') ))),
: Colors.red[800], padding: EdgeInsets.only(left: 10, right: 10),
width: 5.0, child: Row(
))), mainAxisAlignment: MainAxisAlignment.start,
padding: EdgeInsets.only(left: 10, right: 10), children: <Widget>[
child: Row( Expanded(
mainAxisAlignment: MainAxisAlignment.start, flex: 4,
children: <Widget>[ child: Wrap(
Expanded( children: <Widget>[
flex: 4, Column(
child: Wrap( crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Column( Row(
crossAxisAlignment: mainAxisAlignment:
CrossAxisAlignment.start, MainAxisAlignment.spaceBetween,
children: <Widget>[ children: [
Container( Container(
padding: EdgeInsets.all(3), padding: EdgeInsets.all(3),
margin: EdgeInsets.only(top: 10), margin:
child: AppText( EdgeInsets.only(top: 10),
item.status == 1
? TranslationBase.of(
context)
.approved
: item.status == 2
? TranslationBase.of(
context)
.pending
: TranslationBase.of(
context)
.rejected,
fontWeight: FontWeight.bold,
color: item.status == 1
? Colors.green
: item.status == 2
? HexColor('#CC9B14')
: Colors.red[800],
fontSize: 14,
),
),
SizedBox(
height: 5,
),
Container(
child: AppText( child: AppText(
item.requisitionType == 1 item.status == 1
? TranslationBase.of(context) ? TranslationBase.of(
.offTime context)
: TranslationBase.of(context) .approved
.holiday + : item.status == 2
' ', ? TranslationBase.of(
fontWeight: FontWeight.bold, context)
)), .pending
SizedBox( : TranslationBase.of(
height: 5, context)
), .rejected,
Row(children: [ fontWeight: FontWeight.bold,
AppText( color: item.status == 1
TranslationBase.of(context) ? Colors.green
.startDate), : item.status == 2
AppText( ? HexColor('#CC9B14')
DateUtils : Colors.red[800],
.convertStringToDateFormat( fontSize: 14,
item.dateTimeFrom, ),
'yyyy-MM-dd HH:mm'), ),
fontWeight: FontWeight.bold, Padding(
) padding:
EdgeInsets.only(top: 10),
// overflow: child: AppText(
// TextOverflow.ellipsis, DateUtils
.convertStringToDateFormat(
item.dateTimeTo,
'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold,
))
]), ]),
SizedBox(
height: 5,
),
Container(
child: AppText(
item.requisitionType == 1
? TranslationBase.of(context)
.offTime
: TranslationBase.of(context)
.holiday +
' ',
fontWeight: FontWeight.bold,
)),
SizedBox(
height: 5,
),
Row(children: [
AppText(TranslationBase.of(context)
.startDate),
AppText(
DateUtils.convertStringToDateFormat(
item.dateTimeFrom,
'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold,
)
// overflow: // overflow:
// TextOverflow.ellipsis, // TextOverflow.ellipsis,
]),
SizedBox( // overflow:
height: 5, // TextOverflow.ellipsis,
),
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(
? Row(children: [ children: [
AppText( AppText(TranslationBase.of(context)
TranslationBase.of( .endDate),
context) AppText(
.coveringDoctor, DateUtils
), .convertStringToDateFormat(
AppText( item.dateTimeTo,
getDoctor( 'yyyy-MM-dd HH:mm'),
model.coveringDoctors, fontWeight: FontWeight.bold,
item.coveringDoctorId), )
fontWeight:
FontWeight.bold,
)
])
: SizedBox(),
// AppText(
// TranslationBase.of(context)
// .reasons,
// fontWeight: FontWeight.bold,
// ),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Padding(
padding: EdgeInsets.only(
bottom: 5),
child: AppText(getReasons(
model.allReasons,
item.reasonId))),
(item.status == 2)
? IconButton(
icon: Image.asset(
'assets/images/edit.png'),
// color: Colors.green, //Colors.black,
onPressed: () => {
openLeave(
context, true,
extendedData:
item)
},
)
: SizedBox(),
]),
], ],
), ),
SizedBox( SizedBox(
width: 10, height: 5,
), ),
model.coveringDoctors.length > 0
? Row(children: [
AppText(
TranslationBase.of(context)
.coveringDoctor,
),
AppText(
getDoctor(
model.coveringDoctors,
item.coveringDoctorId),
fontWeight: FontWeight.bold,
)
])
: SizedBox(),
// AppText(
// TranslationBase.of(context)
// .reasons,
// fontWeight: FontWeight.bold,
// ),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: EdgeInsets.only(
bottom: 5),
child: AppText(getReasons(
model.allReasons,
item.reasonId))),
(item.status == 2)
? IconButton(
icon: Image.asset(
'assets/images/edit.png'),
// color: Colors.green, //Colors.black,
onPressed: () => {
openLeave(context, true,
extendedData: item)
},
)
: SizedBox(),
]),
], ],
), ),
), SizedBox(
], width: 10,
)), ),
], ],
), ),
); ),
}).toList(), ],
))) )),
])), ],
),
);
}).toList(),
)
]))),
); );
} }

@ -128,121 +128,121 @@ 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.all( // borderRadius: 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: // bottom:
SizeConfig.widthMultiplier * 0.9, // SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3, // right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3), // left: SizeConfig.widthMultiplier * 3),
child: Column( // child: Column(
crossAxisAlignment: // crossAxisAlignment:
CrossAxisAlignment.start, // CrossAxisAlignment.start,
children: [ // children: [
Row( // Row(
mainAxisSize: MainAxisSize.max, // mainAxisSize: MainAxisSize.max,
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
// 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: new IgnorePointer( // child: new IgnorePointer(
ignoring: true, // ignoring: true,
child: DropdownButton( // child: DropdownButton(
focusColor: // focusColor:
Colors.grey, // Colors.grey,
isExpanded: true, // isExpanded: true,
dropdownColor: // dropdownColor:
Colors.grey, // Colors.grey,
value: getClinicName( // value: getClinicName(
model) ?? // model) ??
"", // "",
iconSize: 0, // iconSize: 0,
elevation: 16, // elevation: 16,
selectedItemBuilder: // selectedItemBuilder:
(BuildContext // (BuildContext
context) { // context) {
return model // return model
.getClinicNameList() // .getClinicNameList()
.map((item) { // .map((item) {
return Row( // return Row(
mainAxisSize: // mainAxisSize:
MainAxisSize // MainAxisSize
.max, // .max,
children: < // children: <
Widget>[ // Widget>[
AppText( // AppText(
item, // item,
fontSize: // fontSize:
SizeConfig.textMultiplier * // SizeConfig.textMultiplier *
2.1, // 2.1,
color: Colors // color: Colors
.grey[ // .grey[
500], // 500],
), // ),
], // ],
); // );
}).toList(); // }).toList();
}, // },
onChanged: // onChanged:
(newValue) => // (newValue) =>
{}, // {},
items: model // items: model
.getClinicNameList() // .getClinicNameList()
.map((item) { // .map((item) {
return DropdownMenuItem( // return DropdownMenuItem(
value: item // value: item
.toString(), // .toString(),
child: Text( // child: Text(
item, // item,
textAlign: // textAlign:
TextAlign // TextAlign
.end, // .end,
), // ),
); // );
}).toList(), // }).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, // width: 1.0,
color: HexColor("#CCCCCC"))), // color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5), // padding: EdgeInsets.all(5),
child: Column( // child: Column(
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ // children: [
new IgnorePointer( // new IgnorePointer(
ignoring: true, // ignoring: true,
child: AppTextFormField( // child: AppTextFormField(
readOnly: true, // readOnly: true,
hintText: profile != null // hintText: profile != null
? profile['DoctorName'] // ? profile['DoctorName']
: "", // : "",
borderColor: Colors.white, // borderColor: Colors.white,
onSaved: (value) {}, // onSaved: (value) {},
inputFormatter: ONLY_NUMBERS)) // inputFormatter: ONLY_NUMBERS))
], // ],
), // ),
), // ),
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
@ -842,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),

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

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

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

@ -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];
@ -1184,6 +1187,7 @@ class TranslationBase {
localizedValues['add-reschedule'][locale.languageCode]; localizedValues['add-reschedule'][locale.languageCode];
String get updateReschedule => String get updateReschedule =>
localizedValues['update-reschedule'][locale.languageCode]; localizedValues['update-reschedule'][locale.languageCode];
String get sickLeave => localizedValues['sick_leave'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save