Skip to content

Commit

Permalink
Change late to nullable in flyer and postermap
Browse files Browse the repository at this point in the history
  • Loading branch information
Y0ngg4n committed Nov 4, 2021
1 parent c57cb08 commit e1703db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/flyer/flyer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Flyer extends StatefulWidget {
class FlyerState extends State<Flyer> {
late CenterOnLocationUpdate _centerOnLocationUpdate;
late StreamController<double> _userPositionStreamController;
late StreamSubscription<Position> _currentPositionStreamSubscription;
StreamSubscription<Position>? _currentPositionStreamSubscription;
List<LatLng> path = [];
List<Marker> markers = [];
Position? lastPosition;
Expand All @@ -67,7 +67,8 @@ class FlyerState extends State<Flyer> {
@override
void dispose() {
super.dispose();
_currentPositionStreamSubscription.cancel();
if (_currentPositionStreamSubscription != null)
_currentPositionStreamSubscription!.cancel();
timer.cancel();
}

Expand Down Expand Up @@ -201,7 +202,8 @@ class FlyerState extends State<Flyer> {
}

_stopListener() {
_currentPositionStreamSubscription.cancel();
if (_currentPositionStreamSubscription != null)
_currentPositionStreamSubscription!.cancel();
Wakelock.disable();
}

Expand Down
1 change: 0 additions & 1 deletion lib/map/poster_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ class PosterMapViewState extends State<PosterMapView> {
if (_currentPositionStreamSubscription != null) return;
_currentPositionStreamSubscription =
Geolocator.getPositionStream().listen((position) {
print("New Position: " + position.toString());
setState(() {
if (!searching)
widget
Expand Down

0 comments on commit e1703db

Please sign in to comment.