flutter-geolocator
flutter-geolocator copied to clipboard
Fixed issue in geolocator_web [A value of type num cannot be assign t…
On the web, package was giving error : num cannot be assign to double so i just cast to double in the Constructor
List at least one fixed issue.
- Casting from num to double in the web
Pre-launch Checklist
- [ ] I made sure the project builds.
- [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [x] I updated
pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is does not need version changes. - [x] I updated
CHANGELOG.mdto add a description of the change. - [ ] I updated/added relevant documentation (doc comments with
///). - [x] I rebased onto
main. - [ ] I added new tests to check the change I am making, or this PR does not need tests.
- [x] I made sure all existing and new tests are passing.
- [ ] I ran
dart format .and committed any changes. - [ ] I ran
flutter analyzeand fixed any errors.
Dear @HKTareen,
Thanks for your fix. Is there an issue related to this PR?
Kind regards,
I can make an issue if there isn't for this as I also have this error.
../../../.pub-cache/hosted/pub.dev/geolocator_web-4.1.3/lib/src/utils.dart:12:22: Error: The argument type 'num' can't be assigned to the parameter type 'double'.
latitude: coords.latitude,
^
../../../.pub-cache/hosted/pub.dev/geolocator_web-4.1.3/lib/src/utils.dart:13:23: Error: The argument type 'num' can't be assigned to the parameter type 'double'.
longitude: coords.longitude,
^
../../../.pub-cache/hosted/pub.dev/geolocator_web-4.1.3/lib/src/utils.dart:15:31: Error: The argument type 'num' can't be assigned to the parameter type 'double'.
altitude: coords.altitude ?? 0.0,
^
../../../.pub-cache/hosted/pub.dev/geolocator_web-4.1.3/lib/src/utils.dart:16:47: Error: The argument type 'num' can't be assigned to the parameter type 'double'.
altitudeAccuracy: coords.altitudeAccuracy ?? 0.0,
^
../../../.pub-cache/hosted/pub.dev/geolocator_web-4.1.3/lib/src/utils.dart:18:29: Error: The argument type 'num' can't be assigned to the parameter type 'double'.
heading: coords.heading ?? 0.0,
^
../../../.pub-cache/hosted/pub.dev/geolocator_web-4.1.3/lib/src/utils.dart:21:25: Error: The argument type 'num' can't be assigned to the parameter type 'double'.
speed: coords.speed ?? 0.0,