Added Type, Category and Signatories on task

This commit is contained in:
2026-02-21 14:33:22 +08:00
parent d32449d096
commit 8d31a629ac
14 changed files with 1178 additions and 48 deletions
+11 -8
View File
@@ -477,7 +477,7 @@ class _ScheduleTile extends ConsumerWidget {
mainAxisSize: MainAxisSize.min,
children: [
DropdownButtonFormField<String>(
value: selectedId,
initialValue: selectedId,
items: [
for (final profile in staff)
DropdownMenuItem(
@@ -515,7 +515,7 @@ class _ScheduleTile extends ConsumerWidget {
),
const SizedBox(height: 12),
DropdownButtonFormField<String>(
value: selectedTargetShiftId,
initialValue: selectedTargetShiftId,
items: [
for (final s in recipientShifts)
DropdownMenuItem(
@@ -553,11 +553,14 @@ class _ScheduleTile extends ConsumerWidget {
},
);
if (!context.mounted) return;
if (!context.mounted) {
return;
}
if (confirmed != true ||
selectedId == null ||
selectedTargetShiftId == null)
selectedTargetShiftId == null) {
return;
}
try {
await ref
@@ -1976,7 +1979,7 @@ class _SwapRequestsPanel extends ConsumerWidget {
return;
}
Profile? _choice = eligible.first;
Profile? choice = eligible.first;
final selected = await showDialog<Profile?>(
context: context,
builder: (context) {
@@ -1984,13 +1987,13 @@ class _SwapRequestsPanel extends ConsumerWidget {
title: const Text('Change recipient'),
content: StatefulBuilder(
builder: (context, setState) => DropdownButtonFormField<Profile>(
value: _choice,
initialValue: choice,
items: eligible
.map(
(p) => DropdownMenuItem(value: p, child: Text(p.fullName)),
)
.toList(),
onChanged: (v) => setState(() => _choice = v),
onChanged: (v) => setState(() => choice = v),
),
),
actions: [
@@ -1999,7 +2002,7 @@ class _SwapRequestsPanel extends ConsumerWidget {
child: const Text('Cancel'),
),
TextButton(
onPressed: () => Navigator.of(context).pop(_choice),
onPressed: () => Navigator.of(context).pop(choice),
child: const Text('Save'),
),
],