Skip to content

Commit

Permalink
ref : add check for canceled attendance section in employee_presence_…
Browse files Browse the repository at this point in the history
…card_widget.dart
  • Loading branch information
ryanaidilp committed May 31, 2021
1 parent 049188d commit ac14b17
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions lib/widgets/employee_presence_card_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,24 @@ class EmployeePresenceCardWidget extends StatelessWidget {
);
}

String checkAddressLabel() {
if (int.parse(point.substring(0, point.length - 1)) == 0 &&
address.isNotEmpty) {
return 'Alasan Pembatalan';
}

return 'Lokasi';
}

IconData checkAddressIcon() {
if (int.parse(point.substring(0, point.length - 1)) == 0 &&
address.isNotEmpty) {
return Icons.notes_rounded;
}

return Icons.location_on_rounded;
}

@override
Widget build(BuildContext context) {
return Container(
Expand Down Expand Up @@ -156,12 +174,12 @@ class EmployeePresenceCardWidget extends StatelessWidget {
Row(
children: <Widget>[
Icon(
Icons.location_on,
checkAddressIcon(),
color: Colors.grey[600],
size: 20.0,
),
sizedBoxW4,
Text('Lokasi', style: labelTextStyle)
Text(checkAddressLabel(), style: labelTextStyle)
],
),
sizedBoxH4,
Expand Down

0 comments on commit ac14b17

Please sign in to comment.