mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-11 16:30:28 +00:00
Refactor MapMessageOverlay to use MessageBubble for message display
- Removed inline message display logic from MapMessageOverlay. - Introduced MessageBubble widget to handle various message types and styles. - Simplified message handling in MapMessageOverlay by delegating to MessageBubble. - Enhanced code readability and maintainability by separating concerns.
This commit is contained in:
@@ -1867,9 +1867,9 @@ class _MapTabState extends State<MapTab> with AutomaticKeepAliveClientMixin {
|
||||
width: 300,
|
||||
child: Consumer<MessagesProvider>(
|
||||
builder: (context, messagesProvider, _) {
|
||||
// Get last 20 non-system messages, sorted chronologically
|
||||
// Get last 20 non-system and non-drawing messages, sorted chronologically
|
||||
final recentMessages = messagesProvider.messages
|
||||
.where((m) => !m.isSystemMessage)
|
||||
.where((m) => !m.isSystemMessage && !m.isDrawing)
|
||||
.toList()
|
||||
..sort((a, b) => a.sentAt.compareTo(b.sentAt));
|
||||
final displayMessages = recentMessages.length > 20
|
||||
|
||||
Reference in New Issue
Block a user