flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
162.19k stars 26.64k forks source link

[google_maps_flutter] Add compatibility with `js` 0.7.x #147492

Open alod2019 opened 2 weeks ago

alod2019 commented 2 weeks ago

Steps to reproduce

  1. just add both google_maps_flutter: ^2.6.1 and js: ^0.7.1 dependencies to pubspec.yaml
  2. run flutter pub get

Expected results

flutter pub get should pass

Actual results

flutter pub get fails with


Because google_maps_flutter >=2.6.0 depends on google_maps_flutter_web ^0.5.6 which depends on google_maps ^7.1.0, google_maps_flutter >=2.6.0 requires google_maps ^7.1.0.
And because google_maps >=6.3.0 depends on js ^0.6.3, google_maps_flutter >=2.6.0 requires js ^0.6.3.
So, because <a project> depends on both google_maps_flutter 2.6.1 and js 0.7.1, version solving failed.

You can try the following suggestion to make the pubspec resolve:
* Consider downgrading your constraint on google_maps_flutter: flutter pub add google_maps_flutter:^2.2.8```

### Code sample

no code required

### Screenshots or Video

_No response_

### Logs

_No response_

### Flutter Doctor output

Doesn't matter, it's pure dependecies related issue
darshankawar commented 2 weeks ago

If we add js package through the command flutter pub add js, it takes 0.6.7 version of the plugin with which the said behavior doesn't occur. If we update or manually add specific latest version of the plugin js: 0.7.1, then it gives the reported log.

Because google_maps_flutter >=2.6.0 depends on google_maps_flutter_web ^0.5.6 which depends on google_maps ^7.1.0, google_maps_flutter >=2.6.0 requires google_maps ^7.1.0.
Because google_maps 7.1.0 depends on js ^0.6.3 and no versions of google_maps match >7.1.0 <8.0.0, google_maps ^7.1.0 requires js ^0.6.3.
Thus, google_maps_flutter >=2.6.0 requires js ^0.6.3.
So, because app_foo_stable depends on both google_maps_flutter ^2.6.0 and js ^0.7.1, version solving failed.

You can try one of the following suggestions to make the pubspec resolve:
* Consider downgrading your constraint on google_maps_flutter: flutter pub add google_maps_flutter:^2.2.8
* Consider downgrading your constraint on js: flutter pub add js:^0.6.7
stuartmorgan commented 2 weeks ago

The underlying issue here is that the google_maps package that google_maps_flutter_web depends on hasn't been updated to allow js 0.7.x.

/cc @a14n I'm not sure if that would be a simple change, or there are non-trivial breaking changes in js.