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

setState() called after dispose() #64

Open
Abdulvaliy opened this issue Aug 6, 2024 · 0 comments
Open

setState() called after dispose() #64

Abdulvaliy opened this issue Aug 6, 2024 · 0 comments

Comments

@Abdulvaliy
Copy link

I face the issue several times after using the package.

Screen Shot 2024-08-05 at 21 13 05

I think, in dropdown_search.dart file, at 375 line it must be checked if context is mounted before updating state (which is in "didChange" callback)

if (state.value != getSelectedItem) {
    WidgetsBinding.instance.addPostFrameCallback((_) {
        if (!context.mounted) return; // TODO (maybe) add this line of code
            state.didChange(getSelectedItem);
      });
}

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.3, on macOS 12.7.1 21G920 darwin-arm64
(Rosetta), locale en-UZ)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 14.2)
! Flutter recommends a minimum Xcode version of 15.
Download the latest version or update via the Mac App Store.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.2)
[✓] Connected device (4 available)
[✓] Network resources

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

1 participant