Skip to content

Correct definition of == operator #709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
markj opened this issue Apr 12, 2021 · 1 comment
Closed
2 tasks done

Correct definition of == operator #709

markj opened this issue Apr 12, 2021 · 1 comment

Comments

@markj
Copy link

markj commented Apr 12, 2021

🏗 Enhancement Proposal

When using Geolocator with null safety and mockito you receive an analyzer error due to the incorrect definition of the == operator in Position.

  error • 'Object.==' ('bool Function(Object)') isn't a valid concrete implementation of 'Position.==' ('bool Function(dynamic)')  test/unit-tests/geolocation/geolocation_service_test.mocks.dart:16:7 • invalid_implementation_override

See - https://api.dart.dev/stable/2.12.2/dart-core/Object/operator_equals.html which shows the operator should receive an Object not dynamic.

Pitch

By updating the definition it will remove unnecessary warnings from analyzer tools when mocking geolocator.

i.e.

  bool operator ==(dynamic o) {

Needs to become

  bool operator ==(Object o) {

Platforms affected (mark all that apply)

  • 📱 iOS
  • 🤖 Android
@mvanbeusekom
Copy link
Member

This issue is resolved with PR #710 and released as version 7.0.2 of the Geolocator. Thank you for reporting the issue and providing a fix!

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

No branches or pull requests

2 participants