패키지, 저장소 및 앱 카테고리 검색

패키지 상세v4.6.0

wechat_camera_picker

위챗의 UI를 기반으로 한 플러터 프로젝트용 카메라 선택기이며, wechat_assets_picker의 별도 실행 가능한 확장 기능이기도 합니다.

AndroidiOS
30일 다운로드
1.8만
좋아요
281
Pub 점수
140

패키지 설치

flutter pub add wechat_camera_picker

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

위챗 디자인을 영감으로 한 카메라 선택 인터페이스를 제공하는 플러터 패키지로, 사진과 동영상을 촬영할 때 매끄럽고 익숙한 경험을 제공합니다. wechat_assets_picker의 독립적인 확장 기능으로 작동하여 개발자가 최소한의 노력으로 정교한 카메라 UI를 앱에 통합할 수 있도록 합니다. 이 피커는 안드로이드와 iOS 플랫폼을 모두 지원하며, 다양한 장치에서 일관된 동작을 보장합니다. 직관적인 미디어 캡처 워크플로우가 필요한 앱에 적합합니다.

사용 사례

  • 웨이신 스타일의 카메라 인터페이스 통합
  • 빠른 사진 및 비디오 캡처 활성화
  • 소셜 미디어 또는 메시징 앱 구축
  • 미디어 집약적 애플리케이션에서 사용자 경험 향상
  • 기존 자산 선택기 내에서 사용자 정의 카메라 흐름 만들기

주요 기능

  • 위챗 스타일의 UI 디자인
  • wechat_assets_picker에서 확장 기능 분리
  • 사진 및 비디오 캡처 모두 지원
  • 크로스 플랫폼 호환성 (Android 및 iOS)
  • pub add 명령을 통한 간단한 통합

적합한 대상

  • 네이티브 카메라 인터페이스를 찾는 개발자
  • 사용자 생성 콘텐츠에 초점을 맞춘 앱
  • wechat_assets_picker를 사용하는 프로젝트
  • UX 일관성을 우선시하는 팀
  • 경량 카메라 기능이 필요한 모바일 앱

고려 사항

  • 완전한 기능을 위해 wechat_assets_picker에 대한 종속성이 필요합니다
  • UI 요소의 사용자 정의 제한
  • 카메라 접근을 위해 추가 권한이 필요할 수 있습니다
  • WeChat와의 UI 일관성을 원하는 앱에 가장 적합
  • 필터나 수동 조작과 같은 고급 카메라 기능을 위한 것이 아님

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Flutter WeChat Camera Picker

pub package pub package CodeFactor

Build status GitHub license GitHub stars GitHub forks

Language: English | 中文

A camera picker for Flutter projects based on WeChat's UI, which is also a separate runnable extension to the wechat_assets_picker.

The current WeChat version that UI is based on: 8.0.49. UI designs will be updated at any time following the WeChat update.

See the Migration Guide to learn how to migrate between breaking changes.

Versions compatibility

The package only guarantees that it will work on the stable version of Flutter. We won't update it in real-time to align with other channels of Flutter.

3.3.0 3.16.0 3.22.0
4.4.0+ ❌ ✅ ✅
4.2.0+ ❌ ✅ ❌
4.0.0+ ✅ ❌ ❌

Package credits

The package is built from these wonderful packages.

Name Features
photo_manager The basic abstractions and management for assets.
camera Captures images and videos.
video_player Plays videos and audios correspondingly.

Their implementation should be relatively stable in the package. If you've found any issues related to them when using the picker, submit issues to our issue tracker first.

Table of content

Features ✨

  • ♿ Complete a11y support with TalkBack and VoiceOver
  • ♻️ Fully implementable with States override
  • 🎏 Fully customizable theme based on ThemeData
  • 💚 Completely WeChat style (even more)
  • ⚡️ Adjustable performance with different configurations
  • 📷 Picture capturing support
  • 🎥 Video recording support
    • ⏱ Duration limitation support
    • 🔍 Scale when recording support
  • ☀️ Exposure adjust support
  • 🔍️ Scale with pinch support
  • 💱 i18n support
    • ⏪ RTL language support
  • 🖾 Foreground custom widget builder support
  • 🕹️ Intercept saving with a custom process

Screenshots 📸

1 2 3 4 5

READ THIS FIRST ‼️

Be aware of the below notices before you start anything:

  • Due to understanding the differences and limitations of a single document, documents will not cover all the contents. If you find nothing related to your expected features and cannot understand about concepts, run the example project and check every option first. It has covered 90% of regular requests with the package.
  • The package deeply integrates with the photo_manager plugin, make sure you understand these two concepts as much as possible:

When you have questions about related APIs and behaviors, check photo_manager's API docs for more details.

Most usages are detailed and covered by the example. Please walk through the example carefully before you have any questions.

Preparing for use 🍭

If you got a resolve conflict error when running flutter pub get, please use dependency_overrides to fix it.

Setup

Run flutter pub add wechat_camera_picker, or add wechat_camera_picker to pubspec.yaml dependencies manually.

dependencies:
  wechat_camera_picker: ^latest_version

The latest stable version is: pub package

The latest dev version is: pub package

Follow these detailed setup guide before runs:

Notes 📝
  1. When using NSPhotoLibraryAddUsageDescription on iOS, it requires using onEntitySaving or onXFileCaptured to handle the captured file, an AssetEntity is not available in this circumstance, obtaining that asset with its ID will lead to a crash.

Then import the package in your code:

import 'package:wechat_camera_picker/wechat_camera_picker.dart';

Usage 📖

Localizations

When you're picking assets, the package will obtain the Locale? from your BuildContext, and return the corresponding text delegate of the current language. Make sure you have a valid Locale in your widget tree that can be accessed from the BuildContext. Otherwise, the default Chinese delegate will be used.

Embedded text delegates languages are:

  • 简体中文 (default)
  • English
  • Tiếng Việt

If you want to use a custom/fixed text delegate, pass it through the CameraPickerConfig.textDelegate.

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
enableScaledPreview bool Whether the camera preview should be scaled during captures. false
shouldDeletePreviewFile bool Whether the preview file will be delete when pop. false
shouldAutoPreviewVideo bool Whether the video should be played instantly in the preview. true
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.ultraHigh
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
previewVideoViewType VideoViewType The type of preview video view to be used. VideoViewType.texture
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
onPickConfirmed void Function(AssetEntity)? The callback when picture is taken or video is confirmed. null
permissionRequestOption PermissionRequestOption? The permission request option when saving the captured file using the photo_manager package. null
Using custom States

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

  • CameraPickerState
  • CameraPickerViewerState

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

Contributors ✨

Thanks 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

🌍
Amos
Amos

🐛
Tee Yu June
Tee Yu June

💻

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

카테고리

의존성

의존성 목록 9 개

소스 저장소

이 패키지를 사용하는 프로젝트