flutter-permission-handler icon indicating copy to clipboard operation
flutter-permission-handler copied to clipboard

[Feature request]: use `null` in `Position` class variables to differentiate (un)available values

Open georgetian3 opened this issue 1 year ago • 1 comments

Is there already an issue requesting this feature?

Please select affected platform(s)

  • [X] Android
  • [X] iOS
  • [X] Windows

Use case

According to the comments of geolocator_platform_interface-4.2.2, the altitude, altitudeAccuracy, accuracy, heading, headingAccuracy, speed, speedAccuracy variables may not be available, in which case the value will be 0.

The problem is users cannot differentiate unavailable values from actual readings of 0's for those variables.

Proposal

Make all the above variables nullable, and use null as the value if the variable is unavailable. This is already implemented for the variable floor.

Specific requirements or considerations

No response

Additional information or context

No response

georgetian3 avatar Mar 11 '24 06:03 georgetian3

Dear @georgetian3,

Thanks for your request. I'll label this as an enhancement and will probably implement something similar during our planned refactor.

Kind regards,

TimHoogstrate avatar Mar 12 '24 09:03 TimHoogstrate