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

Example: filterExpansionData bug #118

Open
johnareid54 opened this issue Aug 29, 2024 · 3 comments
Open

Example: filterExpansionData bug #118

johnareid54 opened this issue Aug 29, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@johnareid54
Copy link

johnareid54 commented Aug 29, 2024

Running the example code without any alternation causes it to hang when the search box is entered. The code gets to line 232 filterExpansionData.

Got this error:

════════ Exception caught by foundation library ════════════════════════════════
'package:flutter/src/material/expansion_tile.dart': Failed assertion: line 77 pos 12: '_state != null': is not true.
════════════════════════════════════════════════════════════════════════════════

Sorry I can't give you much detail, normally vscode would show the issue in the debug console, but it just seems to hang. I am running on a m1 mac, macos.

[✓] Flutter (Channel stable, 3.24.0, on macOS 14.6.1 23G93 darwin-arm64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.92.2)

@koukibadr koukibadr self-assigned this Sep 1, 2024
@koukibadr koukibadr added the bug Something isn't working label Sep 1, 2024
@koukibadr
Copy link
Owner

@johnareid54 thanks for your feedback, indeed I've found the bug once fixed I'll let you know

@johnareid54
Copy link
Author

I believe the issue that the error is being caused because the listView does not know the data items until the header is expanded.
One solution might be to filter the data before submitting it to the listView and show records with fake data headers - after all if a search is being called the user would want to see all matching records.

@koukibadr
Copy link
Owner

@johnareid54 the issue has been fixed in the latest version check it out
the error is due to the expansion controller list when the data is filtered some of the controllers not visible so using .expand() on them will throw an exception

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants