-
Notifications
You must be signed in to change notification settings - Fork 16
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
added saveFile
action
#1799
Conversation
@mehsaandev no reviewer? is this draft? |
Yes this is draft, finishing it. |
} | ||
} else if (source != null) { | ||
// If blobData is not available, check for source (network URL) | ||
Dio dio = Dio(); |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Due to the urgency of this fix, I would suggest having a meeting to go
through the PR. We need these done today as the customer is waiting
…On Mon, Jan 6, 2025 at 4:49 AM Muhammad Ehsaan ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In modules/ensemble/lib/action/save_file.dart
<#1799 (comment)>:
> +
+ if (type == 'image') {
+ // Save images to Default Image Path
+ await _saveImageToDCIM(fileName!, fileBytes);
+ } else if (type == 'document') {
+ // Save documents to Documents folder
+ await _saveDocumentToDocumentsFolder(fileName!, fileBytes);
+ }
+ } catch (e) {
+ throw Exception('Failed to save file: $e');
+ }
+ }
+
+ Future<void> _saveImageToDCIM(String fileName, Uint8List fileBytes) async {
+ try {
+ final result = await ImageGallerySaver.saveImage(
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
—
Reply to this email directly, view it on GitHub
<#1799 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACMZUAVTSRUKVKFFYWXNST32JJ3W3AVCNFSM6AAAAABUN44GL6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKMZSGA3TMMRRG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I've made the required changes.
@snehmehta PTAL |
No description provided.