-
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨Add custom onPicked callback when asset entity is generated (#268)
### Context Currently, when a picture or video is taken using the camera, the AssetEntity is retrieved via: ``` final assetEntity = await pickFromCamera(context); ``` This is achieved by calling `Navigator.of(context).pop(entity);`, which returns the `AssetEntity` 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 captured `AssetEntity`. ### Changes - Introduced a custom `onPicked` callback that directly provides the generated AssetEntity without relying on the `Navigator.of(context).pop(entity);`. --------- Co-authored-by: yujune <yujune@feedme.cc> Co-authored-by: Alex Li <github@alexv525.com>
- Loading branch information
1 parent
91b2ab6
commit 77f32bc
Showing
4 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters