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:
Janez T
2025-10-28 21:21:11 +01:00
parent b899c792a6
commit 0371c3cd04
4 changed files with 1129 additions and 1365 deletions

View File

@@ -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