Flutter WeChat Camera Picker

pub package pub package GitHub stars GitHub forks Build status CodeFactor GitHub license FlutterCandies

Language: English | 中文简体

A camera picker which is an extension for wechat_assets_picker. Based on camera for camera functions and photo_manager for asset implementation.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Alex Li

💻 🎨 📖 💡 🤔 🚧 💬 👀


💡 🤔




💻 🤔


💻 🤔

This project follows the all-contributors specification. Contributions of any kind welcome!

Category 🗂

Features ✨

  • x 🔐 Non-nullable by default
  • x 💚 99% similar to WeChat style
  • x 📷 Picture taking support
    • x ☀️ Exposure adjust support
    • x 🔍️ Scale with pinch support
  • x 🎥 Video recording support
    • x ⏱ Duration limitation support
    • x 🔍 Scale when recording support
  • x 🖾 Foreground custom widget builder support

Screenshots 📸

Preparing for use 🍭

Version constraints

Flutter SDK: >=2.0.0 .


Usage 📖

NameTypeDescriptionDefault Value
enableRecordingboolWhether the picker can record video.false
onlyEnableRecordingboolWhether the picker can only record video. Only available when enableRecording is true.false
enableAudioboolWhether Whether the picker should record audio. Only available with recording.true
enableSetExposureboolWhether users can set the exposure point by tapping.true
enableExposureControlOnPointboolWhether users can adjust exposure according to the set point.true
enablePinchToZoomboolWhether users can zoom the camera by pinch.true
enablePullToZoomInRecordboolWhether users can zoom by pulling up when recording video.true
shouldDeletePreviewFileboolWhether the preview file will be delete when pop.false
shouldLockPortraitboolWhether the orientation should be set to portraittrue
maximumRecordingDurationDurationThe maximum duration of the video recording process.const Duration(seconds: 15)
themeThemeData?Theme data for the picker.CameraPicker.themeData(C.themeColor)
textDelegateCameraPickerTextDelegate?Text delegate that controls text in widgets.DefaultCameraPickerTextDelegate
resolutionPresetResolutionPresetPresent resolution for the camera.ResolutionPreset.max
cameraQuarterTurnsintThe number of clockwise quarter turns the camera view should be rotated.0
imageFormatGroupImageFormatGroupDescribes the output of the raw image format.ImageFormatGroup.jpeg
foregroundBuilderWidget Function(CameraValue)?The foreground widget builder which will cover the whole camera preview.null

Simple usage

final AssetEntity? entity = await CameraPicker.pickFromCamera(context);

Frequent asked question 💭

Why there are over-scaled issue when shouldLockPortrait set to false?

Currently the rotate synchronization is not supported. The DeviceOrientation from the CameraValue is different from the one comes from flutter when the user is rotating devices. The preview widget is synchronized when both orientation is the same.