How to use CustomFilter.sql to filter android special mime_type. #927
-
Version2.6.0 PlatformsAndroid Device ModelGalaxy S22Ultra(Android 13) flutter infoDoctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.10, on macOS 12.6.1 21G217 darwin-arm, locale
zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] IntelliJ IDEA Community Edition (version 2022.3.3)
[✓] Connected device (3 available)
[✓] HTTP Host Availability How to reproduce?I use CustomFilter.sql to filter android special mime_type data, but face error. Is there have any solution? LogsDoctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.10, on macOS 12.6.1 21G217 darwin-arm, locale
zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] IntelliJ IDEA Community Edition (version 2022.3.3)
[✓] Connected device (3 available)
[✓] HTTP Host Availability Example code (optional)final List<AssetPathEntity> paths = await PhotoManager.getAssetPathList(
onlyAll: true,
type: RequestType.image,
filterOption: createFilterOption(),
);
PMFilter? createFilterOption() {
return CustomFilter.sql(
where: '${CustomColumns.android.mediaType} = "image/jpeg"',
);
} ContactNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
logs: |
Beta Was this translation helpful? Give feedback.
-
Have two questions:
So I think you maybe need Future<void> _reproduct() async {
PMFilter? createFilterOption() {
return CustomFilter.sql(
where: '''${CustomColumns.android.mimeType} = 'image/png' ''',
);
}
final assetCount = await PhotoManager.getAssetCount(
filterOption: createFilterOption(),
type: RequestType.all,
);
print('assets count: $assetCount');
} By the way, |
Beta Was this translation helpful? Give feedback.
Have two questions:
mediaType
has document comments, which represent video, image or audio.So I think you maybe need
mimeType
:By the way,
mimeType
just support android, you need to handle the logic of iOS by yourself.