Changed accuracy definition exception to existing permission definition not found exception
DELETE
geolocator_platform_interface/lib/src/errors/accuracy_dictionary_not_found_exception.dart
-/// An exception thrown when the Temporary Accuracy request key is missing in
-/// the Info.plist. The exception is only thrown on iOS.
-class AccuracyDictionaryNotFoundException implements Exception {
- /// Constructs the [AccuracyDictionaryNotFoundException]
- const AccuracyDictionaryNotFoundException(this.message);
-
- /// A [message] describing more details about the missing Dictionary key.
- final String? message;
-
- @override
- String toString() {
- if (message == null || message == '') {
- return 'Temporary Full accuracy key or description: '
- 'NSLocationTemporaryUsageDescriptionDictionary is missing in the'
- ' Info.plist dictionary.';
- }
- return message!;
- }
-}

MODIFY
geolocator_platform_interface/lib/src/errors/errors.dart
geolocator_platform_interface/lib/src/errors/errors.dart
-export 'accuracy_dictionary_not_found_exception.dart';
export 'activity_missing_exception.dart';
export 'already_subscribed_exception.dart';
export 'approximate_location_not_supported_exception.dart';

MODIFY
geolocator_platform_interface/lib/src/implementations/method_channel_geolocator.dart
geolocator_platform_interface/lib/src/implementations/method_channel_geolocator.dart
@@ -262,8 +262,6 @@ class MethodChannelGeolocator extends GeolocatorPlatform {
throw PermissionRequestInProgressException(exception.message);
case 'LOCATION_UPDATE_FAILURE':
throw PositionUpdateException(exception.message);
- case 'ACCURACY_DICTIONARY_NOT_FOUND':
- throw AccuracyDictionaryNotFoundException(exception.message);
case 'PRECISE_ACCURACY_ENABLED':
throw PreciseAccuracyEnabledException(exception.message);
case 'APPROXIMATE_LOCATION_NOT_SUPPORTED':

MODIFY
geolocator_platform_interface/test/src/implementations/method_channel_geolocator_test.dart
geolocator_platform_interface/test/src/implementations/method_channel_geolocator_test.dart
@@ -194,35 +194,6 @@ void main() {
),
);
});
- test(
- 'Should receive an exception when the location accuracy definition'
- ' in the Info.plist is missing', () async {
- MethodChannelMock(
- channelName: 'flutter.baseflow.com/geolocator',
- method: 'requestTemporaryFullAccuracy',
- result: PlatformException(
- code: 'ACCURACY_DICTIONARY_NOT_FOUND',
- message: 'Accuracy definition missing.',
- details: null,
- ),
- );
-
- // Act
- final accuracyFuture =
- MethodChannelGeolocator().requestTemporaryFullAccuracy();
-
- // Assert
- expect(
- accuracyFuture,
- throwsA(
- isA<AccuracyDictionaryNotFoundException>().having(
- (e) => e.toString(),
- 'description',
- 'Accuracy definition missing.',
- ),
- ),
- );
- });
test('Should receive an exception when precise location is enabled',
() async {
MethodChannelMock(
@@ -279,36 +250,6 @@ void main() {
),
);
});
- test(
- 'Should receive an exception when the location accuracy definition'
- ' in the Info.plist is missing', () async {
- MethodChannelMock(
- channelName: 'flutter.baseflow.com/geolocator',
- method: 'requestTemporaryFullAccuracy',
- result: PlatformException(
- code: 'ACCURACY_DICTIONARY_NOT_FOUND',
- message: null,
- details: null,
- ),
- );
-
- // Act
- final accuracyFuture =
- MethodChannelGeolocator().requestTemporaryFullAccuracy();
-
- // Assert
- expect(
- accuracyFuture,
- throwsA(
- isA<AccuracyDictionaryNotFoundException>().having(
- (e) => e.toString(),
- '',
- 'Temporary Full accuracy key or description: '
- 'NSLocationTemporaryUsageDescriptionDictionary'
- ' is missing in the Info.plist dictionary.'),
- ),
- );
- });
});
group('getLocationAccuracy: When requesting the Location Accuracy Status',

Changed accuracy definition exception to existing permission definition not found exception