|
|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/sick_leave_patient_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
|
|
|
|
|
@ -22,7 +23,7 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
patient = routeArgs['patient'];
|
|
|
|
|
return BaseView<SickLeaveViewModel>(
|
|
|
|
|
onModelReady: (model) =>
|
|
|
|
|
model.getSickLeave(patient.patientMRN ?? patient.patientId),
|
|
|
|
|
model.getSickLeavePatient(patient.patientMRN ?? patient.patientId),
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
@ -102,25 +103,26 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
model.getAllSIckLeave.length > 0
|
|
|
|
|
model.getAllSIckLeavePatient.length > 0
|
|
|
|
|
? Column(
|
|
|
|
|
children: model.getAllSIckLeave
|
|
|
|
|
.map<Widget>((GetAllSickLeaveResponse item) {
|
|
|
|
|
children: model.getAllSIckLeavePatient
|
|
|
|
|
.map<Widget>((SickLeavePatientModel item) {
|
|
|
|
|
return RoundedContainer(
|
|
|
|
|
margin: EdgeInsets.all(10),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border(
|
|
|
|
|
left: BorderSide(
|
|
|
|
|
color: item.status == 1
|
|
|
|
|
? Colors.yellow[800]
|
|
|
|
|
: item.status == 2
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Colors.black,
|
|
|
|
|
width: 5.0,
|
|
|
|
|
))),
|
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
|
// border: Border(
|
|
|
|
|
// left: BorderSide(
|
|
|
|
|
// // color: item.status == 1
|
|
|
|
|
// // ? Colors.yellow[800]
|
|
|
|
|
// // : item.status == 2
|
|
|
|
|
// // ? Colors.green
|
|
|
|
|
// // : Colors.black,
|
|
|
|
|
// color: Colors.red,
|
|
|
|
|
// width: 5.0,
|
|
|
|
|
// ))),
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
@ -139,35 +141,37 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(3),
|
|
|
|
|
child: AppText(
|
|
|
|
|
item.status == 1
|
|
|
|
|
? TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.hold
|
|
|
|
|
: item.status == 2
|
|
|
|
|
? TranslationBase
|
|
|
|
|
.of(
|
|
|
|
|
context)
|
|
|
|
|
.active
|
|
|
|
|
: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.all,
|
|
|
|
|
item.doctorName,
|
|
|
|
|
// item.status == 1
|
|
|
|
|
// ? TranslationBase.of(
|
|
|
|
|
// context)
|
|
|
|
|
// .hold
|
|
|
|
|
// : item.status == 2
|
|
|
|
|
// ? TranslationBase
|
|
|
|
|
// .of(
|
|
|
|
|
// context)
|
|
|
|
|
// .active
|
|
|
|
|
// : TranslationBase
|
|
|
|
|
// .of(context)
|
|
|
|
|
// .all,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
color: item.status == 1
|
|
|
|
|
? Colors.yellow[800]
|
|
|
|
|
: item.status == 2
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Colors.black,
|
|
|
|
|
// color: item.status == 1
|
|
|
|
|
// ? Colors.yellow[800]
|
|
|
|
|
// : item.status == 2
|
|
|
|
|
// ? Colors.green
|
|
|
|
|
// : Colors.black,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.daysSickleave +
|
|
|
|
|
": "),
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.daysSickleave),
|
|
|
|
|
AppText(
|
|
|
|
|
item.noOfDays
|
|
|
|
|
item.sickLeaveDays
|
|
|
|
|
.toString(),
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
@ -183,52 +187,55 @@ class AddSickLeavScreen extends StatelessWidget {
|
|
|
|
|
' ',
|
|
|
|
|
),
|
|
|
|
|
Flexible(
|
|
|
|
|
child: AppText(
|
|
|
|
|
DateUtils
|
|
|
|
|
.convertStringToDateFormat(
|
|
|
|
|
item.startDate,
|
|
|
|
|
'dd-MMM-yyyy'),
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
))
|
|
|
|
|
child: AppText(
|
|
|
|
|
DateUtils
|
|
|
|
|
.convertStringToDateFormat(
|
|
|
|
|
item.startDate,
|
|
|
|
|
'dd-MMM-yyyy'),
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment
|
|
|
|
|
.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
item.remarks ?? "",
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.endDate +
|
|
|
|
|
' ',
|
|
|
|
|
),
|
|
|
|
|
Flexible(
|
|
|
|
|
child: AppText(
|
|
|
|
|
DateUtils
|
|
|
|
|
.convertStringToDateFormat(
|
|
|
|
|
item.endDate,
|
|
|
|
|
'dd-MMM-yyyy'),
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
// (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()
|
|
|
|
|
]),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(children: [
|
|
|
|
|
AppText(TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.branch +
|
|
|
|
|
": "),
|
|
|
|
|
AppText(
|
|
|
|
|
item.projectName ?? "",
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
Row(children: [
|
|
|
|
|
AppText(TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.clinic +
|
|
|
|
|
": "),
|
|
|
|
|
AppText(
|
|
|
|
|
item.clinicName ?? "",
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
|