Browse Source

Merge pull request #29 from CaiJingLong/add-pathlist

close #27
C 5 years ago
parent
commit
19cf0b912d
No account linked to committer's email address

+ 2
- 0
CHANGELOG.md View File

1
 # CHANGELOG
1
 # CHANGELOG
2
 
2
 
3
+## [0.2.1] add params photoList
4
+
3
 ## [0.2.0]
5
 ## [0.2.0]
4
 
6
 
5
 **break change**
7
 **break change**

+ 11
- 1
README.md View File

37
 ## use
37
 ## use
38
 
38
 
39
 ```dart
39
 ```dart
40
-void _pickImage() async {
40
+void pickAsset() async {
41
     List<AssetEntity> imgList = await PhotoPicker.pickAsset(
41
     List<AssetEntity> imgList = await PhotoPicker.pickAsset(
42
       context: context,
42
       context: context,
43
       // BuildContext requied
43
       // BuildContext requied
73
       loadingDelegate:
73
       loadingDelegate:
74
           this, // if you want to build custom loading widget,extends LoadingDelegate [see example/lib/main.dart]
74
           this, // if you want to build custom loading widget,extends LoadingDelegate [see example/lib/main.dart]
75
 
75
 
76
+      badgeDelegate: const DefaultBadgeDelegate(), /// or custom class extends [BadgeDelegate]
77
+
76
       pickType: type, // all/image/video
78
       pickType: type, // all/image/video
79
+
80
+      List<AssetPathEntity> photoPathList, /// when [photoPathList] is not null , [pickType] invalid .
77
     );
81
     );
78
 ```
82
 ```
79
 
83
 
84
+### about photoPathList params
85
+
86
+You can use [photo_manager] package to get `List<AssetPathEntity>` and handle or cache.
87
+
88
+This parameter is then passed into the `pickAsset` method, where the incoming photoList is rendered instead of the data in the album.
89
+
80
 ## whole example
90
 ## whole example
81
 
91
 
82
 you can see [github](https://github.com/caijinglong/flutter_photo/blob/master/example/) [main.dart](https://github.com/caijinglong/flutter_photo/blob/master/example/lib/main.dart)
92
 you can see [github](https://github.com/caijinglong/flutter_photo/blob/master/example/) [main.dart](https://github.com/caijinglong/flutter_photo/blob/master/example/lib/main.dart)

+ 82
- 57
example/lib/main.dart View File

30
 class _MyHomePageState extends State<MyHomePage> with LoadingDelegate {
30
 class _MyHomePageState extends State<MyHomePage> with LoadingDelegate {
31
   String currentSelected = "";
31
   String currentSelected = "";
32
 
32
 
33
-  void _pickAsset(PickType type) async {
33
+  @override
34
+  Widget buildBigImageLoading(
35
+      BuildContext context, AssetEntity entity, Color themeColor) {
36
+    return Center(
37
+      child: Container(
38
+        width: 50.0,
39
+        height: 50.0,
40
+        child: CupertinoActivityIndicator(
41
+          radius: 25.0,
42
+        ),
43
+      ),
44
+    );
45
+  }
46
+
47
+  @override
48
+  Widget buildPreviewLoading(
49
+      BuildContext context, AssetEntity entity, Color themeColor) {
50
+    return Center(
51
+      child: Container(
52
+        width: 50.0,
53
+        height: 50.0,
54
+        child: CupertinoActivityIndicator(
55
+          radius: 25.0,
56
+        ),
57
+      ),
58
+    );
59
+  }
60
+
61
+  @override
62
+  Widget build(BuildContext context) {
63
+    return new Scaffold(
64
+      appBar: new AppBar(
65
+        title: new Text(widget.title),
66
+        actions: <Widget>[
67
+          FlatButton(
68
+            child: Icon(Icons.image),
69
+            onPressed: _testPhotoListParams,
70
+          ),
71
+        ],
72
+      ),
73
+      body: Container(
74
+        child: SingleChildScrollView(
75
+          child: Column(
76
+            children: <Widget>[
77
+              IconTextButton(
78
+                  icon: Icons.photo,
79
+                  text: "photo",
80
+                  onTap: () => _pickAsset(PickType.onlyImage)),
81
+              IconTextButton(
82
+                  icon: Icons.videocam,
83
+                  text: "video",
84
+                  onTap: () => _pickAsset(PickType.onlyVideo)),
85
+              IconTextButton(
86
+                  icon: Icons.album,
87
+                  text: "all",
88
+                  onTap: () => _pickAsset(PickType.all)),
89
+              Text(
90
+                '$currentSelected',
91
+                textAlign: TextAlign.center,
92
+              ),
93
+            ],
94
+          ),
95
+        ),
96
+      ),
97
+      floatingActionButton: new FloatingActionButton(
98
+        onPressed: () => _pickAsset(PickType.all),
99
+        tooltip: 'pickImage',
100
+        child: new Icon(Icons.add),
101
+      ),
102
+    );
103
+  }
104
+
105
+  void _testPhotoListParams() async {
106
+    var assetPathList = await PhotoManager.getImageAsset();
107
+    _pickAsset(PickType.all, pathList: assetPathList);
108
+  }
109
+
110
+  void _pickAsset(PickType type, {List<AssetPathEntity> pathList}) async {
34
     List<AssetEntity> imgList = await PhotoPicker.pickAsset(
111
     List<AssetEntity> imgList = await PhotoPicker.pickAsset(
35
       // BuildContext required
112
       // BuildContext required
36
       context: context,
113
       context: context,
72
       // badgeDelegate to show badge widget
149
       // badgeDelegate to show badge widget
73
 
150
 
74
       pickType: type,
151
       pickType: type,
152
+
153
+      photoPathList: pathList,
75
     );
154
     );
76
 
155
 
77
     if (imgList == null) {
156
     if (imgList == null) {
86
     }
165
     }
87
     setState(() {});
166
     setState(() {});
88
   }
167
   }
89
-
90
-  @override
91
-  Widget buildBigImageLoading(BuildContext context, AssetEntity entity, Color themeColor) {
92
-    return Center(
93
-      child: Container(
94
-        width: 50.0,
95
-        height: 50.0,
96
-        child: CupertinoActivityIndicator(
97
-          radius: 25.0,
98
-        ),
99
-      ),
100
-    );
101
-  }
102
-
103
-  @override
104
-  Widget buildPreviewLoading(BuildContext context, AssetEntity entity, Color themeColor) {
105
-    return Center(
106
-      child: Container(
107
-        width: 50.0,
108
-        height: 50.0,
109
-        child: CupertinoActivityIndicator(
110
-          radius: 25.0,
111
-        ),
112
-      ),
113
-    );
114
-  }
115
-
116
-  @override
117
-  Widget build(BuildContext context) {
118
-    return new Scaffold(
119
-      appBar: new AppBar(
120
-        title: new Text(widget.title),
121
-      ),
122
-      body: Container(
123
-        child: SingleChildScrollView(
124
-          child: Column(
125
-            children: <Widget>[
126
-              IconTextButton(icon: Icons.photo, text: "photo", onTap: () => _pickAsset(PickType.onlyImage)),
127
-              IconTextButton(icon: Icons.videocam, text: "video", onTap: () => _pickAsset(PickType.onlyVideo)),
128
-              IconTextButton(icon: Icons.album, text: "all", onTap: () => _pickAsset(PickType.all)),
129
-              Text(
130
-                '$currentSelected',
131
-                textAlign: TextAlign.center,
132
-              ),
133
-            ],
134
-          ),
135
-        ),
136
-      ),
137
-      floatingActionButton: new FloatingActionButton(
138
-        onPressed: () => _pickAsset(PickType.all),
139
-        tooltip: 'pickImage',
140
-        child: new Icon(Icons.add),
141
-      ),
142
-    );
143
-  }
144
 }
168
 }
145
 
169
 
146
 class IconTextButton extends StatelessWidget {
170
 class IconTextButton extends StatelessWidget {
148
   final String text;
172
   final String text;
149
   final Function onTap;
173
   final Function onTap;
150
 
174
 
151
-  const IconTextButton({Key key, this.icon, this.text, this.onTap}) : super(key: key);
175
+  const IconTextButton({Key key, this.icon, this.text, this.onTap})
176
+      : super(key: key);
152
 
177
 
153
   @override
178
   @override
154
   Widget build(BuildContext context) {
179
   Widget build(BuildContext context) {

+ 20
- 5
lib/photo.dart View File

3
 import 'dart:async';
3
 import 'dart:async';
4
 
4
 
5
 import 'package:flutter/material.dart';
5
 import 'package:flutter/material.dart';
6
+
7
+import 'package:photo_manager/photo_manager.dart';
8
+
6
 import 'package:photo/src/delegate/badge_delegate.dart';
9
 import 'package:photo/src/delegate/badge_delegate.dart';
7
 import 'package:photo/src/delegate/checkbox_builder_delegate.dart';
10
 import 'package:photo/src/delegate/checkbox_builder_delegate.dart';
8
 import 'package:photo/src/delegate/loading_delegate.dart';
11
 import 'package:photo/src/delegate/loading_delegate.dart';
11
 import 'package:photo/src/provider/i18n_provider.dart';
14
 import 'package:photo/src/provider/i18n_provider.dart';
12
 import 'package:photo/src/ui/dialog/not_permission_dialog.dart';
15
 import 'package:photo/src/ui/dialog/not_permission_dialog.dart';
13
 import 'package:photo/src/ui/photo_app.dart';
16
 import 'package:photo/src/ui/photo_app.dart';
14
-import 'package:photo_manager/photo_manager.dart';
15
-
16
 export 'package:photo/src/delegate/checkbox_builder_delegate.dart';
17
 export 'package:photo/src/delegate/checkbox_builder_delegate.dart';
17
 export 'package:photo/src/delegate/loading_delegate.dart';
18
 export 'package:photo/src/delegate/loading_delegate.dart';
18
 export 'package:photo/src/delegate/sort_delegate.dart';
19
 export 'package:photo/src/delegate/sort_delegate.dart';
19
-export 'package:photo/src/provider/i18n_provider.dart' show I18NCustomProvider, I18nProvider, CNProvider, ENProvider;
20
+export 'package:photo/src/provider/i18n_provider.dart'
21
+    show I18NCustomProvider, I18nProvider, CNProvider, ENProvider;
20
 export 'package:photo/src/entity/options.dart' show PickType;
22
 export 'package:photo/src/entity/options.dart' show PickType;
21
 export 'package:photo/src/delegate/badge_delegate.dart';
23
 export 'package:photo/src/delegate/badge_delegate.dart';
22
 
24
 
42
   ///
44
   ///
43
   ///   当用户取消时返回一个空数组
45
   ///   当用户取消时返回一个空数组
44
   ///
46
   ///
47
+  ///   [photoPathList] 一旦设置 则 [pickType]参数无效
48
+  ///
45
   /// 关于参数可以查看readme文档介绍
49
   /// 关于参数可以查看readme文档介绍
46
   ///
50
   ///
47
   /// if user not grand permission, then return null and show a dialog to help user open setting.
51
   /// if user not grand permission, then return null and show a dialog to help user open setting.
53
   ///
57
   ///
54
   ///   when user cancel selected,result is empty list
58
   ///   when user cancel selected,result is empty list
55
   ///
59
   ///
60
+  ///   when [photoPathList] is not null , [pickType] invalid
61
+  ///
56
   /// params see readme.md
62
   /// params see readme.md
57
   static Future<List<AssetEntity>> pickAsset({
63
   static Future<List<AssetEntity>> pickAsset({
58
     @required BuildContext context,
64
     @required BuildContext context,
71
     LoadingDelegate loadingDelegate,
77
     LoadingDelegate loadingDelegate,
72
     PickType pickType = PickType.all,
78
     PickType pickType = PickType.all,
73
     BadgeDelegate badgeDelegate = const DefaultBadgeDelegate(),
79
     BadgeDelegate badgeDelegate = const DefaultBadgeDelegate(),
80
+    List<AssetPathEntity> photoPathList,
74
   }) {
81
   }) {
75
     assert(provider != null, "provider must be not null");
82
     assert(provider != null, "provider must be not null");
76
     assert(context != null, "context must be not null");
83
     assert(context != null, "context must be not null");
107
       context,
114
       context,
108
       options,
115
       options,
109
       provider,
116
       provider,
117
+      photoPathList,
110
     );
118
     );
111
   }
119
   }
112
 
120
 
114
     BuildContext context,
122
     BuildContext context,
115
     Options options,
123
     Options options,
116
     I18nProvider provider,
124
     I18nProvider provider,
125
+    List<AssetPathEntity> photoList,
117
   ) async {
126
   ) async {
118
     var requestPermission = await PhotoManager.requestPermission();
127
     var requestPermission = await PhotoManager.requestPermission();
119
     if (requestPermission != true) {
128
     if (requestPermission != true) {
129
       return null;
138
       return null;
130
     }
139
     }
131
 
140
 
132
-    return _openGalleryContentPage(context, options, provider);
141
+    return _openGalleryContentPage(context, options, provider, photoList);
133
   }
142
   }
134
 
143
 
135
-  Future<List<AssetEntity>> _openGalleryContentPage(BuildContext context, Options options, I18nProvider provider) async {
144
+  Future<List<AssetEntity>> _openGalleryContentPage(
145
+    BuildContext context,
146
+    Options options,
147
+    I18nProvider provider,
148
+    List<AssetPathEntity> photoList,
149
+  ) async {
136
     return Navigator.of(context).push(
150
     return Navigator.of(context).push(
137
       MaterialPageRoute(
151
       MaterialPageRoute(
138
         builder: (ctx) => PhotoApp(
152
         builder: (ctx) => PhotoApp(
139
               options: options,
153
               options: options,
140
               provider: provider,
154
               provider: provider,
155
+              photoList: photoList,
141
             ),
156
             ),
142
       ),
157
       ),
143
     );
158
     );

+ 2
- 1
lib/src/delegate/sort_delegate.dart View File

60
   }
60
   }
61
 
61
 
62
   bool _isScreenShot(AssetPathEntity entity) {
62
   bool _isScreenShot(AssetPathEntity entity) {
63
-    return entity.name.toUpperCase() == "screenshots".toUpperCase() || entity.name.toUpperCase() == "screenshot".toUpperCase();
63
+    return entity.name.toUpperCase() == "screenshots".toUpperCase() ||
64
+        entity.name.toUpperCase() == "screenshot".toUpperCase();
64
   }
65
   }
65
 }
66
 }

+ 2
- 1
lib/src/provider/config_provider.dart View File

18
     return true;
18
     return true;
19
   }
19
   }
20
 
20
 
21
-  static ConfigProvider of(BuildContext context) => context.inheritFromWidgetOfExactType(ConfigProvider);
21
+  static ConfigProvider of(BuildContext context) =>
22
+      context.inheritFromWidgetOfExactType(ConfigProvider);
22
 }
23
 }

+ 1
- 1
lib/src/provider/i18n_provider.dart View File

102
 
102
 
103
   @override
103
   @override
104
   String getAllGalleryText(Options options) {
104
   String getAllGalleryText(Options options) {
105
-    return "all";
105
+    return "Recent";
106
   }
106
   }
107
 
107
 
108
   @override
108
   @override

+ 19
- 2
lib/src/ui/dialog/change_gallery_dialog.dart View File

1
 import 'package:flutter/material.dart';
1
 import 'package:flutter/material.dart';
2
+import 'package:photo/src/entity/options.dart';
3
+import 'package:photo/src/provider/i18n_provider.dart';
2
 import 'package:photo_manager/photo_manager.dart';
4
 import 'package:photo_manager/photo_manager.dart';
3
 
5
 
4
 class ChangeGalleryDialog extends StatefulWidget {
6
 class ChangeGalleryDialog extends StatefulWidget {
5
   final List<AssetPathEntity> galleryList;
7
   final List<AssetPathEntity> galleryList;
8
+  final I18nProvider i18n;
9
+  final Options options;
6
 
10
 
7
-  const ChangeGalleryDialog({Key key, this.galleryList}) : super(key: key);
11
+  const ChangeGalleryDialog({
12
+    Key key,
13
+    this.galleryList,
14
+    this.i18n,
15
+    this.options,
16
+  }) : super(key: key);
8
 
17
 
9
   @override
18
   @override
10
   _ChangeGalleryDialogState createState() => _ChangeGalleryDialogState();
19
   _ChangeGalleryDialogState createState() => _ChangeGalleryDialogState();
23
 
32
 
24
   Widget _buildItem(BuildContext context, int index) {
33
   Widget _buildItem(BuildContext context, int index) {
25
     var entity = widget.galleryList[index];
34
     var entity = widget.galleryList[index];
35
+    String text;
36
+
37
+    if (entity.isAll) {
38
+      text = widget.i18n?.getAllGalleryText(widget.options);
39
+    }
40
+
41
+    text = text ?? entity.name;
42
+
26
     return FlatButton(
43
     return FlatButton(
27
       child: ListTile(
44
       child: ListTile(
28
-        title: Text(entity.name),
45
+        title: Text(text),
29
       ),
46
       ),
30
       onPressed: () {
47
       onPressed: () {
31
         Navigator.pop(context, entity);
48
         Navigator.pop(context, entity);

+ 44
- 7
lib/src/ui/page/photo_main_page.dart View File

17
 class PhotoMainPage extends StatefulWidget {
17
 class PhotoMainPage extends StatefulWidget {
18
   final ValueChanged<List<AssetEntity>> onClose;
18
   final ValueChanged<List<AssetEntity>> onClose;
19
   final Options options;
19
   final Options options;
20
+  final List<AssetPathEntity> photoList;
20
 
21
 
21
   const PhotoMainPage({
22
   const PhotoMainPage({
22
     Key key,
23
     Key key,
23
     this.onClose,
24
     this.onClose,
24
     this.options,
25
     this.options,
26
+    this.photoList,
25
   }) : super(key: key);
27
   }) : super(key: key);
26
 
28
 
27
   @override
29
   @override
28
   _PhotoMainPageState createState() => _PhotoMainPageState();
30
   _PhotoMainPageState createState() => _PhotoMainPageState();
29
 }
31
 }
30
 
32
 
31
-class _PhotoMainPageState extends State<PhotoMainPage> with SelectedProvider, GalleryListProvider {
33
+class _PhotoMainPageState extends State<PhotoMainPage>
34
+    with SelectedProvider, GalleryListProvider {
32
   Options get options => widget.options;
35
   Options get options => widget.options;
33
 
36
 
34
   I18nProvider get i18nProvider => ConfigProvider.of(context).provider;
37
   I18nProvider get i18nProvider => ConfigProvider.of(context).provider;
52
     _currentPath = value;
55
     _currentPath = value;
53
   }
56
   }
54
 
57
 
58
+  String get currentGalleryName {
59
+    if (currentPath.isAll) {
60
+      return i18nProvider.getAllGalleryText(options);
61
+    }
62
+    return currentPath.name;
63
+  }
64
+
55
   GlobalKey scaffoldKey;
65
   GlobalKey scaffoldKey;
56
   ScrollController scrollController;
66
   ScrollController scrollController;
57
 
67
 
95
                 splashColor: Colors.transparent,
105
                 splashColor: Colors.transparent,
96
                 child: Text(
106
                 child: Text(
97
                   i18nProvider.getSureText(options, selectedCount),
107
                   i18nProvider.getSureText(options, selectedCount),
98
-                  style: selectedCount == 0 ? textStyle.copyWith(color: options.disableColor) : textStyle,
108
+                  style: selectedCount == 0
109
+                      ? textStyle.copyWith(color: options.disableColor)
110
+                      : textStyle,
99
                 ),
111
                 ),
100
                 onPressed: selectedCount == 0 ? null : sure,
112
                 onPressed: selectedCount == 0 ? null : sure,
101
               ),
113
               ),
106
             key: scaffoldKey,
118
             key: scaffoldKey,
107
             provider: i18nProvider,
119
             provider: i18nProvider,
108
             options: options,
120
             options: options,
109
-            galleryName: currentPath.name,
121
+            galleryName: currentGalleryName,
110
             onGalleryChange: _onGalleryChange,
122
             onGalleryChange: _onGalleryChange,
111
             onTapPreview: selectedList.isEmpty ? null : _onTapPreview,
123
             onTapPreview: selectedList.isEmpty ? null : _onTapPreview,
112
             selectedProvider: this,
124
             selectedProvider: this,
152
     );
164
     );
153
   }
165
   }
154
 
166
 
155
-  Future<void> _refreshList() async {
167
+  void _refreshList() {
168
+    if (widget.photoList != null && widget.photoList.isNotEmpty) {
169
+      _refreshListFromWidget();
170
+      return;
171
+    }
172
+
173
+    _refreshListFromGallery();
174
+  }
175
+
176
+  Future<void> _refreshListFromWidget() async {
177
+    galleryPathList.clear();
178
+    galleryPathList.addAll(widget.photoList);
179
+    this.list.clear();
180
+    var assetList = await galleryPathList[0].assetList;
181
+    this.list.addAll(assetList);
182
+    setState(() {
183
+      _isInit = true;
184
+    });
185
+  }
186
+
187
+  Future<void> _refreshListFromGallery() async {
156
     List<AssetPathEntity> pathList;
188
     List<AssetPathEntity> pathList;
157
     switch (options.pickType) {
189
     switch (options.pickType) {
158
       case PickType.onlyImage:
190
       case PickType.onlyImage:
483
                   height: 44.0,
515
                   height: 44.0,
484
                   alignment: Alignment.center,
516
                   alignment: Alignment.center,
485
                   child: Text(
517
                   child: Text(
486
-                    i18nProvider.getPreviewText(options, widget.selectedProvider),
518
+                    i18nProvider.getPreviewText(
519
+                        options, widget.selectedProvider),
487
                     style: textStyle,
520
                     style: textStyle,
488
                   ),
521
                   ),
489
                   padding: textPadding,
522
                   padding: textPadding,
501
       context: context,
534
       context: context,
502
       builder: (ctx) => ChangeGalleryDialog(
535
       builder: (ctx) => ChangeGalleryDialog(
503
             galleryList: widget.galleryListProvider.galleryPathList,
536
             galleryList: widget.galleryListProvider.galleryPathList,
537
+            i18n: i18nProvider,
538
+            options: options,
504
           ),
539
           ),
505
     );
540
     );
506
 
541
 
539
       future: entity.thumbDataWithSize(size, size),
574
       future: entity.thumbDataWithSize(size, size),
540
       builder: (BuildContext context, AsyncSnapshot<Uint8List> snapshot) {
575
       builder: (BuildContext context, AsyncSnapshot<Uint8List> snapshot) {
541
         var futureData = snapshot.data;
576
         var futureData = snapshot.data;
542
-        if (snapshot.connectionState == ConnectionState.done && futureData != null) {
577
+        if (snapshot.connectionState == ConnectionState.done &&
578
+            futureData != null) {
543
           ImageLruCache.setData(entity, size, futureData);
579
           ImageLruCache.setData(entity, size, futureData);
544
           return _buildImageItem(context, futureData);
580
           return _buildImageItem(context, futureData);
545
         }
581
         }
566
       future: entity.videoDuration,
602
       future: entity.videoDuration,
567
       builder: (ctx, snapshot) {
603
       builder: (ctx, snapshot) {
568
         if (snapshot.hasData && snapshot != null) {
604
         if (snapshot.hasData && snapshot != null) {
569
-          var buildBadge = badgeDelegate?.buildBadge(context, entity.type, snapshot.data);
605
+          var buildBadge =
606
+              badgeDelegate?.buildBadge(context, entity.type, snapshot.data);
570
           if (buildBadge == null) {
607
           if (buildBadge == null) {
571
             return Container();
608
             return Container();
572
           } else {
609
           } else {

+ 11
- 3
lib/src/ui/photo_app.dart View File

1
 import 'package:flutter/material.dart';
1
 import 'package:flutter/material.dart';
2
+
3
+import 'package:photo_manager/photo_manager.dart';
4
+
2
 import 'package:photo/src/entity/options.dart';
5
 import 'package:photo/src/entity/options.dart';
3
 import 'package:photo/src/provider/config_provider.dart';
6
 import 'package:photo/src/provider/config_provider.dart';
4
 import 'package:photo/src/provider/i18n_provider.dart';
7
 import 'package:photo/src/provider/i18n_provider.dart';
5
 import 'package:photo/src/ui/page/photo_main_page.dart';
8
 import 'package:photo/src/ui/page/photo_main_page.dart';
6
-import 'package:photo_manager/photo_manager.dart';
7
 
9
 
8
 class PhotoApp extends StatelessWidget {
10
 class PhotoApp extends StatelessWidget {
9
   final Options options;
11
   final Options options;
10
   final I18nProvider provider;
12
   final I18nProvider provider;
11
-
12
-  const PhotoApp({Key key, this.options, this.provider}) : super(key: key);
13
+  final List<AssetPathEntity> photoList;
14
+  const PhotoApp({
15
+    Key key,
16
+    this.options,
17
+    this.provider,
18
+    this.photoList,
19
+  }) : super(key: key);
13
 
20
 
14
   @override
21
   @override
15
   Widget build(BuildContext context) {
22
   Widget build(BuildContext context) {
21
           Navigator.pop(context, value);
28
           Navigator.pop(context, value);
22
         },
29
         },
23
         options: options,
30
         options: options,
31
+        photoList: photoList,
24
       ),
32
       ),
25
     );
33
     );
26
   }
34
   }

+ 19
- 19
pubspec.lock View File

5
     dependency: transitive
5
     dependency: transitive
6
     description:
6
     description:
7
       name: async
7
       name: async
8
-      url: "https://pub.dartlang.org"
8
+      url: "https://pub.flutter-io.cn"
9
     source: hosted
9
     source: hosted
10
     version: "2.0.8"
10
     version: "2.0.8"
11
   boolean_selector:
11
   boolean_selector:
12
     dependency: transitive
12
     dependency: transitive
13
     description:
13
     description:
14
       name: boolean_selector
14
       name: boolean_selector
15
-      url: "https://pub.dartlang.org"
15
+      url: "https://pub.flutter-io.cn"
16
     source: hosted
16
     source: hosted
17
     version: "1.0.4"
17
     version: "1.0.4"
18
   charcode:
18
   charcode:
19
     dependency: transitive
19
     dependency: transitive
20
     description:
20
     description:
21
       name: charcode
21
       name: charcode
22
-      url: "https://pub.dartlang.org"
22
+      url: "https://pub.flutter-io.cn"
23
     source: hosted
23
     source: hosted
24
     version: "1.1.2"
24
     version: "1.1.2"
25
   collection:
25
   collection:
26
     dependency: transitive
26
     dependency: transitive
27
     description:
27
     description:
28
       name: collection
28
       name: collection
29
-      url: "https://pub.dartlang.org"
29
+      url: "https://pub.flutter-io.cn"
30
     source: hosted
30
     source: hosted
31
     version: "1.14.11"
31
     version: "1.14.11"
32
   flutter:
32
   flutter:
43
     dependency: transitive
43
     dependency: transitive
44
     description:
44
     description:
45
       name: matcher
45
       name: matcher
46
-      url: "https://pub.dartlang.org"
46
+      url: "https://pub.flutter-io.cn"
47
     source: hosted
47
     source: hosted
48
     version: "0.12.3+1"
48
     version: "0.12.3+1"
49
   meta:
49
   meta:
50
     dependency: transitive
50
     dependency: transitive
51
     description:
51
     description:
52
       name: meta
52
       name: meta
53
-      url: "https://pub.dartlang.org"
53
+      url: "https://pub.flutter-io.cn"
54
     source: hosted
54
     source: hosted
55
     version: "1.1.6"
55
     version: "1.1.6"
56
   path:
56
   path:
57
     dependency: transitive
57
     dependency: transitive
58
     description:
58
     description:
59
       name: path
59
       name: path
60
-      url: "https://pub.dartlang.org"
60
+      url: "https://pub.flutter-io.cn"
61
     source: hosted
61
     source: hosted
62
     version: "1.6.2"
62
     version: "1.6.2"
63
   pedantic:
63
   pedantic:
64
     dependency: transitive
64
     dependency: transitive
65
     description:
65
     description:
66
       name: pedantic
66
       name: pedantic
67
-      url: "https://pub.dartlang.org"
67
+      url: "https://pub.flutter-io.cn"
68
     source: hosted
68
     source: hosted
69
     version: "1.4.0"
69
     version: "1.4.0"
70
   photo_manager:
70
   photo_manager:
71
     dependency: "direct main"
71
     dependency: "direct main"
72
     description:
72
     description:
73
       name: photo_manager
73
       name: photo_manager
74
-      url: "https://pub.dartlang.org"
74
+      url: "https://pub.flutter-io.cn"
75
     source: hosted
75
     source: hosted
76
     version: "0.2.1"
76
     version: "0.2.1"
77
   quiver:
77
   quiver:
78
     dependency: transitive
78
     dependency: transitive
79
     description:
79
     description:
80
       name: quiver
80
       name: quiver
81
-      url: "https://pub.dartlang.org"
81
+      url: "https://pub.flutter-io.cn"
82
     source: hosted
82
     source: hosted
83
     version: "2.0.1"
83
     version: "2.0.1"
84
   sky_engine:
84
   sky_engine:
90
     dependency: transitive
90
     dependency: transitive
91
     description:
91
     description:
92
       name: source_span
92
       name: source_span
93
-      url: "https://pub.dartlang.org"
93
+      url: "https://pub.flutter-io.cn"
94
     source: hosted
94
     source: hosted
95
-    version: "1.5.3"
95
+    version: "1.5.4"
96
   stack_trace:
96
   stack_trace:
97
     dependency: transitive
97
     dependency: transitive
98
     description:
98
     description:
99
       name: stack_trace
99
       name: stack_trace
100
-      url: "https://pub.dartlang.org"
100
+      url: "https://pub.flutter-io.cn"
101
     source: hosted
101
     source: hosted
102
     version: "1.9.3"
102
     version: "1.9.3"
103
   stream_channel:
103
   stream_channel:
104
     dependency: transitive
104
     dependency: transitive
105
     description:
105
     description:
106
       name: stream_channel
106
       name: stream_channel
107
-      url: "https://pub.dartlang.org"
107
+      url: "https://pub.flutter-io.cn"
108
     source: hosted
108
     source: hosted
109
     version: "1.6.8"
109
     version: "1.6.8"
110
   string_scanner:
110
   string_scanner:
111
     dependency: transitive
111
     dependency: transitive
112
     description:
112
     description:
113
       name: string_scanner
113
       name: string_scanner
114
-      url: "https://pub.dartlang.org"
114
+      url: "https://pub.flutter-io.cn"
115
     source: hosted
115
     source: hosted
116
     version: "1.0.4"
116
     version: "1.0.4"
117
   term_glyph:
117
   term_glyph:
118
     dependency: transitive
118
     dependency: transitive
119
     description:
119
     description:
120
       name: term_glyph
120
       name: term_glyph
121
-      url: "https://pub.dartlang.org"
121
+      url: "https://pub.flutter-io.cn"
122
     source: hosted
122
     source: hosted
123
     version: "1.1.0"
123
     version: "1.1.0"
124
   test_api:
124
   test_api:
125
     dependency: transitive
125
     dependency: transitive
126
     description:
126
     description:
127
       name: test_api
127
       name: test_api
128
-      url: "https://pub.dartlang.org"
128
+      url: "https://pub.flutter-io.cn"
129
     source: hosted
129
     source: hosted
130
     version: "0.2.2"
130
     version: "0.2.2"
131
   typed_data:
131
   typed_data:
132
     dependency: transitive
132
     dependency: transitive
133
     description:
133
     description:
134
       name: typed_data
134
       name: typed_data
135
-      url: "https://pub.dartlang.org"
135
+      url: "https://pub.flutter-io.cn"
136
     source: hosted
136
     source: hosted
137
     version: "1.1.6"
137
     version: "1.1.6"
138
   vector_math:
138
   vector_math:
139
     dependency: transitive
139
     dependency: transitive
140
     description:
140
     description:
141
       name: vector_math
141
       name: vector_math
142
-      url: "https://pub.dartlang.org"
142
+      url: "https://pub.flutter-io.cn"
143
     source: hosted
143
     source: hosted
144
     version: "2.0.8"
144
     version: "2.0.8"
145
 sdks:
145
 sdks:

+ 1
- 1
pubspec.yaml View File

1
 name: photo
1
 name: photo
2
 description: image picker, multi picker support video / icloud asset ,use flutter as ui, if you want to build custom ui,you just use photo_manager.
2
 description: image picker, multi picker support video / icloud asset ,use flutter as ui, if you want to build custom ui,you just use photo_manager.
3
-version: 0.2.0
3
+version: 0.2.1
4
 author: caijinglong<cjl_spy@163.com>
4
 author: caijinglong<cjl_spy@163.com>
5
 homepage: https://github.com/CaiJingLong/flutter_photo
5
 homepage: https://github.com/CaiJingLong/flutter_photo
6
 
6