Baseflow / flutter-geolocator

Android and iOS Geolocation plugin for Flutter
https://baseflow.com/
MIT License
1.24k stars 645 forks source link

Use `ServiceStatus` enumeration from `permission_handler_platform_interface` #1154

Closed bambinoua closed 1 year ago

bambinoua commented 1 year ago

In my app I use both packages flutter_geolocator and permission_handler. Both packages reference on their own platform interfaces. Both interfaces contains ServiceStatus enumerations but they are different.

geolocator_platform_interface

/// Describes the current state of the location service on the native platform.
enum ServiceStatus {
  /// Indicates that the location service on the native platform is disabled.
  disabled,

  /// Indicates that the location service on the native platform is enabled.
  enabled,
}

permission_handler_platform_interface

/// Defines the different states a service can be in.
enum ServiceStatus {
  /// The service for the permission is disabled.
  disabled,

  /// The service for the permission is enabled.
  enabled,

  /// The permission does not have an associated service on the current
  /// platform.
  notApplicable,
}

Is is possible to use in package flutter_geolocator the ServiceStatus enumeration from permission_handler_platform_interface? Otherwise it is a bit confusing what ServiceStatus should be used.

JeroenWeener commented 1 year ago

Hi @bambinoua! Thank you for filling in the issue template.

Both plugins make use of their own implementation of ServiceStatus, as we do not want cross dependencies between the two plugins.

Could you provide me with a code example of what you are trying to achieve and where having two types of ServiceStatuses gets confusing? We assume classes would not reference both. Note that you can get location permissions from geolocator, not needing permission_handler.

github-actions[bot] commented 1 year ago

Without additional information, we are unfortunately not able to resolve this issue. Therefore, we reluctantly closed this issue for now. If you run into this issue later, feel free to file a new issue with a reference to this issue. Add a description of detailed steps to reproduce, expected and current behaviour, logs and the output of 'flutter doctor -v'. Thanks for your contribution.