Skip to content

Update flutter_google_street_view to support newer Dart and Flutter versions - #43

Open
AleksDoesCode wants to merge 2 commits into
zyzdev:masterfrom
The-CodeCave:master
Open

Update flutter_google_street_view to support newer Dart and Flutter versions#43
AleksDoesCode wants to merge 2 commits into
zyzdev:masterfrom
The-CodeCave:master

Conversation

@AleksDoesCode

Copy link
Copy Markdown

Dear Maintainers,

This pull request introduces necessary changes to ensure compatibility with newer Dart and Flutter versions. Specifically:

Why the changes were necessary:

  1. Deprecated API Usage: The street_view_platform_interface package relied on the hashValues and hashList methods, which are no longer supported in Dart versions >= 2.14.0. This caused build issues for users on newer Flutter and Dart SDK versions.
  2. Dependency Conflicts: To resolve the deprecated API issues, it was necessary to fork street_view_platform_interface and make the required adjustments.

Changes made:

  1. Replaced the usage of hashValues with Object.hash and hashList with Object.hashAll in the street_view_platform_interface package to conform to modern Dart APIs.
  2. Updated the flutter_google_street_view package to depend on the forked version of street_view_platform_interface to resolve compatibility issues temporarily.
  3. Flutter SDK Compatibility: The Flutter SDK constraints in the pubspec.yaml file had to be updated to ensure compatibility with the newer APIs. The updated environment constraints are now: ">=2.14.0 <3.0.0"

Important Note:
Before merging this pull request, the internal dependency on street_view_platform_interface in flutter_google_street_view must be updated to point back to the original street_view_platform_interface package from pub.dev instead of the forked version. This will ensure that the main package remains consistent with its upstream dependencies. Also remove the "publish_to: none" entry which I added to the pubspec.yaml, in order to build a working workaround.

I believe these changes will improve the package's compatibility with current Flutter and Dart ecosystems, while maintaining backward compatibility for supported SDK versions.

Thank you for considering this contribution. Please let me know if there are additional adjustments needed!

Best regards,
Aleks

@oelburk

oelburk commented Jan 22, 2025

Copy link
Copy Markdown

Any chance we can get this merged asap? Thanks! 😄

@AleksDoesCode

AleksDoesCode commented Jan 22, 2025

Copy link
Copy Markdown
Author

Any chance we can get this merged asap? Thanks! 😄

You can already use this fork by updating your pubspec.yaml to this:

flutter_google_street_view:
git:
url: https://github.com/The-CodeCave/flutter_street_view_cc_fork.git
path: flutter_google_street_view
ref: master
street_view_platform_interface:
git:
url: https://github.com/The-CodeCave/flutter_street_view_cc_fork.git
path: street_view_platform_interface
ref: master

@joshsutterfield

Copy link
Copy Markdown

I had no luck building this in my environment -- seem to be problems registering the plugin class. I tried both with the auxiliary reference to street_view_platform_interface, and leaving that out.

I'm able to build with another fork but I can't immediately see what it is about the plugin setup there that works better with my environment.

@EugeneFerry

Copy link
Copy Markdown

@AleksDoesCode I'm using your fork but app crashes when you select a location that does not have street view available. Is there something that I need to update?

@AleksDoesCode

Copy link
Copy Markdown
Author

@EugeneFerry this also happens to me. There is some google API you can call to check if street view is available for a specific location beforehand. I am not sure why the crash occurres and we just slapped this as a fix on it. If you find a better fix, feel free to submit a PR to my fork.

@AleksDoesCode

Copy link
Copy Markdown
Author

@EugeneFerry have a look at this workaround here: #39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants