added sick leave status text & color

sultan_v3.3
haroon amjad 2 years ago
parent c8ec536267
commit aafdf3760d

@ -1865,5 +1865,7 @@ const Map localizedValues = {
"enter-workplace-name": {"en": "Please enter your workplace name:", "ar": "رجاء إدخال مكان العمل:"},
"workplaceName": {"en": "Workplace name:", "ar": "مكان العمل:"},
"callLiveCareSupport": {"en": "Call LiveCare Support", "ar": "اتصل بدعم لايف كير"},
"needApproval": {"en": "Your sick leave under process in medical administration, you will be notified once approved.", "ar": "جازتك المرضية تحت الإجراء في الإدارة الطبية ، سوف يتم إشعارك فور الموافقه عليها."},
"needApproval": {"en": "Your sick leave is under process in medical administration, you will be notified once approved.", "ar": "جازتك المرضية تحت الإجراء في الإدارة الطبية ، سوف يتم إشعارك فور الموافقه عليها."},
"pendingActivation": {"en": "Pending Activation", "ar": "في انتظار التنشيط"},
"awaitingApproval": {"en": "Awaiting Approval", "ar": "انتظر القبول"},
};

@ -57,6 +57,8 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
subName: model.sickLeaveList[index].clinicName,
isSortByClinic: false,
isInOutPatient: model.sickLeaveList[index].isInOutPatient,
isSickLeave: true,
sickLeaveStatus: model.sickLeaveList[index].status,
onEmailTap: () {
showConfirmMessage(model, index);
},

@ -2874,6 +2874,8 @@ class TranslationBase {
String get workplaceName => localizedValues["workplaceName"][locale.languageCode];
String get needApproval => localizedValues["needApproval"][locale.languageCode];
String get callLiveCareSupport => localizedValues["callLiveCareSupport"][locale.languageCode];
String get pendingActivation => localizedValues["pendingActivation"][locale.languageCode];
String get awaitingApproval => localizedValues["awaitingApproval"][locale.languageCode];
}

@ -30,6 +30,8 @@ class DoctorCard extends StatelessWidget {
final bool isParentAppointment;
final int remainingTimeInMinutes;
final String vaccineName;
final bool isSickLeave;
final int sickLeaveStatus;
DoctorCard(
{this.name,
@ -47,7 +49,9 @@ class DoctorCard extends StatelessWidget {
this.remainingTimeInMinutes,
this.isShowInOutPatient = true,
this.vaccineName = "",
this.isParentAppointment = false});
this.isParentAppointment = false,
this.isSickLeave = false,
this.sickLeaveStatus = 0});
ProjectViewModel projectViewModel;
@ -55,7 +59,7 @@ class DoctorCard extends StatelessWidget {
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return Container(
height: 128,
height: 135,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(10.0),
@ -117,6 +121,11 @@ class DoctorCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (isSickLeave)
Text(
getStatusText(context),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: getStatusColor(), letterSpacing: -0.4, height: 16 / 10),
),
Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@ -237,4 +246,32 @@ class DoctorCard extends StatelessWidget {
),
);
}
String getStatusText(BuildContext context) {
String statusText = "";
if (sickLeaveStatus == 1) {
statusText = TranslationBase.of(context).pendingActivation;
} else if (sickLeaveStatus == 2) {
statusText = TranslationBase.of(context).ready;
} else if (sickLeaveStatus == 3) {
statusText = TranslationBase.of(context).awaitingApproval;
} else {
statusText = "";
}
return statusText;
}
Color getStatusColor() {
Color statusColor = Colors.white;
if (sickLeaveStatus == 1) {
statusColor = Color(0xffCC9B14);
} else if (sickLeaveStatus == 2) {
statusColor = Color(0xff359846);
} else if (sickLeaveStatus == 3) {
statusColor = Color(0xffD02127);
} else {
statusColor = Colors.white;
}
return statusColor;
}
}

Loading…
Cancel
Save