Browse Source

Update example and readme.

Caijinglong 5 years ago
parent
commit
ff57073510
2 changed files with 18 additions and 1 deletions
  1. 14
    1
      README.md
  2. 4
    0
      example/lib/main.dart

+ 14
- 1
README.md View File

34
 import 'package:photo_manager/photo_manager.dart';
34
 import 'package:photo_manager/photo_manager.dart';
35
 ```
35
 ```
36
 
36
 
37
-## use
37
+## Usage
38
+
39
+### Simple use
40
+
41
+```dart
42
+void pickAssets() async {
43
+    List<AssetEntity> assetList = await PhotoPicker.pickAsset(context: context);
44
+    /// Use assetList to do something.
45
+}
46
+```
47
+
48
+### More option
49
+
50
+The context is required, other params is optional.
38
 
51
 
39
 ```dart
52
 ```dart
40
 void pickAsset() async {
53
 void pickAsset() async {

+ 4
- 0
example/lib/main.dart View File

113
   }
113
   }
114
 
114
 
115
   void _pickAsset(PickType type, {List<AssetPathEntity> pathList}) async {
115
   void _pickAsset(PickType type, {List<AssetPathEntity> pathList}) async {
116
+    /// context is required, other params is optional.
117
+    /// context is required, other params is optional.
118
+    /// context is required, other params is optional.
119
+
116
     List<AssetEntity> imgList = await PhotoPicker.pickAsset(
120
     List<AssetEntity> imgList = await PhotoPicker.pickAsset(
117
       // BuildContext required
121
       // BuildContext required
118
       context: context,
122
       context: context,