Skip to content

Commit ac14b17

Browse files
committed
ref : add check for canceled attendance section in employee_presence_card_widget.dart
1 parent 049188d commit ac14b17

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

lib/widgets/employee_presence_card_widget.dart

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,24 @@ class EmployeePresenceCardWidget extends StatelessWidget {
8989
);
9090
}
9191

92+
String checkAddressLabel() {
93+
if (int.parse(point.substring(0, point.length - 1)) == 0 &&
94+
address.isNotEmpty) {
95+
return 'Alasan Pembatalan';
96+
}
97+
98+
return 'Lokasi';
99+
}
100+
101+
IconData checkAddressIcon() {
102+
if (int.parse(point.substring(0, point.length - 1)) == 0 &&
103+
address.isNotEmpty) {
104+
return Icons.notes_rounded;
105+
}
106+
107+
return Icons.location_on_rounded;
108+
}
109+
92110
@override
93111
Widget build(BuildContext context) {
94112
return Container(
@@ -156,12 +174,12 @@ class EmployeePresenceCardWidget extends StatelessWidget {
156174
Row(
157175
children: <Widget>[
158176
Icon(
159-
Icons.location_on,
177+
checkAddressIcon(),
160178
color: Colors.grey[600],
161179
size: 20.0,
162180
),
163181
sizedBoxW4,
164-
Text('Lokasi', style: labelTextStyle)
182+
Text(checkAddressLabel(), style: labelTextStyle)
165183
],
166184
),
167185
sizedBoxH4,

0 commit comments

Comments
 (0)