Processed requested changes
MODIFY
geolocator_platform_interface/CHANGELOG.md
geolocator_platform_interface/CHANGELOG.md
## 2.2.1
-- Documentation `getLocationAccuracy()` method clarified
-- On Android devices, `getLocationAccuracy()` now returns a LocationAccuracyStatus.unknown value
+- Documentation `getLocationAccuracy()` method clarified.
+- Extended the `LocationAccuracyStatus` enum with a `LocationAccuracyStatus.unknown` value, which can be used by platforms that don't support location accuracy features.
## 2.2.0

MODIFY
geolocator_platform_interface/lib/src/geolocator_platform_interface.dart
geolocator_platform_interface/lib/src/geolocator_platform_interface.dart
@@ -165,8 +165,8 @@ abstract class GeolocatorPlatform extends PlatformInterface {
/// [LocationAccuracyStatus.reduced] will be returned, if the user gave
/// permission for precise/full accuracy location, [LocationAccuracyStatus.precise]
/// will be returned.
- /// When executing the method on Android device's,
- /// [LocationAccuracyStatus.unknown] will be returned.
+ /// When executing the method on platforms that don't support location
+ /// accuracy features [LocationAccuracyStatus.unknown] should be returned.
Future<LocationAccuracyStatus> getLocationAccuracy() async {
throw UnimplementedError('getLocationAccuracy() has not been implemented.');
}

MODIFY
geolocator_platform_interface/lib/src/implementations/method_channel_geolocator.dart
geolocator_platform_interface/lib/src/implementations/method_channel_geolocator.dart
@@ -93,9 +93,6 @@ class MethodChannelGeolocator extends GeolocatorPlatform {
@override
Future<LocationAccuracyStatus> getLocationAccuracy() async {
- if (defaultTargetPlatform == TargetPlatform.iOS) {
- return LocationAccuracyStatus.unknown;
- }
final int accuracy =
await _methodChannel.invokeMethod('getLocationAccuracy');
return LocationAccuracyStatus.values[accuracy];

MODIFY
geolocator_platform_interface/test/src/implementations/method_channel_geolocator_test.dart
geolocator_platform_interface/test/src/implementations/method_channel_geolocator_test.dart
@@ -153,7 +153,7 @@ void main() {
expect(locationAccuracy, LocationAccuracyStatus.reduced);
});
- test('Should receive reduced accuracy if Location Accuracy is reduced',
+ test('Should receive reduced accuracy if Location Accuracy is precise',
() async {
// Arrange
MethodChannelMock(
@@ -169,23 +169,6 @@ void main() {
// Assert
expect(locationAccuracy, LocationAccuracyStatus.precise);
});
-
- test('Should receive reduced accuracy if Location Accuracy is reduced',
- () async {
- // Arrange
- MethodChannelMock(
- channelName: 'flutter.baseflow.com/geolocator',
- method: 'getLocationAccuracy',
- result: 2,
- );
-
- // Act
- final locationAccuracy =
- await MethodChannelGeolocator().getLocationAccuracy();
-
- // Assert
- expect(locationAccuracy, LocationAccuracyStatus.unknown);
- });
});
group('requestPermission: When requesting for permission', () {

Processed requested changes