Skip to content

Commit 8c440f0

Browse files
authored
Merge pull request #10 from ArcGIS/kmueller-gis/stop_location_data_source
Stop location data source in dispose method
2 parents de90acd + bd40f2e commit 8c440f0

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/src/samples/show_location_sample.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class ShowLocationSampleState extends State<ShowLocationSample> {
4141

4242
@override
4343
void dispose() {
44+
_locationDataSource.stop();
4445
_locationSubscription?.cancel();
4546
_statusSubscription?.cancel();
4647

lib/src/samples/simulate_location_sample.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,9 @@ class SimulateLocationSampleState extends State<SimulateLocationSample> {
4242

4343
@override
4444
void dispose() {
45+
_locationDataSource.stop();
4546
_locationSubscription?.cancel();
4647
_statusSubscription?.cancel();
47-
if (_locationDataSource.status == LocationDataSourceStatus.starting ||
48-
_locationDataSource.status == LocationDataSourceStatus.started) {
49-
_locationDataSource.stop();
50-
}
5148

5249
super.dispose();
5350
}

0 commit comments

Comments
 (0)