buildNewsMarkerLayer function

MarkerLayer buildNewsMarkerLayer({
  1. required BuildContext context,
  2. required List<NewsMarker> newsMarkers,
})

Builds a marker layer for news markers.

Implementation

MarkerLayer buildNewsMarkerLayer({
  required BuildContext context,
  required List<NewsMarker> newsMarkers,
}) {
  return MarkerLayer(
    markers: newsMarkers
        .map(
          (n) => Marker(
            point: n.location,
            width: 36,
            height: 36,
            child: GestureDetector(
              onTap: () => showNewsMarkerDetailsSheet(context, n),
              child: Container(
                decoration: BoxDecoration(
                  color: Colors.blue.shade700,
                  shape: BoxShape.circle,
                  border: Border.all(color: Colors.white, width: 2),
                  boxShadow: [
                    BoxShadow(
                      color: Colors.black.withValues(alpha: 0.3),
                      blurRadius: 4,
                      offset: const Offset(0, 2),
                    ),
                  ],
                ),
                child: const Icon(Icons.article, size: 20, color: Colors.white),
              ),
            ),
          ),
        )
        .toList(),
  );
}