Skip to content

Commit 2569c17

Browse files
committed
🚸 Prevent video select in wechat moment mode for edge case
1 parent 262676c commit 2569c17

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/src/delegates/asset_picker_builder_delegate.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,14 @@ class DefaultAssetPickerBuilderDelegate
12081208
return Positioned.fill(
12091209
child: GestureDetector(
12101210
onTap: () async {
1211+
// While the special type is WeChat moment, picture and video cannot
1212+
// be selected at the same time. Video select should be banned if any
1213+
// picture is selected.
1214+
if (specialPickerType == SpecialPickerType.wechatMoment &&
1215+
asset.type == AssetType.video &&
1216+
provider.selectedAssets.isNotEmpty) {
1217+
return;
1218+
}
12111219
final List<AssetEntity>? result =
12121220
await AssetPickerViewer.pushToViewer(
12131221
context,

0 commit comments

Comments
 (0)