feat: Remove shift confirmation and decline dialogs from MyShiftsTab

This commit is contained in:
Achintha Isuru
2026-03-19 16:25:45 -04:00
parent 18a459a453
commit eff8bcce57

View File

@@ -112,76 +112,6 @@ class _MyShiftsTabState extends State<MyShiftsTab> {
return a.year == b.year && a.month == b.month && a.day == b.day; return a.year == b.year && a.month == b.month && a.day == b.day;
} }
void _confirmShift(String id) {
showDialog(
context: context,
builder: (BuildContext ctx) => AlertDialog(
title:
Text(context.t.staff_shifts.my_shifts_tab.confirm_dialog.title),
content:
Text(context.t.staff_shifts.my_shifts_tab.confirm_dialog.message),
actions: <Widget>[
TextButton(
onPressed: () => Navigator.of(ctx).pop(),
child: Text(context.t.common.cancel),
),
TextButton(
onPressed: () {
Navigator.of(ctx).pop();
ReadContext(context).read<ShiftsBloc>().add(AcceptShiftEvent(id));
UiSnackbar.show(
context,
message: context
.t.staff_shifts.my_shifts_tab.confirm_dialog.success,
type: UiSnackbarType.success,
);
},
style: TextButton.styleFrom(
foregroundColor: UiColors.success,
),
child:
Text(context.t.staff_shifts.shift_details.accept_shift),
),
],
),
);
}
void _declineShift(String id) {
showDialog(
context: context,
builder: (BuildContext ctx) => AlertDialog(
title:
Text(context.t.staff_shifts.my_shifts_tab.decline_dialog.title),
content: Text(
context.t.staff_shifts.my_shifts_tab.decline_dialog.message,
),
actions: <Widget>[
TextButton(
onPressed: () => Navigator.of(ctx).pop(),
child: Text(context.t.common.cancel),
),
TextButton(
onPressed: () {
Navigator.of(ctx).pop();
ReadContext(context).read<ShiftsBloc>().add(DeclineShiftEvent(id));
UiSnackbar.show(
context,
message: context
.t.staff_shifts.my_shifts_tab.decline_dialog.success,
type: UiSnackbarType.error,
);
},
style: TextButton.styleFrom(
foregroundColor: UiColors.destructive,
),
child: Text(context.t.staff_shifts.shift_details.decline),
),
],
),
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<DateTime> calendarDays = _getCalendarDays(); final List<DateTime> calendarDays = _getCalendarDays();
@@ -352,10 +282,6 @@ class _MyShiftsTabState extends State<MyShiftsTab> {
data: ShiftCardData.fromPending(assignment), data: ShiftCardData.fromPending(assignment),
onTap: () => Modular.to onTap: () => Modular.to
.toShiftDetailsById(assignment.shiftId), .toShiftDetailsById(assignment.shiftId),
onAccept: () =>
_confirmShift(assignment.shiftId),
onDecline: () =>
_declineShift(assignment.shiftId),
), ),
), ),
), ),