@ -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: 1 28 ,
height: 1 35 ,
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 ;
}
}