Skip to content

Commit 2141a43

Browse files
authored
[google_maps_flutter_platform_interface] Fix PinConfig code sample (flutter#12259)
The second `PinConfig` sample in the `BitmapDescriptor` docs (`bitmap.dart:1009`) doesn't compile, for two reasons: 1. **Unbalanced parens** — the block opens `PinConfig(`, `BitmapGlyph(` and `BitmapDescriptor.asset(` but only closes two of them. (The sibling `TextGlyph` sample directly above closes correctly.) 2. **Missing `await`** — `BitmapDescriptor.asset` is declared `static Future<AssetMapBitmap> asset(...)` (line 278), while `BitmapGlyph.bitmap` is `final BitmapDescriptor bitmap;` (line 1106), so a bare `BitmapDescriptor.asset(...)` can't be assigned to it. The repo's own examples use the awaited form — e.g. `google_maps_flutter_web/example/latest/integration_test/advanced_markers_test.dart:422`: ```dart bitmap: await BitmapDescriptor.asset( ``` The sample now mirrors that. Paren balance goes from 5 open / 4 close to 5 / 5. Doc comment only; bumped to 2.16.1 with a CHANGELOG entry per the versioning policy — happy to switch to `## NEXT` if that's preferred for a docs-only change.
1 parent fdd7d39 commit 2141a43

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.16.1
2+
3+
* Fixes the `PinConfig` code sample in the `BitmapDescriptor` documentation.
4+
15
## 2.16.0
26

37
* Adds support for `mapTypeControlEnabled`, `fullscreenControlEnabled`, and `streetViewControlEnabled` for web.

‎packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/types/bitmap.dart‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,10 +1009,11 @@ class BytesMapBitmap extends MapBitmap {
10091009
/// ```dart
10101010
/// PinConfig(
10111011
/// glyph: BitmapGlyph(
1012-
/// bitmap: BitmapDescriptor.asset(
1012+
/// bitmap: await BitmapDescriptor.asset(
10131013
/// ImageConfiguration(size: Size(12, 12)),
1014-
/// 'assets/cat.png'
1015-
/// )
1014+
/// 'assets/cat.png',
1015+
/// ),
1016+
/// ),
10161017
/// )
10171018
/// ```
10181019
///

‎packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/google_maps_f
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
55
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
66
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
7-
version: 2.16.0
7+
version: 2.16.1
88

99
environment:
1010
sdk: ^3.10.0

0 commit comments

Comments
 (0)