-
-
Notifications
You must be signed in to change notification settings - Fork 461
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
✨ Ability to disable preview of assets using flag (showPreview) #102
Conversation
Thanks for the PR. Could you provide some screen records about those apps you mentioned? Also since this package mainly aims to cover the interaction like the WeChat, originally it's allowed to preview. I do think it's worth to integrate, just need some verification. |
See the following screen recordings: As you can see, there is no preview available only after the image is selected. Then the user can edit the picture (crop/paint/etc...). Next screen recording is to demontrate the behavior of wechat asset picker when calling it with showPreview = false (the non default behavior): download I hope you like it! Yaniv |
Please let me know if you need more information/clarifications! |
Thanks for these videos. From the video of WhatsApp, I do saw you entered the preview without made the asset selected. Let me know if I didn't get it right. And the same thing also happened in the MegaTok video. But the recording of this package seems to be clear that what flutter_wechat_assets_picker/lib/src/delegates/asset_picker_builder_delegate.dart Lines 455 to 464 in c8895b5
You may want to walk through the special mode to see how it aligns the behavior with WeChat Moment. |
Hi, See my comments inlined.
Thats is incorrect. I understand the video can be misleading. WhatsUp opens the gallery in single mode, any click on any image selects it and allows you to crop/paint/.. over it. You may then send it or click the +, to reopen the gallery (this time in multi mode), add more images and click done to have them selected. Same thing happens for MegaTok.
You are correct. The new flag showPreview broke the special behavior of the the WeChat Moment.
What do you think? |
Another alternative, is to override (showPreview = true) here, just like you override requestType provided: flutter_wechat_assets_picker/lib/src/widget/asset_picker.dart Lines 64 to 66 in c8895b5
|
I'd prefer |
Done, code refactored (SpecialPickerType.disablePreview). |
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.
Didn't finish the review since the rest part is quite a mass, I'll run it locally one I have time.
Co-authored-by: Alex Li <[email protected]>
You can apply suggestions on the GitHub without manually update it :) |
…erType.noPreview and added documentation
…ickerType.noPreview)
Yes, I know, but I wanted to change the English text. wo de yingwen fei chang hao, keshi wo de zhongwen bu hao ;-) |
…ass to DefaultAssetPickerBuilderDelegate
Co-authored-by: Alex Li <[email protected]>
Co-authored-by: Alex Li <[email protected]>
Co-authored-by: Alex Li <[email protected]>
Co-authored-by: Alex Li <[email protected]>
Remember to format the file once you finish your changes. |
…ew as bool get isPreviewEnabled
Line length you are using? 80? |
Yep. Some comments might overflow a bit, just ignore them. |
/// Whether the preview of assets is enabled.
/// 资源的预览是否启用
bool get isPreviewEnabled => specialPickerType != SpecialPickerType.noPreview; |
Those are already suggested at here: #102 (comment) |
Co-authored-by: Alex Li <[email protected]>
Tough code review, highly appreciated! |
That's why we've got an A+ at code factor. 😄 |
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.
LGTM. And thanks for this solid improvement. 👍
My pleasure! |
Hi,
I have added a new flag called showPreview to AssetPicker.pickAssets.
Default behavior (default value of showPreview parameter is true) is identical to the behavior so far: if you click an asset, you will get a preview of it. If you click the small circle, you select the asset.
But if you provide showPreview with false, there is no option to show preview. Instead, click on an assert will either add it to selection (multi assets mode) or select it (single assets more).
That behavior is closer to "mainstream" application which have an image picker integrated (Facebook, Whatsapp, Instgram, Megatok, etc..).
I hope you will find this PR interesting and worthy to integrate soon.
Thank you,
Yaniv