Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomPickerLocation crashes if closed within 2 seconds after movement #576

Open
naysayer0 opened this issue Dec 5, 2024 · 1 comment
Open

Comments

@naysayer0
Copy link

naysayer0 commented Dec 5, 2024

If movements are made on the map and then widget is closed within 2 seconds, flutter crashes. If closed after 2 seconds, it works fine. This is the error I get:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: setState() called after dispose(): _AnimatedCenterMarker#40cb6(lifecycle state: defunct, not mounted)
Seems like the problem is raised from this part in osm_flutter/lib/src/widgets/picker_location.dart:

Timer createTimer() => Timer(const Duration(seconds: 2), () {
        setState(() {
          isMoving = false;
        });
      });

Disposing the controller did not help.

@naysayer0 naysayer0 changed the title CustomPickerLocation crashes if closed within 2 seconds after stopping movement CustomPickerLocation crashes if closed within 2 seconds after movement Dec 5, 2024
@liodali
Copy link
Owner

liodali commented Dec 6, 2024

i will do hotfix for that

liodali added a commit that referenced this issue Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants