Flutter WeChat Camera Picker
A camera picker based on WeChat's UI which is a separate runnable extension to
wechat_assets_picker_plus.
The package based on camera
for camera functions
and photo_manager
for asset implementation.
π· Screenshots
![]() |
![]() |
![]() |
![]() |
![]() |
---|
Features β¨
- β»οΈ Fully implementable with
State
s override - π 99% similar to WeChat style
- π· Picture taking support
- π₯ Video recording support
- β± Duration limitation support
- π Scale when recording support
- βοΈ Exposure adjust support
- ποΈ Scale with pinch support
- π± i18n support
- βͺ RTL language support
- π Fully customizable theme
- πΎ Foreground custom widget builder support
- πΉοΈ Intercept saving with custom process
π¦ Installation
Add the package to your pubspec.yaml
:
dependencies:
wechat_camera_picker_plus: ^latest_version
dependencies:
flutter pub get
Setup
Android 13 (API 33) permissions
If you don't need to take photos or videos, consider removing relevant permission in your apps, more specifically:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.your.app">
<!-- Add this if you need to take photos. -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<!-- Add this if you need to take videos. -->
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
</manifest>
π Usage
Import the package:
import 'package:wechat_camera_picker_plus/wechat_camera_picker_plus.dart';
Usage π
Record Video:
final entity = await CameraPicker.pickFromCamera(
Get.context!,
pickerConfig: CameraPickerConfig(
enableRecording: true,
onlyEnableRecording: true,
resolutionPreset: ResolutionPreset.high,
maximumRecordingDuration: const Duration(seconds: 60),
minimumRecordingDuration: const Duration(seconds: 7),
enableTapRecording: true,
permissionRequestOption: PermissionRequestOption(
androidPermission:
AndroidPermission(type: RequestType.all, mediaLocation: true),
),
textDelegate: EnglishCameraPickerTextDelegate(),
onMinimumRecordDurationNotMet: () {
'Minimum recording duration is 7 seconds'.errorToast();
},
),
);
final file = await entity?.file;
Take Picture:
final entity = await CameraPicker.pickFromCamera(
Get.context!,
pickerConfig: CameraPickerConfig(
enableRecording: false,
resolutionPreset: ResolutionPreset.high,
permissionRequestOption: PermissionRequestOption(
androidPermission:
AndroidPermission(type: RequestType.all, mediaLocation: true),
),
textDelegate: EnglishCameraPickerTextDelegate(),
),
);
final file = await entity?.file;
π Frequently asked question
Why the orientation behavior is strange on iOS? Currently, the preview is not correctly synced on the iOS. You can find more details in this issue: https://github.com/flutter/flutter/issues/89216 . Other than that, please submit issues to describe your question.
π License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributors β¨
Thank goes to these wonderful people (emoji key):
Alex Li π» π¨ π π‘ π€ π§ π¬ π |
Caijinglong π‘ π€ |
Lael π |
mjl0602 π» π€ |
AliasWang π» π€ |
leftcoding π |
Luong The Vinh π» |
luomo-pro οΈοΈοΈοΈβΏοΈ π |
LeonardoZhu π» |
This project follows the all-contributors specification. Contributions of any kind welcome!
π Author
Made with β€οΈ by Deepak.