I tried to change path of the internal storage file but it could not happen. Then I tried copy that file to another location and delete it from first location. unfortunately, this also did not work.
Here is my error:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: FileSystemException: Cannot delete file, path = '/storage/emulated/0/DCIM/Screenshots/Screenshot_20230116-114448.jpg' (OS Error: No such file or directory, errno = 2)
If anyone have idea then it could be helpful. Thank You.
before accessing the storage ask for storage permission with the below code and also you can check this permission package https://pub.dev/packages/permission_handler. Don't forget to add permission in for android and iOS in their respective folder
and if you have any other doubt then you can ask it in comments.