feat: add unlink confirmation dialog, enable agent navigation, update notification read status UI, and increment app version

This commit is contained in:
pradeepkumar
2026-04-24 12:50:49 +05:30
parent 9c89e93476
commit 0f49b21f33
4 changed files with 93 additions and 22 deletions

View File

@@ -448,12 +448,61 @@ class _AgentDetailScreenState extends ConsumerState<AgentDetailScreen> {
return;
}
if (state.connectionState == 'accepted') {
ref.read(agentDetailProvider(widget.agentId).notifier).cancelConnection();
_showUnlinkConfirmation(state);
return;
}
_showConnectModal(state);
}
void _showUnlinkConfirmation(AgentDetailState state) {
final agentName = state.agent?.fullName ?? 'this agent';
showDialog<void>(
context: context,
builder: (ctx) => AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
title: const Text(
'Unlink Agent',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
color: Color(0xFF00293d),
),
),
content: Text(
'Are you sure you want to unlink $agentName? You will need to send a new connection request to reconnect.',
style: const TextStyle(fontSize: 14, color: Color(0xFF4B5563)),
),
actions: [
TextButton(
onPressed: () => Navigator.of(ctx).pop(),
child: const Text(
'Cancel',
style: TextStyle(color: Color(0xFF6B7280)),
),
),
ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFFE58625),
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
onPressed: () {
Navigator.of(ctx).pop();
ref
.read(agentDetailProvider(widget.agentId).notifier)
.cancelConnection();
},
child: const Text('Unlink'),
),
],
),
);
}
void _showConnectModal(AgentDetailState state) {
final controller = TextEditingController();
showModalBottomSheet(