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

Fix deselect all #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix deselect all #138

wants to merge 1 commit into from

Conversation

nt4f04uNd
Copy link
Owner

Fixes #98

Problem was on this line
https://github.com/nt4f04uNd/sweyer/blob/fix/98/playlist-deselect-all/lib/routes/home_route/search_route.dart#L619

Also, here this code couldn't pick up the proper runtimeType

I refactored both places for double-bulletproof + other place where we were checking runtimeType, instead of contentType

Opened an issue to remove all usages of runtimeType
#137

@nt4f04uNd nt4f04uNd requested a review from Abestanis July 13, 2024 13:03
lib/widgets/selection.dart Show resolved Hide resolved
@@ -2342,7 +2342,7 @@ class SelectAllSelectionAction<T extends Content> extends StatelessWidget {
final first = all.first;
assert(all.every((el) => el.runtimeType == first.runtimeType));
Copy link
Collaborator

@Abestanis Abestanis Jul 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert(all.every((el) => el.runtimeType == first.runtimeType));
assert(all.every((el) => el.type == first.type));

Let's not use the runtimeType here while we are at it.

@Abestanis
Copy link
Collaborator

Also, should we add a test for this to avoid regressing this in the future?

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

Successfully merging this pull request may close these issues.

Selection - playlists "deselect all" action doesn't work
2 participants