Skip to content

Commit c7d1c9c

Browse files
FLUT-931209-[others]: updated maps latest changes
1 parent 8dae9eb commit c7d1c9c

File tree

7 files changed

+32
-27
lines changed

7 files changed

+32
-27
lines changed

packages/syncfusion_flutter_maps/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
## [28.1.29] - 12/12/2024
1+
## [28.1.36] - 12/24/2024
2+
3+
**General**
4+
5+
* The compatible version of our Flutter maps widget has been updated to Flutter SDK 3.27.0.
6+
7+
## [28.1.33] - 12/12/2024
28

39
**General**
410

packages/syncfusion_flutter_maps/lib/src/elements/bubble.dart

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,8 @@ class RenderMapBubble extends ShapeLayerChildRenderBoxBase {
269269
}
270270

271271
void _updateHoverItemTween() {
272-
final double opacity =
273-
_bubbleAnimation.value * _bubbleSettings.color!.opacity;
274-
final Color defaultColor = bubbleSettings.color!.withOpacity(opacity);
272+
final double opacity = _bubbleAnimation.value * _bubbleSettings.color!.a;
273+
final Color defaultColor = bubbleSettings.color!.withValues(alpha: opacity);
275274
if (_currentHoverItem != null) {
276275
_forwardBubbleHoverColorTween.begin =
277276
_currentHoverItem!.bubbleColor ?? defaultColor;
@@ -354,10 +353,11 @@ class RenderMapBubble extends ShapeLayerChildRenderBoxBase {
354353
}
355354

356355
void _initializeToggledBubbleTweenColors() {
357-
final Color? toggledBubbleColor = _themeData.toggledItemColor !=
358-
Colors.transparent
359-
? _themeData.toggledItemColor!.withOpacity(_legend!.toggledItemOpacity)
360-
: null;
356+
final Color? toggledBubbleColor =
357+
_themeData.toggledItemColor != Colors.transparent
358+
? _themeData.toggledItemColor!
359+
.withValues(alpha: _legend!.toggledItemOpacity)
360+
: null;
361361

362362
_forwardToggledBubbleColorTween.end = toggledBubbleColor;
363363
_forwardToggledBubbleStrokeColorTween.begin = _themeData.bubbleStrokeColor;
@@ -415,9 +415,8 @@ class RenderMapBubble extends ShapeLayerChildRenderBoxBase {
415415
..clipRect(bounds);
416416
controller!.applyTransform(context, offset);
417417

418-
final double opacity =
419-
_bubbleAnimation.value * _bubbleSettings.color!.opacity;
420-
final Color defaultColor = bubbleSettings.color!.withOpacity(opacity);
418+
final double opacity = _bubbleAnimation.value * _bubbleSettings.color!.a;
419+
final Color defaultColor = bubbleSettings.color!.withValues(alpha: opacity);
421420
final bool hasToggledIndices = controller!.toggledIndices.isNotEmpty;
422421
final Paint fillPaint = Paint()..isAntiAlias = true;
423422
final Paint strokePaint = Paint()

packages/syncfusion_flutter_maps/lib/src/elements/data_label.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,6 @@ class _RenderMapDataLabel extends ShapeLayerChildRenderBoxBase {
282282
if (color == null) {
283283
return null;
284284
}
285-
return color.withOpacity(_opacityTween.evaluate(_dataLabelAnimation));
285+
return color.withValues(alpha: _opacityTween.evaluate(_dataLabelAnimation));
286286
}
287287
}

packages/syncfusion_flutter_maps/lib/src/elements/legend.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2407,7 +2407,7 @@ class _LegendState extends State<Legend> {
24072407
Color? _getEffectiveToggledItemColor() {
24082408
if (widget.themeData.toggledItemColor != Colors.transparent) {
24092409
return widget.themeData.toggledItemColor!
2410-
.withOpacity(widget.legend.toggledItemOpacity);
2410+
.withValues(alpha: widget.legend.toggledItemOpacity);
24112411
}
24122412
return widget.themeData.toggledItemColor;
24132413
}

packages/syncfusion_flutter_maps/lib/src/layer/shape_layer.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,8 @@ class _GeoJSONLayerState extends State<GeoJSONLayer>
13781378
mapsThemeData.shapeHoverStrokeWidth ?? mapsThemeData.layerStrokeWidth,
13791379
legendTextStyle: themeData.textTheme.bodySmall!
13801380
.copyWith(
1381-
color: themeData.textTheme.bodySmall!.color!.withOpacity(0.87))
1381+
color:
1382+
themeData.textTheme.bodySmall!.color!.withValues(alpha: 0.87))
13821383
.merge(mapsThemeData.legendTextStyle)
13831384
.merge(widget.legend?.textStyle),
13841385
markerIconColor:
@@ -1573,10 +1574,9 @@ class _GeoJSONLayerState extends State<GeoJSONLayer>
15731574
mapModel.legendMapperIndex = i;
15741575
mapModel.colorValue = colorValue;
15751576
if (mapper.minOpacity != null && mapper.maxOpacity != null) {
1576-
return mapper.color.withOpacity(lerpDouble(
1577-
mapper.minOpacity,
1578-
mapper.maxOpacity,
1579-
(colorValue - mapper.from!) / (mapper.to! - mapper.from!))!);
1577+
return mapper.color.withValues(
1578+
alpha: lerpDouble(mapper.minOpacity, mapper.maxOpacity,
1579+
(colorValue - mapper.from!) / (mapper.to! - mapper.from!)));
15801580
}
15811581
return mapper.color;
15821582
}

packages/syncfusion_flutter_maps/lib/src/layer/vector_layers.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -763,8 +763,8 @@ class _MapLineLayerState extends State<_MapLineLayer>
763763
animation: widget.animation,
764764
color: widget.color ??
765765
(themeData.brightness == Brightness.light
766-
? themeData.colorScheme.onSurface.withOpacity(0.44)
767-
: themeData.colorScheme.onSurface.withOpacity(0.78)),
766+
? themeData.colorScheme.onSurface.withValues(alpha: 0.44)
767+
: themeData.colorScheme.onSurface.withValues(alpha: 0.78)),
768768
width: widget.width,
769769
strokeCap: widget.strokeCap,
770770
dashArray: widget.dashArray,
@@ -1826,8 +1826,8 @@ class _MapArcLayerState extends State<_MapArcLayer>
18261826
animation: widget.animation,
18271827
color: widget.color ??
18281828
(themeData.brightness == Brightness.light
1829-
? themeData.colorScheme.onSurface.withOpacity(0.44)
1830-
: themeData.colorScheme.onSurface.withOpacity(0.78)),
1829+
? themeData.colorScheme.onSurface.withValues(alpha: 0.44)
1830+
: themeData.colorScheme.onSurface.withValues(alpha: 0.78)),
18311831
width: widget.width,
18321832
dashArray: widget.dashArray,
18331833
tooltipBuilder: widget.tooltipBuilder,
@@ -2907,8 +2907,8 @@ class _MapPolylineLayerState extends State<_MapPolylineLayer>
29072907
animation: widget.animation,
29082908
color: widget.color ??
29092909
(themeData.brightness == Brightness.light
2910-
? themeData.colorScheme.onSurface.withOpacity(0.44)
2911-
: themeData.colorScheme.onSurface.withOpacity(0.78)),
2910+
? themeData.colorScheme.onSurface.withValues(alpha: 0.44)
2911+
: themeData.colorScheme.onSurface.withValues(alpha: 0.78)),
29122912
width: widget.width,
29132913
strokeCap: widget.strokeCap,
29142914
dashArray: widget.dashArray,

packages/syncfusion_flutter_maps/lib/src/utils.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ Color getSaturatedColor(Color color, [Color mix = Colors.black]) {
2929
return color == Colors.transparent
3030
? color
3131
: Color.fromRGBO(
32-
((1 - factor) * color.red + factor * mix.red).toInt(),
33-
((1 - factor) * color.green + factor * mix.green).toInt(),
34-
((1 - factor) * color.blue + factor * mix.blue).toInt(),
32+
((1 - factor) * (color.r * 255) + factor * (mix.r * 255)).toInt(),
33+
((1 - factor) * (color.g * 255) + factor * (mix.g * 255)).toInt(),
34+
((1 - factor) * (color.b * 255) + factor * (mix.b * 255)).toInt(),
3535
1);
3636
}
3737

0 commit comments

Comments
 (0)