Skip to content

[google_maps_flutter] colorScheme property missing from MapConfiguration. No way to set dark mode with cloudMapId #176445

@MrAlek

Description

@MrAlek

What package does this bug report belong to?

google_maps_flutter

What target platforms are you seeing this bug on?

Web

Have you already upgraded your packages?

Yes

Dependency versions

pubspec.lock
  google_maps:
    dependency: transitive
    description:
      name: google_maps
      sha256: "4d6e199c561ca06792c964fa24b2bac7197bf4b401c2e1d23e345e5f9939f531"
      url: "https://pub.dev"
    source: hosted
    version: "8.1.1"
  google_maps_flutter:
    dependency: "direct main"
    description:
      name: google_maps_flutter
      sha256: c389e16fafc04b37a4105e0757ecb9d59806026cee72f408f1ba68811d01bfe6
      url: "https://pub.dev"
    source: hosted
    version: "2.13.1"
  google_maps_flutter_android:
    dependency: transitive
    description:
      name: google_maps_flutter_android
      sha256: a6c9d43f6a944ff4bae5c3deb34817970ac3d591dcd7f5bd2ea450ab9e9c514a
      url: "https://pub.dev"
    source: hosted
    version: "2.18.2"
  google_maps_flutter_ios:
    dependency: transitive
    description:
      name: google_maps_flutter_ios
      sha256: ca02463b19a9abc7d31fcaf22631d021d647107467f741b917a69fa26659fd75
      url: "https://pub.dev"
    source: hosted
    version: "2.15.5"
  google_maps_flutter_platform_interface:
    dependency: transitive
    description:
      name: google_maps_flutter_platform_interface
      sha256: f4b9b44f7b12a1f6707ffc79d082738e0b7e194bf728ee61d2b3cdf5fdf16081
      url: "https://pub.dev"
    source: hosted
    version: "2.14.0"
  google_maps_flutter_web:
    dependency: transitive
    description:
      name: google_maps_flutter_web
      sha256: "53e5dbf73ff04153acc55a038248706967c21d5b6ef6657a57fce2be73c2895a"
      url: "https://pub.dev"
    source: hosted
    version: "0.5.14+2"

Steps to reproduce

  1. Try to set light or dark mode by the Google Maps JS SDK colorScheme property when using a cloudMapId

Expected results

There is a colorScheme property, just like in the JS SDK and the dart_google_maps wrapper:

https://github.com/a14n/dart-google-maps/blob/1a598b0305f53a2af3ee1b50d6f9e785f5fa2fb9/lib/src/generated/map/map_options.dart#L24

Actual results

There is no colorScheme property. Thus, maps always default to light mode.

Code sample

Code sample
GoogleMap(
          cloudMapId: "7c22373521b2087b",
          // no such property
          colorScheme:
              MediaQuery.of(context).platformBrightness == Brightness.light
                  ? ColorScheme.Light
                  : ColorScheme.Dark,
          // Style property is ignored when using `cloudMapId`
          style:
              MediaQuery.of(context).platformBrightness == Brightness.light
                  ? _lightMapStyle
                  : _darkMapStyle,
        ),

Screenshots or Videos

No response

Logs

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.35.3, on macOS 26.0.1 25A362 darwin-arm64, locale sv-SE)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0-rc4)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 26.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] VS Code (version 1.102.2)
[✓] Connected device (3 available)
[✓] Network resources

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: mapsGoogle Maps pluginpackageflutter/packages repository. See also p: labels.platform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions