From 5ba990b82e18cec8f459bb2c1fe8d767b5ee511a Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Thu, 20 Jun 2024 11:09:19 +0300 Subject: [PATCH] [google_maps_flutter] deprecate old BitmapDescriptor methods (#6905) Deprecates `BitmapDescriptor.fromAssetImage` in favor of `BitmapDescriptor.asset` and `AssetMapBitmap.create`. Deprecates `BitmapDescriptor.fromBytes` in favor of `BitmapDescriptor.bytes` and `BytesMapBitmap` This is part of the implementation of the following federated plugin PR: https://github.com/flutter/packages/pull/4055 Related to issue: https://github.com/flutter/flutter/issues/34657 --- .../google_maps_flutter_platform_interface/CHANGELOG.md | 5 +++++ .../lib/src/types/bitmap.dart | 2 ++ .../google_maps_flutter_platform_interface/pubspec.yaml | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md index c4a3cebf3b5f..a137b29112c7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.8.0 + +* Deprecates `BitmapDescriptor.fromAssetImage` in favor of `BitmapDescriptor.asset` and `AssetMapBitmap.create`. +* Deprecates `BitmapDescriptor.fromBytes` in favor of `BitmapDescriptor.bytes` and `BytesMapBitmap` + ## 2.7.1 * Undeprecates `BitmapDescriptor.fromAssetImage`. diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart index 2b79a03d194f..fe3f9d8a0f7e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart @@ -179,6 +179,7 @@ class BitmapDescriptor { /// and scales the images to the right resolution depending on the dpi. /// Set `mipmaps` to false to load the exact dpi version of the image, /// `mipmap` is true by default. + @Deprecated('Use BitmapDescriptor.asset method instead.') static Future fromAssetImage( ImageConfiguration configuration, String assetName, { @@ -217,6 +218,7 @@ class BitmapDescriptor { /// bitmap, regardless of the actual resolution of the encoded PNG. /// This helps the browser to render High-DPI images at the correct size. /// `size` is not required (and ignored, if passed) in other platforms. + @Deprecated('Use BitmapDescriptor.bytes method instead.') static BitmapDescriptor fromBytes(Uint8List byteData, {Size? size}) { assert(byteData.isNotEmpty, 'Cannot create BitmapDescriptor with empty byteData'); diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml index 6f0f5d54942d..e9d672efb1c2 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/google_maps_f issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.7.1 +version: 2.8.0 environment: sdk: ^3.2.0