File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -595,9 +595,14 @@ class DefaultAssetPickerViewerBuilderDelegate
595
595
'Viewer provider must not be null'
596
596
'when the special type is not WeChat moment.' ,
597
597
);
598
+ // Check whether any videos in selected assets.
599
+ final bool _hasVideos = selectedAssets? .any (
600
+ (AssetEntity e) => e.type == AssetType .video,
601
+ ) ??
602
+ false ;
598
603
return MaterialButton (
599
604
minWidth: () {
600
- if (isWeChatMoment) {
605
+ if (isWeChatMoment && _hasVideos ) {
601
606
return 48.0 ;
602
607
}
603
608
return provider! .isSelectedNotEmpty ? 48.0 : 20.0 ;
@@ -610,7 +615,7 @@ class DefaultAssetPickerViewerBuilderDelegate
610
615
),
611
616
child: Text (
612
617
() {
613
- if (isWeChatMoment) {
618
+ if (isWeChatMoment && _hasVideos ) {
614
619
return Constants .textDelegate.confirm;
615
620
}
616
621
if (provider! .isSelectedNotEmpty) {
@@ -628,7 +633,7 @@ class DefaultAssetPickerViewerBuilderDelegate
628
633
),
629
634
),
630
635
onPressed: () {
631
- if (isWeChatMoment) {
636
+ if (isWeChatMoment && _hasVideos ) {
632
637
Navigator .of (context).pop (< AssetEntity > [currentAsset]);
633
638
return ;
634
639
}
You can’t perform that action at this time.
0 commit comments