Bladeren bron

update readme and example comment

Caijinglong 6 jaren geleden
bovenliggende
commit
b3379c0bba
2 gewijzigde bestanden met toevoegingen van 35 en 29 verwijderingen
  1. 32
    26
      README.md
  2. 3
    3
      example/lib/main.dart

+ 32
- 26
README.md Bestand weergeven

@@ -37,37 +37,43 @@ import 'package:photo_manager/photo_manager.dart';
37 37
 ## use
38 38
 
39 39
 ```dart
40
-  void _pickImage() async {
40
+void _pickImage() async {
41 41
     List<AssetEntity> imgList = await PhotoPicker.pickImage(
42
-      context: context, // BuildContext requied
42
+      context: context,
43
+      // BuildContext requied
43 44
 
44 45
       /// The following are optional parameters.
45
-      themeColor: Colors.green, // the title color and bottom color
46
-      padding: 1.0, // item padding
47
-      dividerColor: Colors.deepOrange, // divider color
48
-      disableColor: Colors.grey.shade300, // the check box disable color
49
-      itemRadio: 0.88, // the content item radio
50
-      maxSelected: 8, // max picker image count
51
-      provider: I18nProvider.chinese, // i18n provider ,default is chinese. , you can custom I18nProvider or use ENProvider()
52
-      rowCount: 5,  // item row count
53
-      textColor: Colors.white, // text color
54
-      thumbSize: 150, // preview thumb size , default is 64
55
-      sortDelegate: SortDelegate.common, // default is common ,or you make custom delegate to sort your gallery
56
-      checkBoxBuilderDelegate: DefaultCheckBoxBuilderDelegate(), // default is DefaultCheckBoxBuilderDelegate ,or you make custom delegate to create checkbox
46
+      themeColor: Colors.green,
47
+      // the title color and bottom color
48
+      padding: 1.0,
49
+      // item padding
50
+      dividerColor: Colors.grey,
51
+      // divider color
52
+      disableColor: Colors.grey.shade300,
53
+      // the check box disable color
54
+      itemRadio: 0.88,
55
+      // the content item radio
56
+      maxSelected: 8,
57
+      // max picker image count
58
+      provider: I18nProvider.chinese,
59
+      // i18n provider ,default is chinese. , you can custom I18nProvider or use ENProvider()
60
+      rowCount: 5,
61
+      // item row count
62
+      textColor: Colors.white,
63
+      // text color
64
+      thumbSize: 150,
65
+      // preview thumb size , default is 64
66
+      sortDelegate: SortDelegate.common,
67
+      // default is common ,or you make custom delegate to sort your gallery
68
+      checkBoxBuilderDelegate: DefaultCheckBoxBuilderDelegate(
69
+        activeColor: Colors.white,
70
+        unselectedColor: Colors.white,
71
+      ), // default is DefaultCheckBoxBuilderDelegate ,or you make custom delegate to create checkbox
72
+
73
+      loadingDelegate:
74
+          this, // if you want to build custom loading widget,extends LoadingDelegate [see example/lib/main.dart]
57 75
     );
58 76
 
59
-    if (imgList == null) {
60
-      currentSelected = "not select item";
61
-    } else {
62
-      List<String> r = [];
63
-      for (var e in imgList) {
64
-        var file = await e.file;
65
-        r.add(file.absolute.path);
66
-      }
67
-      currentSelected = r.join("\n\n");
68
-    }
69
-    setState(() {});
70
-  }
71 77
 ```
72 78
 
73 79
 ## whole example

+ 3
- 3
example/lib/main.dart Bestand weergeven

@@ -61,10 +61,10 @@ class _MyHomePageState extends State<MyHomePage> with LoadingDelegate {
61 61
       checkBoxBuilderDelegate: DefaultCheckBoxBuilderDelegate(
62 62
         activeColor: Colors.white,
63 63
         unselectedColor: Colors.white,
64
-      ),
65
-      // default is D
64
+      ), // default is DefaultCheckBoxBuilderDelegate ,or you make custom delegate to create checkbox
65
+
66 66
       loadingDelegate:
67
-          this, // efaultCheckBoxBuilderDelegate ,or you make custom delegate to create checkbox
67
+          this, // if you want to build custom loading widget,extends LoadingDelegate, [see example/lib/main.dart]
68 68
     );
69 69
 
70 70
     if (imgList == null) {