flutterlocation icon indicating copy to clipboard operation
flutterlocation copied to clipboard

LocationData latitude and longitude should not be nullable

Open danielgomezrico opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. The definition of the class is nullable on every field, at least latitude and longitude should not be nullable:

https://github.com/Lyokone/flutterlocation/blob/master/packages/location_platform_interface/lib/src/types.dart#L46-L50

Or Is there any use case for a nullable latitude/longitude?

Describe the solution you'd like Make those fields not nullable

Describe workarounds you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context It is not safe to just declare every possible field as null everywhere

danielgomezrico avatar Dec 20 '21 13:12 danielgomezrico

Can we know when these fields will be null?

2shrestha22 avatar Feb 14 '22 11:02 2shrestha22

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 16 '22 17:04 stale[bot]

@2shrestha22 to me that case should not exist, if a location exist then the lat,lng should exist too, looks like an issue migrating to nullable types or a bad class definition 🤓

danielgomezrico avatar Apr 18 '22 16:04 danielgomezrico