Skip to content

Commit

Permalink
close timer for picker location #576
Browse files Browse the repository at this point in the history
  • Loading branch information
liodali committed Dec 7, 2024
1 parent b559e28 commit 3fd07a5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/src/widgets/picker_location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class AnimatedCenterMarker extends StatefulWidget {
class _AnimatedCenterMarker extends State<AnimatedCenterMarker> {
late GeoPoint? _center = widget.center;
bool isMoving = false;
Timer? timer;
Timer? timer;

Timer createTimer() => Timer(const Duration(seconds: 2), () {
setState(() {
Expand Down Expand Up @@ -188,6 +188,12 @@ class _AnimatedCenterMarker extends State<AnimatedCenterMarker> {
});
}

@override
void dispose() {
timer?.cancel();
super.dispose();
}

@override
Widget build(BuildContext context) {
return Stack(
Expand Down

0 comments on commit 3fd07a5

Please sign in to comment.