• Stars
    star
    335
  • Rank 121,735 (Top 3 %)
  • Language
    Dart
  • License
    Apache License 2.0
  • Created almost 4 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A camera picker (take photos and videos) for Flutter projects based on WeChat's UI. It's a standalone module of wechat_assets_picker yet it can be run separately.

Flutter WeChat Camera Picker

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

Language: English | 中文简体

A camera picker based on WeChat's UI which is a separate runnable extension to wechat_assets_picker. The package based on camera for camera functions and photo_manager for asset implementation.

Category 🗂

Features

  • ♻️ Fully implementable with States 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

Screenshots 📸

Preparing for use 🍭

Version constraints

Flutter SDK: >=2.8.0 .

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 📖

Simple usage

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

With configurations

Use CameraPickerConfig for more picking behaviors.

final AssetEntity? entity = await CameraPicker.pickFromCamera(
  context,
  pickerConfig: const CameraPickerConfig(),
);

Fields in CameraPickerConfig:

Name Type Description Default Value
enableRecording bool Whether the picker can record video. false
onlyEnableRecording bool Whether the picker can only record video. Only available when enableRecording is true . false
enableTapRecording bool Whether allow the record can start with single tap. Only available when enableRecording is true . false
enableAudio bool Whether Whether the picker should record audio. Only available with recording. true
enableSetExposure bool Whether users can set the exposure point by tapping. true
enableExposureControlOnPoint bool Whether users can adjust exposure according to the set point. true
enablePinchToZoom bool Whether users can zoom the camera by pinch. true
enablePullToZoomInRecord bool Whether users can zoom by pulling up when recording video. true
shouldDeletePreviewFile bool Whether the preview file will be delete when pop. false
shouldAutoPreviewVideo bool Whether the video should be played instantly in the preview. false
maximumRecordingDuration Duration? The maximum duration of the video recording process. const Duration(seconds: 15)
minimumRecordingDuration Duration The minimum duration of the video recording process. const Duration(seconds: 1)
theme ThemeData? Theme data for the picker. CameraPicker.themeData(wechatThemeColor)
textDelegate CameraPickerTextDelegate? Text delegate that controls text in widgets. CameraPickerTextDelegate
resolutionPreset ResolutionPreset Present resolution for the camera. ResolutionPreset.max
cameraQuarterTurns int The number of clockwise quarter turns the camera view should be rotated. 0
imageFormatGroup ImageFormatGroup Describes the output of the raw image format. ImageFormatGroup.unknown
preferredLensDirection CameraLensDirection Which lens direction is preferred when first using the camera. CameraLensDirection.back
lockCaptureOrientation DeviceOrientation? Whether the camera should be locked to the specific orientation during captures. null
foregroundBuilder ForegroundBuilder? The foreground widget builder which will cover the whole camera preview. null
previewTransformBuilder PreviewTransformBuilder? The widget builder which will transform the camera preview. null
onEntitySaving EntitySaveCallback? The callback type define for saving entity in the viewer. null
onError CameraErrorHandler? The error handler when any error occurred during the picking process. null
onXFileCaptured XFileCapturedCallback? The callback type definition when the XFile is captured by the camera. null
onMinimumRecordDurationNotMet VoidCallback? The callback when the recording is not met the minimum recording duration. null

Using custom States

All user interface can be customized through custom States, including:

  • CameraPickerState
  • CameraPickerViewerState

After override States, pass them through the picking method, more specifically:

  • CameraPicker.pickFromCamera(createPickerState: () => CustomCameraPickerState());
  • CameraPickerViewer.pushToViewer(..., createViewerState: () => CustomCameraPickerViewerState());

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: flutter/flutter#89216 . Other than that, please submit issues to describe your question.

Contributors

Thank goes to these wonderful people (emoji key):

Alex Li
Alex Li

💻 🎨 📖 💡 🤔 🚧 💬 👀
Caijinglong
Caijinglong

💡 🤔
Lael
Lael

📖
mjl0602
mjl0602

💻 🤔
AliasWang
AliasWang

💻 🤔
leftcoding
leftcoding

🐛
Luong The Vinh
Luong The Vinh

💻
luomo-pro
luomo-pro

️️️️♿️ 🐛
LeonardoZhu
LeonardoZhu

💻
Nguyen Phuc Loi
Nguyen Phuc Loi

🌍

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

More Repositories

1

wechat_flutter

wechat_flutter is Flutter version WeChat, an excellent Flutter instant messaging IM open source library!
Dart
2,453
star
2

extended_image

A powerful official extension library of image, which support placeholder(loading)/ failed state, cache network, zoom pan image, photo view, slide out page, editor(crop,rotate,flip), paint custom etc.
Dart
1,850
star
3

NeteaseCloudMusic

Flutter - NeteaseCloudMusic Flutter 版本的网易云音乐
Dart
1,754
star
4

flutter_wechat_assets_picker

An image picker (also with video and audio) for Flutter projects based on the WeChat's UI.
Dart
1,422
star
5

flutter_smart_dialog

An elegant Flutter Dialog solution | 一种更优雅的 Flutter Dialog 解决方案
Dart
1,005
star
6

flutter_candies

custom flutter candies(widgets) for you to build flutter app easily, enjoy it
Dart
795
star
7

flutter_photo_manager

A Flutter plugin that provides images, videos, and audio abstraction management APIs without interface integration, available on Android, iOS, macOS and OpenHarmony..
Dart
634
star
8

extended_text

A powerful extended official text for Flutter, which supports Speical Text(Image,@somebody), Custom Background, Custom overFlow, Text Selection.
Dart
622
star
9

flutter_image_compress

flutter image compress
Dart
602
star
10

extended_nested_scroll_view

extended nested scroll view to fix following issues. 1.pinned sliver header issue 2.inner scrollables in tabview sync issue 3.pull to refresh is not work. 4.do without ScrollController in NestedScrollView's body
Dart
576
star
11

FlutterJsonBeanFactory

What I do is generate dart beans based on json, as well as generics parameters and json build instances
Kotlin
560
star
12

extended_text_field

extended official text field to quickly build special text like inline image, @somebody, custom background etc.
Dart
532
star
13

flutter_custom_calendar

Flutter的一个日历控件
Dart
497
star
14

like_button

Like Button is a flutter library that allows you to create a button with animation effects similar to Twitter's heart when you like something and animation effects to increase like count.
Dart
436
star
15

flutter_image_editor

Flutter plugin, support android/ios.Support crop, flip, rotate, color martix, mix image, add text. merge multi images.
Dart
391
star
16

JsonToDart

The tool to convert json to dart code, support Windows,Mac,Web.
Dart
353
star
17

flutter_scrollview_observer

A widget for observing data related to the child widgets being displayed in a ScrollView. Maintainer: @LinXunFeng
Dart
349
star
18

waterfall_flow

A Flutter grid view which supports waterfall flow layout.
Dart
345
star
19

loading_more_list

A loading more list which supports ListView,GridView,WaterfallFlow and Slivers.
Dart
331
star
20

ncov_2019

An online query App for COVID-19 statistics developed by Flutter was used.
Dart
256
star
21

extended_tabs

A powerful official extension library of Tab/TabBar/TabView, which support to scroll ancestor or child Tabs when current is overscroll, and set scroll direction and cache extent.
Dart
254
star
22

flutter-interactive-chart

A candlestick chart that supports pinch-to-zoom and panning.
Dart
191
star
23

pull_to_refresh_notification

Flutter plugin for building pull to refresh effects with PullToRefreshNotification and PullToRefreshContainer quickly.
Dart
183
star
24

flutter_interactional_widget

Dart
165
star
25

extended_sliver

A powerful extension library of Sliver, which include SliverToNestedScrollBoxAdapter, SliverPinnedPersistentHeader, SliverPinnedToBoxAdapter and ExtendedSliverAppbar.
Dart
157
star
26

extended_image_library

package library for extended_image, extended_text and extended_text_field,provide common base class.
Dart
146
star
27

flutter_drawing_board

A new Flutter package of drawing board
Dart
137
star
28

ff_annotation_route

Provide route generator to create route map quickly by annotations.
Dart
118
star
29

flutter_filereader

Flutter实现的本地文件(pdf word excel 等)查看插件,非在线预览
Dart
109
star
30

flutter_tilt

👀 Easily apply tilt parallax hover effects for Flutter, which supports tilt, light, shadow effects, and gyroscope sensors | 为 Flutter 轻松创建倾斜视差悬停效果,支持倾斜、光照、阴影效果和陀螺仪传感器
Dart
105
star
31

nav_router

flutter The lightest, easiest and most convenient route management!
Dart
103
star
32

w_popup_menu

w_popup_menu # A pop-up menu that mimics the iOS WeChat page
Dart
90
star
33

left-scroll-actions

Flutter的左滑删除组件
Dart
82
star
34

flutter_asset_generator

Generate an R file for mapping all assets. Supports preview of image.
Dart
79
star
35

extended_text_library

extended_text_library for extended_text and extended_text_field
Dart
74
star
36

flutter_hsvcolor_picker

An HSV color picker designed for your Flutter app. Pickers: RGB, HSV, Color Wheel, Palette Hue, Palette Saturation, Palette Value, Swatches.
Dart
65
star
37

stack_board

层叠控件摆放
Dart
60
star
38

no-free-usage-action

A NO-FREE-USAGE action for github. (Only worked with github action.)
Dart
60
star
39

flex_grid

The FlexGrid control provides a powerful and quickly way to display data in a tabular format. It is including that frozened column/row,loading more, high performance and better experience in TabBarView/PageView.
Dart
57
star
40

extended_list

extended list(ListView/GridView) support track collect garbage of children/viewport indexes, build lastChild as special child in the case that it is loadmore/no more item and enable to layout close to trailing.
Dart
50
star
41

flutter_juejin

https://juejin.cn in Flutter
Dart
48
star
42

gitcandies

A GitHub Flutter application.
Dart
47
star
43

fconsole

一个用于调试的面板
Dart
44
star
44

ripple_backdrop_animate_route

A ripple animation with backdrop of route.
Dart
44
star
45

flutter_ali_auth

Flutter Ali Auth Plugin 阿里云一键登录Flutter插件
Java
42
star
46

flutter_apodidae

🔥🔥 收录 Flutter 优化合集,apodidae (雨燕)是飞翔速度最快的鸟类,与 flutter (颤动)不谋而合。
40
star
47

flutter_bdface_collect

a baidu face offline collect plugin. Only Android and IOS platforms are supported. 百度人脸离线采集插件,只支持安卓和iOS。
Objective-C
35
star
48

flutter_record_mp3

flutter record mp3 using the native api
Dart
34
star
49

assets_generator

The flutter tool to generate assets‘s configs(yaml) and consts automatically for single project and multiple modules.
Dart
34
star
50

flutter_draggable_container

A Draggable Widget Container
Dart
27
star
51

flutter_qweather

和风天气 Flutter 插件
Dart
26
star
52

baidupan

Baidu net disk api for dart, 百度网盘的 dart 库
Dart
26
star
53

flutter_switch_clipper

A Flutter package that two widgets switch with clipper.
Dart
24
star
54

http_client_helper

A Flutter plugin for http request with cancel and retry fuctions.
Dart
24
star
55

dash_painter

a package for flutter canvas paint dash line path easily.
Dart
23
star
56

flutter_slider_view

A slider view widget that supports custom type models and various configs.
Dart
21
star
57

flutter_live_activities

Flutter Live Activities Plugin
Dart
21
star
58

extra_hittest_area

Manually add the extra hitTest area of a widget without changing its size or layout.
Dart
17
star
59

ios_willpop_transition_theme

A Flutter package to solve the conflict between ios sliding back and Willpop
Dart
17
star
60

flutter_learning_tests

学习 Flutter 路上的点滴及小测~
Dart
16
star
61

flutter_mlkit_scan_plugin

Kotlin
15
star
62

should_rebuild

Dart
14
star
63

saver_gallery

Kotlin
12
star
64

candies_analyzer_plugin

The plugin to help create custom analyzer plugin quickly and provide some useful lints and get suggestion and auto import for extension member.
Dart
12
star
65

flutter_candies_gallery

flutter_candies
Dart
11
star
66

scan_barcode

Barcode/QRCode scan, base of google mikit.
Dart
11
star
67

CandiesBot

Java
11
star
68

packages

Custom Flutter Candies (packages) for you to easily build your Flutter app. Enjoy it!
11
star
69

flutter_float_window

flutter_float_window是一个悬浮窗插件,具备悬浮窗权限申请等功能
Java
11
star
70

extended_list_library

package library for extended_list and waterfall_flow, it provides core classes.
Dart
10
star
71

photo_widget

Base on photo_manager, wraps up some UI components to quickly display the photo_manager as a usable widget, inserting it wherever you need it.
Dart
10
star
72

flutter_app_build_tool

A CLI tool that helps to build Flutter apps.
Dart
9
star
73

douget

Dart
9
star
74

flutter_custom_inspector

A customizable inspector that can called directly through Flutter apps.
Dart
8
star
75

adaptation

Screen for adaptation.
C++
8
star
76

ff_native_screenshot

A Flutter plugin to take or listen screenshot(support Platform Views) for Android and iOS with native code.
Java
8
star
77

coordtransform

A coord transform tool. 提供百度坐标系(BD-09)、火星坐标系(国测局坐标系、GCJ02)、WGS84坐标系的相互转换。
Dart
8
star
78

properties

Load properties format in dart or flutter
Dart
7
star
79

w_reorder_list

Dart
7
star
80

JsonToDartWeb

JsonToDart Web 带字体文件
7
star
81

flutter_candies_demo_library

package library for demo of flutter candies, it provides core classes.
Dart
7
star
82

JsonToDartFlutterWeb

6
star
83

sync_scroll_library

The library for extended_tabs and flex_grid
Dart
5
star
84

env2dart

A simple way to generate `dart` code from a `.env` file.
Dart
5
star
85

loading_more_list_library

dart package library for LoadingMoreList, it provides core classes.
Dart
5
star
86

flutter_challenges

Just do the first one, don't do second who.
Dart
4
star
87

dext

Some extension for dart
Dart
4
star
88

flutter_candies_package_tools

tool to create package and demo
Dart
4
star
89

flutter_clean

help clean all of Flutter and Dart projects
Dart
3
star
90

simple_provider

flutter simple provider
Dart
3
star
91

ff_annotation_route_library

The library for ff_annotation_route
Dart
3
star
92

upgrade_tool

Resolve warnings caused by xxxbinding. Instance in Flutter 3.0
Dart
2
star
93

note_edit

A library of flutter note editor plugins.
Dart
2
star
94

blue_flutter

blue_flutter是flutter的蓝牙通讯插件
Java
2
star
95

ff_annotation_route_core

The core library for ff_annotation_route
Dart
2
star
96

dart_wake_on_lan

A CLI application to send Wake-On-Lan packets.
Dart
2
star
97

maven

Organizational maven deploy;组织的maven仓库;
1
star
98

.github-workflow

Run some workflows for the organization.
Python
1
star
99

flutter_photo_manager_plugins

Extra plugins for the photo_manager plugin.
C++
1
star
100

flutter_bindings_compatible

Provides compatible bindings instance across different Flutter version.
C++
1
star