zyzdev / flutter_street_view

10 stars 29 forks source link

Use `final` instead of `const Object()` as token for plugin_platform_interface #10

Closed collinjackson closed 2 years ago

collinjackson commented 2 years ago

This plugin should not use a const Object() as the platform interface token. There was an error in the documentation for plugin_platform_interface; see https://github.com/flutter/flutter/issues/96178.

The consequence, while unlikely in the short term, is that someone could develop an implementation using implements instead of extends, and everything would work initially but changes to the platform interface would break that implementation.

Recommended fix

Use a static final Object _token = Object(); instead of static const Object _token = Object(); in StreetViewFlutterPlatform.

Optional steps to prevent regressions.

This could break other implementations if there are any, so make sure to make it a major update to street_view_platform_interface. (Probably better to get it out of the way early while there aren't any other implementations.)

/cc @stuartmorgan

zyzdev commented 2 years ago

Bug fix.