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: delete assets permanently deleted instead of trash in android R #959

Merged
merged 2 commits into from
Oct 13, 2023
Merged

fix: delete assets permanently deleted instead of trash in android R #959

merged 2 commits into from
Oct 13, 2023

Conversation

shenlong-tanwen
Copy link
Contributor

Changes made

The current implementation of trashing the asset instead of deleting it in Android 30 and above feels inconsistent with the rest of the behavior of the API in older versions of Android and iOS where the asset is irrevocably deleted.

It is changed in this PR to have the same behavior of deleting the asset using MediaStore.createDeleteRequest which based on the documentation calls ContentResolver#delete similar to the handling used in older android versions

Possible improvements

A new method named trashAsset can be added as an feature which would trash the asset instead of deleting it in Android 30 and above along with a method to fetch such assets as well

@shenlong-tanwen
Copy link
Contributor Author

Fixed the Android CI failing due to the lack of namespace in the example app's build.gradle as well

@CaiJingLong
Copy link
Member

CaiJingLong commented Jul 30, 2023

I need to see the change on the emulator of different version, I will test this modification in the near future.


A new method named trashAsset can be added as an feature which would trash the asset instead of deleting it in Android 30 and above along with a method to fetch such assets as well

Introducing new dart api is really a good idea.

example/android/app/build.gradle Outdated Show resolved Hide resolved
@CaiJingLong CaiJingLong added this to the 2.8 milestone Aug 4, 2023
@CaiJingLong
Copy link
Member

This is a behavior change, although it does not involve breaking the API, but I will put it in the 2.8 version.

@CaiJingLong CaiJingLong merged commit 359796d into fluttercandies:main Oct 13, 2023
11 checks passed
@shenlong-tanwen shenlong-tanwen deleted the fix/android-30-permanent-delete branch October 13, 2023 06:26
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.

2 participants