feat: update shift action buttons to conditionally display decline and book options based on shift status

This commit is contained in:
Achintha Isuru
2026-02-01 12:54:50 -05:00
parent 54f28a85ce
commit 6d70bcc5d0

View File

@@ -443,12 +443,20 @@ class ShiftDetailsPage extends StatelessWidget {
),
],
const SizedBox(height: 20),
if (displayShift!.status != 'confirmed' &&
(displayShift!.hasApplied == true ||
(displayShift!.requiredSlots == null ||
displayShift!.filledSlots == null ||
displayShift!.filledSlots! <
displayShift!.requiredSlots!)))
Row(
children: [
Expanded(
child: OutlinedButton(
onPressed: () =>
_declineShift(context, displayShift!.id),
onPressed: () => _declineShift(
context,
displayShift!.id,
),
style: OutlinedButton.styleFrom(
foregroundColor: const Color(0xFFEF4444),
side: const BorderSide(
@@ -476,7 +484,9 @@ class ShiftDetailsPage extends StatelessWidget {
DateTime.tryParse(displayShift!.date),
),
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFF10B981),
backgroundColor: const Color(
0xFF10B981,
),
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(
vertical: 16,