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