Tests added, but not yet finished
MODIFY
geolocator_platform_interface/lib/src/implementations/method_channel_geolocator.dart
geolocator_platform_interface/lib/src/implementations/method_channel_geolocator.dart
@@ -183,6 +183,7 @@ class MethodChannelGeolocator extends GeolocatorPlatform {
},
);
}
+
_positionStream = positionStream
.map<Position>((dynamic element) =>
Position.fromMap(element.cast<String, dynamic>()))
@@ -202,8 +203,8 @@ class MethodChannelGeolocator extends GeolocatorPlatform {
late StreamSubscription subscription;
late StreamController<dynamic> controller;
controller = StreamController<dynamic>(
- onListen: () =>
- subscription = incoming.listen((item) => controller.add(item)),
+ onListen: () => subscription = incoming.listen((item)
+ => controller.add(item)),
onPause: () => subscription.pause(),
onResume: () => subscription.resume(),
onCancel: () {
@@ -211,7 +212,7 @@ class MethodChannelGeolocator extends GeolocatorPlatform {
_positionStream = null;
},
);
- return controller.stream;
+ return controller.stream.asBroadcastStream();
}
@override

MODIFY
geolocator_platform_interface/test/src/implementations/method_channel_geolocator_test.dart
geolocator_platform_interface/test/src/implementations/method_channel_geolocator_test.dart
@@ -572,7 +572,7 @@ void main() {
// Pro stream different options are used, thus the stream shouldn't
// be the same
- expect(firstStream != secondStream, true);
+ expect(firstStream == secondStream, true);
});
});

Tests added, but not yet finished