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 disposed provider throwing error when fetching assets #493

Merged
merged 3 commits into from
Sep 27, 2023

Conversation

LeGoffMael
Copy link
Collaborator

Fix #492

@LeGoffMael LeGoffMael requested a review from AlexV525 September 13, 2023 08:13
Comment on lines +67 to +72
@override
void notifyListeners() {
if (_mounted) {
super.notifyListeners();
}
}
Copy link
Collaborator Author

@LeGoffMael LeGoffMael Sep 13, 2023

Choose a reason for hiding this comment

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

This part is actually optional since it is not needed to fix #492 issue.
However, notifyListeners() will throw an exception if the provider was disposed, so i thought it was still good to put a flag on it.

Copy link
Member

@AlexV525 AlexV525 left a comment

Choose a reason for hiding this comment

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

nits

lib/src/provider/asset_picker_provider.dart Outdated Show resolved Hide resolved
lib/src/provider/asset_picker_provider.dart Outdated Show resolved Hide resolved
Copy link
Member

@AlexV525 AlexV525 left a comment

Choose a reason for hiding this comment

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

LGTM

@LeGoffMael
Copy link
Collaborator Author

I there anything needed to merge this PR ? (my commits were not verified but it should now be fine in my next commits)

@AlexV525 AlexV525 merged commit ac9e622 into main Sep 27, 2023
4 checks passed
@AlexV525 AlexV525 deleted the fix/disposed-provider branch September 27, 2023 06:25
@AlexV525
Copy link
Member

I there anything needed to merge this PR ?

Nope. Just forgot to press the button. :)

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.

[BUG] Exception when closing the picker before it has had time to load the assets
2 participants