Skip to content

Commit 3f969bf

Browse files
committed
📝 Add documentation.
1 parent 2546604 commit 3f969bf

File tree

2 files changed

+115
-10
lines changed

2 files changed

+115
-10
lines changed

README-ZH.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Flutter仿微信相机资源选择器
2+
3+
[![pub package](https://img.shields.io/pub/v/wechat_camera_picker?logo=dart&label=%E7%A8%B3%E5%AE%9A%E7%89%88&style=flat-square)](https://pub.dev/packages/wechat_camera_picker)
4+
[![pub package](https://img.shields.io/pub/v/wechat_camera_picker?color=42a012&include_prereleases&label=%E5%BC%80%E5%8F%91%E7%89%88&logo=dart&style=flat-square)](https://pub.dev/packages/wechat_camera_picker)
5+
[![GitHub stars](https://img.shields.io/github/stars/fluttercandies/flutter_wechat_camera_picker?logo=github&style=flat-square)](https://github.com/fluttercandies/flutter_wechat_camera_picker/stargazers)
6+
[![GitHub forks](https://img.shields.io/github/forks/fluttercandies/flutter_wechat_camera_picker?logo=github&style=flat-square)](https://github.com/fluttercandies/flutter_wechat_camera_picker/network)
7+
[![Build status](https://img.shields.io/github/workflow/status/fluttercandies/flutter_wechat_camera_picker/Build%20test?label=%E7%8A%B6%E6%80%81&logo=github&style=flat-square)](https://github.com/fluttercandies/flutter_wechat_camera_picker/actions?query=workflow%3A%22Build+test%22)
8+
[![CodeFactor](https://img.shields.io/codefactor/grade/github/fluttercandies/flutter_wechat_camera_picker?logo=codefactor&label=%E4%BB%A3%E7%A0%81%E8%B4%A8%E9%87%8F&logoColor=%23ffffff&style=flat-square)](https://www.codefactor.io/repository/github/fluttercandies/flutter_wechat_camera_picker)
9+
[![GitHub license](https://img.shields.io/github/license/fluttercandies/flutter_wechat_camera_picker?style=flat-square&label=%E5%8D%8F%E8%AE%AE)](https://github.com/fluttercandies/flutter_wechat_camera_picker/blob/master/LICENSE)
10+
<a target="_blank" href="https://jq.qq.com/?_wv=1027&k=5bcc0gy"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="FlutterCandies" title="FlutterCandies"></a>
11+
12+
Language: [English](README.md) | 中文简体
13+
14+
[**仿微信资源选择器**](https://pub.dev/packages/wechat_assets_picker)的扩展。基于 `camera` 实现相机相关功能, `photo_manager` 实现资源相关内容。
15+
16+
## 目录 🗂
17+
18+
* [特性](#特性-)
19+
* [截图](#截图-)
20+
* [准备工作](#准备工作-)
21+
* [使用方法](#使用方法-)
22+
23+
## 特性 ✨
24+
25+
- [x] 💚 99%的微信风格
26+
- [x] 📷 支持拍照
27+
- [x] 🎥 支持录像
28+
- [x] ⏱ 支持限制录像时间
29+
30+
31+
## 截图 📸
32+
33+
| ![](https://tva1.sinaimg.cn/large/007S8ZIlgy1ggtt6yrdqej30u01t017w.jpg) | ![](https://tva1.sinaimg.cn/large/007S8ZIlgy1ggtt6yh3x4j30u01t0wuo.jpg) |
34+
|-----------------|------------------|
35+
| ![](https://tva1.sinaimg.cn/large/007S8ZIlgy1ggtt6z1h7xj30u01t01kx.jpg) | ![](https://tva1.sinaimg.cn/large/007S8ZIlgy1ggtt6zarvhj30u01t0x5f.jpg) |
36+
37+
## 准备工作 🍭
38+
39+
参考: [wechat_assets_picker#准备工作](https://github.com/fluttercandies/flutter_wechat_assets_picker/blob/master/README-ZH.md#preparing-for-use-)
40+
41+
## 使用方法 📖
42+
43+
| 参数名 | 类型 | 描述 | 默认值 |
44+
| ------------------------ | -------------------------- | ---------------------------------------------------- | -------------------------------------- |
45+
| isAllowRecording | `bool` | 选择器是否可以录像 | `false` |
46+
| maximumRecordingDuration | `Duration` | 录制视频最长时长 | `const Duration(seconds: 15)` |
47+
| theme | `ThemeData` | 选择器的主题 | `CameraPicker.themeData(C.themeColor)` |
48+
| textDelegate | `CameraPickerTextDelegate` | 控制部件中的文字实现 | `DefaultCameraPickerTextDelegate` |
49+
50+
### 简单的使用方法
51+
52+
```dart
53+
final AssetEntity entity = await CameraPicker.pickFromCamera(context);
54+
```
55+
56+
在选择器唤起后,并且 `isAllowRecording``true`,点击拍摄按钮以拍照,长按拍摄按钮以录像。

README.md

Lines changed: 59 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,63 @@
1-
# wechat_camera_picker
1+
# Flutter WeChat Camera Picker
22

3-
A new Flutter package project.
3+
[![pub package](https://img.shields.io/pub/v/wechat_camera_picker?logo=dart&label=stable&style=flat-square)](https://pub.dev/packages/wechat_camera_picker)
4+
[![pub package](https://img.shields.io/pub/v/wechat_camera_picker?color=42a012&include_prereleases&label=dev&logo=dart&style=flat-square)](https://pub.dev/packages/wechat_camera_picker)
5+
[![GitHub stars](https://img.shields.io/github/stars/fluttercandies/flutter_wechat_camera_picker?logo=github&style=flat-square)](https://github.com/fluttercandies/flutter_wechat_camera_picker/stargazers)
6+
[![GitHub forks](https://img.shields.io/github/forks/fluttercandies/flutter_wechat_camera_picker?logo=github&style=flat-square)](https://github.com/fluttercandies/flutter_wechat_camera_picker/network)
7+
[![Build status](https://img.shields.io/github/workflow/status/fluttercandies/flutter_wechat_camera_picker/Build%20test?label=CI&logo=github&style=flat-square)](https://github.com/fluttercandies/flutter_wechat_camera_picker/actions?query=workflow%3A%22Build+test%22)
8+
[![CodeFactor](https://img.shields.io/codefactor/grade/github/fluttercandies/flutter_wechat_camera_picker?logo=codefactor&logoColor=%23ffffff&style=flat-square)](https://www.codefactor.io/repository/github/fluttercandies/flutter_wechat_camera_picker)
9+
[![GitHub license](https://img.shields.io/github/license/fluttercandies/flutter_wechat_camera_picker?style=flat-square)](https://github.com/fluttercandies/flutter_wechat_camera_picker/blob/master/LICENSE)
10+
<a target="_blank" href="https://jq.qq.com/?_wv=1027&k=5bcc0gy"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="FlutterCandies" title="FlutterCandies"></a>
411

5-
## Getting Started
12+
Language: English | [中文简体](README-ZH.md)
613

7-
This project is a starting point for a Dart
8-
[package](https://flutter.dev/developing-packages/),
9-
a library module containing code that can be shared easily across
10-
multiple Flutter or Dart projects.
14+
A **camera picker** which is an extension for [wechat_assets_picker](https://pub.dev/packages/wechat_assets_picker). Based on `camera` for camera functions and `photo_manager` for asset implementation.
1115

12-
For help getting started with Flutter, view our
13-
[online documentation](https://flutter.dev/docs), which offers tutorials,
14-
samples, guidance on mobile development, and a full API reference.
16+
17+
## Contributors ✨
18+
19+
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
20+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
21+
<!-- ALL-CONTRIBUTORS-LIST:END -->
22+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
23+
24+
## Category 🗂
25+
26+
* [Features](#features-)
27+
* [Screenshots](#screenshots-)
28+
* [Preparing for use](#preparing-for-use-)
29+
* [Usage](#usage-)
30+
31+
## Features ✨
32+
33+
- [x] 💚 99% simillar to WeChat style.
34+
- [x] 📷 Picture taking support
35+
- [x] 🎥 Video recording support
36+
- [x] ⏱ Duration limitation support
37+
38+
## Screenshots 📸
39+
40+
| ![](https://tva1.sinaimg.cn/large/007S8ZIlgy1ggtt6yrdqej30u01t017w.jpg) | ![](https://tva1.sinaimg.cn/large/007S8ZIlgy1ggtt6yh3x4j30u01t0wuo.jpg) |
41+
|-----------------|------------------|
42+
| ![](https://tva1.sinaimg.cn/large/007S8ZIlgy1ggtt6z1h7xj30u01t01kx.jpg) | ![](https://tva1.sinaimg.cn/large/007S8ZIlgy1ggtt6zarvhj30u01t0x5f.jpg) |
43+
44+
## Preparing for use 🍭
45+
46+
Reference: [wechat_assets_picker#preparing-for-use](https://github.com/fluttercandies/flutter_wechat_assets_picker#preparing-for-use-)
47+
48+
## Usage 📖
49+
50+
| Name | Type | Description | Default Value |
51+
| ------------------------ | -------------------------- | ---------------------------------------------------- | -------------------------------------- |
52+
| isAllowRecording | `bool` | Whether the picker can record video. | `false` |
53+
| maximumRecordingDuration | `Duration` | The maximum duration of the video recording process. | `const Duration(seconds: 15)` |
54+
| theme | `ThemeData` | Theme data for the picker. | `CameraPicker.themeData(C.themeColor)` |
55+
| textDelegate | `CameraPickerTextDelegate` | Text delegate that controls text in widgets. | `DefaultCameraPickerTextDelegate` |
56+
57+
### Simple usage
58+
59+
```dart
60+
final AssetEntity entity = await CameraPicker.pickFromCamera(context);
61+
```
62+
63+
After called and the picker displayed, plus `isAllowRecording` is `true`, tap the shooting button to take a picture, long press the shooting button to record a video.

0 commit comments

Comments
 (0)