Implementations issues fixed
MODIFY
geolocator_platform_interface/lib/src/implementations/method_channel_geolocator.dart
geolocator_platform_interface/lib/src/implementations/method_channel_geolocator.dart
@@ -135,14 +135,13 @@ class MethodChannelGeolocator extends GeolocatorPlatform {
forceAndroidLocationManager: forceAndroidLocationManager,
timeInterval: timeInterval,
);
-
if (_positionStream != null) {
return _positionStream!;
}
-
- var positionStream = _eventChannel.receiveBroadcastStream(
+ var originalStream = _eventChannel.receiveBroadcastStream(
locationOptions.toJson(),
);
+ var positionStream = _wrapStream(originalStream);
if (timeLimit != null) {
positionStream = positionStream.timeout(
@@ -157,8 +156,7 @@ class MethodChannelGeolocator extends GeolocatorPlatform {
},
);
}
-
- _positionStream = _wrapStream(positionStream)
+ _positionStream = positionStream
.map<Position>((dynamic element) =>
Position.fromMap(element.cast<String, dynamic>()))
.handleError(
@@ -167,11 +165,9 @@ class MethodChannelGeolocator extends GeolocatorPlatform {
if (error is PlatformException) {
_handlePlatformException(error);
}
-
throw error;
},
);
-
return _positionStream!;
}

Implementations issues fixed