diff --git a/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md index 9bf48f6ac87..028ca4a0d5a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.14+3 + +* Replaces uses of deprecated `Color` properties. + ## 0.5.14+2 * Fixes a bug where using `cloudMapId` for cloud-based styling would fail if the `style` property was also present. diff --git a/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_controller_test.dart b/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_controller_test.dart index ac5a78ab0e9..2cf115e0ae7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_controller_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_controller_test.dart @@ -491,7 +491,7 @@ void main() { mapConfiguration: const MapConfiguration( mapType: MapType.satellite, zoomControlsEnabled: true, - cloudMapId: _kCloudMapId, + mapId: _kCloudMapId, fortyFiveDegreeImageryEnabled: false, ), ); diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart index f4ca29a478d..4c234b8646c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart @@ -26,17 +26,20 @@ final Map _bitmapBlobUrlCache = {}; // Converts a [Color] into a valid CSS value #RRGGBB. String _getCssColor(Color color) { - return '#${color.value.toRadixString(16).padLeft(8, '0').substring(2)}'; + return '#${color.toARGB32().toRadixString(16).padLeft(8, '0').substring(2)}'; } // Extracts the opacity from a [Color]. double _getCssOpacity(Color color) { - return color.opacity; + return color.a; } // Converts a [Color] into a valid CSS value rgba(R, G, B, A). String _getCssColorWithAlpha(Color color) { - return 'rgba(${color.red}, ${color.green}, ${color.blue}, ${(color.alpha / 255).toStringAsFixed(2)})'; + return 'rgba(${(color.r * 255.0).round().clamp(0, 255)}, ' + '${(color.g * 255.0).round().clamp(0, 255)}, ' + '${(color.b * 255.0).round().clamp(0, 255)}, ' + '${color.a.toStringAsFixed(2)})'; } // Converts options from the plugin into gmaps.MapOptions that can be used by the JS SDK. @@ -122,11 +125,11 @@ gmaps.MapOptions _configurationAndStyleToGmapsOptions( options.streetViewControl = false; // If using cloud map, do not set options.styles - if (configuration.cloudMapId == null) { + if (configuration.mapId == null) { options.styles = styles; } - options.mapId = configuration.cloudMapId; + options.mapId = configuration.mapId; return options; } diff --git a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml index 672b6d7a069..fe1f6554088 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_web description: Web platform implementation of google_maps_flutter repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 0.5.14+2 +version: 0.5.14+3 environment: sdk: ^3.7.0