-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Paste images from your clipboard in android #461
Conversation
@@ -12,7 +12,6 @@ | |||
#include <local_notifier/local_notifier_plugin.h> | |||
#include <pasteboard/pasteboard_plugin.h> | |||
#include <permission_handler_windows/permission_handler_windows_plugin.h> | |||
#include <sentry_flutter/sentry_flutter_plugin.h> |
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.
how come you are removing this here?
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.
Is this OK to remove here? We'd like to have sentry on windows as well.
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.
These changes were automatically made during some builds , i'll add these lines back , as i did in my previous commit.
@krrish-sehgal I have one question and can you please check the checks. |
I'll update the deprecated upload-artifact from .github/workflows/build-flutter.yaml for the checks, and since flutter automatically made changes for the sentry plugin , I'll see to it , if i dont find a plausible cause , i'll revert the changes in the windows folder. |
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
Fixes #231
Description
This PR makes use of a method channel to connect the native Android code with Flutter, enabling the retrieval of images from the clipboard. The key changes include:
Method Channel Implementation:
A method channel named
clipboard_image_channel
is created in the native Android code for communication with Flutter. This channel handles method calls to check the clipboard for images.Base64 Encoding:
The image retrieved from the clipboard is converted to a Base64 string before being sent to the Flutter code. This allows for easier handling of the image data in Dart.
Image Storage:
The decoded Base64 image string is stored in the same list that is used to display images selected from the gallery, while maintaining the total count of allowed images, which is capped at 5. This ensures a friendly UX of handling images from both the clipboard and the gallery.
No image in clipboard handling:
Shows a snackbar(with a theme used for snackbar before).
New Dependencies in android folder
The following dependencies are required for this change:
androidx.core:core-ktx:1.10.1
androidx.appcompat:appcompat:1.6.1
androidx.activity:activity-ktx:1.7.2
Key changes in android folder
Attached video demo of the fix
Screen.Recording.2024-10-29.at.7.04.11.PM.mov