Fix google maps marker hacing different size on different screen size

This commit is contained in:
Ming Ming 2024-08-05 00:50:10 +08:00
parent da8af5db07
commit f33d6f0744

View file

@ -93,12 +93,13 @@ class _GoogleMarkerBuilder extends _MarkerBuilder {
});
Future<BitmapDescriptor> build(List<_DataPoint> dataPoints) async {
final size = MediaQuery.sizeOf(context);
return _GoogleMarkerBitmapBuilder(
imagePath: await _getImagePath(dataPoints),
size: _getMarkerSize(dataPoints.length),
size: _getMarkerSize(dataPoints.length) / 450 * size.width,
color: Theme.of(context).colorScheme.primaryContainer,
text: _getMarkerCountString(dataPoints.length),
textSize: _getMarkerTextSize(dataPoints.length),
textSize: _getMarkerTextSize(dataPoints.length) / 450 * size.width,
textColor: Theme.of(context).colorScheme.onPrimaryContainer,
).build();
}