feat: add unlink confirmation dialog, enable agent navigation, update notification read status UI, and increment app version
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user