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

added saveFile action #1799

Merged
merged 6 commits into from
Jan 7, 2025
Merged

added saveFile action #1799

merged 6 commits into from
Jan 7, 2025

Conversation

mehsaandev
Copy link
Contributor

No description provided.

@kmahmood74
Copy link
Collaborator

@mehsaandev no reviewer? is this draft?

@mehsaandev mehsaandev linked an issue Jan 5, 2025 that may be closed by this pull request
@mehsaandev
Copy link
Contributor Author

Yes this is draft, finishing it.

@mehsaandev mehsaandev requested a review from snehmehta January 6, 2025 07:48
@mehsaandev mehsaandev marked this pull request as ready for review January 6, 2025 07:53
}
} else if (source != null) {
// If blobData is not available, check for source (network URL)
Dio dio = Dio();
Copy link
Collaborator

Choose a reason for hiding this comment

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

why use dio when we have http package for network handling?


/// Notify the Android media store about the new file
Future<void> _notifyFileSystem(String filePath) async {
try {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Running a process is not recommended if possible please find another way


Future<void> _saveImageToDCIM(String fileName, Uint8List fileBytes) async {
try {
final result = await ImageGallerySaver.saveImage(
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is reason for using ImageGallerySaver, cause adding in android would be placing file on that location. is it ios?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I just place the file in that location it doesn't register the image in the gallery, using ImageGallerySaver it automatically registers the image to the gallery in the respective platforms I.e. Android and IOS

@kmahmood74
Copy link
Collaborator

kmahmood74 commented Jan 6, 2025 via email

@mehsaandev mehsaandev requested a review from snehmehta January 6, 2025 13:19
@mehsaandev
Copy link
Contributor Author

mehsaandev commented Jan 6, 2025

I've made the required changes.

  • For ImageGallerySaver It registers the file to gallery so that'swhy I added this, only saving the file to Pictures path won't register it to gallery
  • Removed Document registry, saving the document is sufficient.
  • Replaced Dio with HTTP

@snehmehta PTAL

@mehsaandev mehsaandev merged commit d6a7f4c into main Jan 7, 2025
2 checks passed
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.

require a new action to save images and documents in device
3 participants