feat: add context menu to conversations screen and simplify manage network UI component
This commit is contained in:
@@ -151,22 +151,14 @@ class AgentNetworkScreen extends ConsumerWidget {
|
|||||||
width: 0.5),
|
width: 0.5),
|
||||||
borderRadius: BorderRadius.circular(7),
|
borderRadius: BorderRadius.circular(7),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: const Text(
|
||||||
children: [
|
'Manage My Network',
|
||||||
const Text(
|
style: TextStyle(
|
||||||
'Manage My Network',
|
fontFamily: 'Fractul',
|
||||||
style: TextStyle(
|
fontSize: 14,
|
||||||
fontFamily: 'Fractul',
|
fontWeight: FontWeight.w600,
|
||||||
fontSize: 14,
|
color: AppColors.primaryDark,
|
||||||
fontWeight: FontWeight.w600,
|
),
|
||||||
color: AppColors.primaryDark,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Spacer(),
|
|
||||||
Icon(Icons.arrow_forward,
|
|
||||||
size: 20,
|
|
||||||
color: AppColors.primaryDark.withValues(alpha: 0.7)),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -200,18 +200,48 @@ class _ConversationsScreenState extends ConsumerState<ConversationsScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
// Three dots menu (outside the search box)
|
// Three dots menu
|
||||||
GestureDetector(
|
PopupMenuButton<String>(
|
||||||
onTap: () {},
|
icon: const Icon(
|
||||||
behavior: HitTestBehavior.opaque,
|
Icons.more_horiz,
|
||||||
child: const Padding(
|
size: 22,
|
||||||
padding: EdgeInsets.all(4),
|
color: AppColors.primaryDark,
|
||||||
child: Icon(
|
|
||||||
Icons.more_horiz,
|
|
||||||
size: 22,
|
|
||||||
color: AppColors.primaryDark,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
onSelected: (value) {
|
||||||
|
switch (value) {
|
||||||
|
case 'mark_all_read':
|
||||||
|
final conversations =
|
||||||
|
ref.read(messagingProvider).conversations;
|
||||||
|
for (final c in conversations) {
|
||||||
|
if (c.unreadCount > 0) {
|
||||||
|
ref
|
||||||
|
.read(messagingProvider.notifier)
|
||||||
|
.markAsRead(c.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(
|
||||||
|
content: Text('All conversations marked as read')),
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case 'refresh':
|
||||||
|
ref
|
||||||
|
.read(messagingProvider.notifier)
|
||||||
|
.loadConversations();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
itemBuilder: (_) => const [
|
||||||
|
PopupMenuItem(
|
||||||
|
value: 'mark_all_read',
|
||||||
|
child: Text('Mark all as read'),
|
||||||
|
),
|
||||||
|
PopupMenuItem(
|
||||||
|
value: 'refresh',
|
||||||
|
child: Text('Refresh'),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user