-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
✨Add custom onPicked callback when asset entity is generated #268
Conversation
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.
The idea is good, I'd prefer onPickConfirmed
for better readability.
Co-authored-by: Alex Li <github@alexv525.com>
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.
Thanks for following up all suggestions!
@all-contributors Add @yujune for code |
I've put up a pull request to add @yujune! 🎉 |
Adds @yujune as a contributor for code. This was requested by AlexV525 [in this comment](#268 (comment)) [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Context
Currently, when a picture or video is taken using the camera, the AssetEntity is retrieved via:
This is achieved by calling
Navigator.of(context).pop(entity);
, which returns theAssetEntity
to the previous screen.However, this approach has a limitation when the
CameraPicker
widget is used in a scenario where it doesn't trigger a pop event, such as when the widget is part of a tab or a persistent page in a navigation stack. In these cases, there is no straightforward way to retrieve the capturedAssetEntity
.Changes
onPicked
callback that directly provides the generated AssetEntity without relying on theNavigator.of(context).pop(entity);
.