Browse Source

add provider

lucky1213 4 years ago
parent
commit
defd7e941e

+ 21
- 13
lib/photo.dart View File

5
 import 'package:flutter/material.dart';
5
 import 'package:flutter/material.dart';
6
 import 'package:photo/src/entity/_theme.dart';
6
 import 'package:photo/src/entity/_theme.dart';
7
 import 'package:photo/src/ui/page/photo_list_page.dart';
7
 import 'package:photo/src/ui/page/photo_list_page.dart';
8
+import 'package:photo/src/ui/page/photo_main_page.dart';
8
 
9
 
9
 import 'package:photo_manager/photo_manager.dart';
10
 import 'package:photo_manager/photo_manager.dart';
10
 
11
 
15
 import 'package:photo/src/entity/options.dart';
16
 import 'package:photo/src/entity/options.dart';
16
 import 'package:photo/src/provider/i18n_provider.dart';
17
 import 'package:photo/src/provider/i18n_provider.dart';
17
 import 'package:photo/src/ui/dialog/not_permission_dialog.dart';
18
 import 'package:photo/src/ui/dialog/not_permission_dialog.dart';
18
-import 'package:photo/src/ui/photo_app.dart';
19
+import 'package:provider/provider.dart';
19
 
20
 
20
 import 'src/provider/config_provider.dart';
21
 import 'src/provider/config_provider.dart';
21
 export 'package:photo/src/delegate/checkbox_builder_delegate.dart';
22
 export 'package:photo/src/delegate/checkbox_builder_delegate.dart';
165
     assert(context != null, "context must be not null");
166
     assert(context != null, "context must be not null");
166
     assert(pickType != null, "pickType must be not null");
167
     assert(pickType != null, "pickType must be not null");
167
 
168
 
168
-    final pickerProvider = PhotoPickerProvider(
169
-      provider: provider,
170
-      options: options,
171
-      pickedAssetList: pickedAssetList,
169
+    return ChangeNotifierProvider(
170
+      create: (_) => PhotoProvider(
171
+        provider: provider,
172
+        options: options,
173
+        pickedAssetList: pickedAssetList,
174
+      ),
172
       child: PhotoListPage(
175
       child: PhotoListPage(
173
         onSelected: onSelected,
176
         onSelected: onSelected,
174
         options: options,
177
         options: options,
175
-        photoList: photoPathList,
176
       ),
178
       ),
177
     );
179
     );
178
-
179
-    return pickerProvider;
180
   }
180
   }
181
 
181
 
182
   Future<void> requestPermission(BuildContext context, {@required I18nProvider provider}) async {
182
   Future<void> requestPermission(BuildContext context, {@required I18nProvider provider}) async {
204
   ) async {
204
   ) async {
205
     return Navigator.of(context, rootNavigator: true).push(
205
     return Navigator.of(context, rootNavigator: true).push(
206
       MaterialPageRoute(
206
       MaterialPageRoute(
207
-        builder: (ctx) => PhotoApp(
208
-          options: options,
209
-          provider: provider,
210
-          photoList: photoList,
211
-          pickedAssetList: pickedAssetList,
207
+        builder: (ctx) => ChangeNotifierProvider(
208
+          create: (_) => PhotoProvider(
209
+            provider: provider,
210
+            options: options,
211
+            pickedAssetList: pickedAssetList,
212
+          ),
213
+          child: PhotoMainPage(
214
+            onClose: (List<AssetEntity> value) {
215
+              Navigator.pop(context, value);
216
+            },
217
+            options: options,
218
+            photoList: photoList,
219
+          ),
212
         ),
220
         ),
213
       ),
221
       ),
214
     );
222
     );

+ 8
- 14
lib/src/provider/config_provider.dart View File

5
 import 'package:photo_manager/photo_manager.dart';
5
 import 'package:photo_manager/photo_manager.dart';
6
 
6
 
7
 // ignore_for_file: deprecated_member_use
7
 // ignore_for_file: deprecated_member_use
8
-class PhotoPickerProvider extends InheritedWidget {
8
+
9
+class PhotoProvider extends ChangeNotifier {
9
   final Options options;
10
   final Options options;
10
   final I18nProvider provider;
11
   final I18nProvider provider;
11
   final AssetProvider assetProvider = AssetProvider();
12
   final AssetProvider assetProvider = AssetProvider();
12
   final List<AssetEntity> pickedAssetList;
13
   final List<AssetEntity> pickedAssetList;
13
-  PhotoPickerProvider({
14
+  PhotoProvider({
14
     @required this.options,
15
     @required this.options,
15
     @required this.provider,
16
     @required this.provider,
16
-    @required Widget child,
17
-    this.pickedAssetList,
18
-    Key key,
19
-  }) : super(key: key, child: child);
17
+    List<AssetEntity> pickedAssetList,
18
+  }) : this.pickedAssetList = pickedAssetList ?? [];
19
+  
20
 
20
 
21
   @override
21
   @override
22
-  bool updateShouldNotify(InheritedWidget oldWidget) {
23
-    return true;
22
+  void notifyListeners() {
23
+    super.notifyListeners();
24
   }
24
   }
25
-
26
-  static PhotoPickerProvider of(BuildContext context) =>
27
-      context.inheritFromWidgetOfExactType(PhotoPickerProvider);
28
-
29
-  static AssetProvider assetProviderOf(BuildContext context) =>
30
-      of(context).assetProvider;
31
 }
25
 }

+ 28
- 28
lib/src/ui/page/photo_list_page.dart View File

6
 import 'package:photo/src/provider/selected_provider.dart';
6
 import 'package:photo/src/provider/selected_provider.dart';
7
 import 'package:photo/src/provider/asset_provider.dart';
7
 import 'package:photo/src/provider/asset_provider.dart';
8
 import 'package:photo/src/provider/config_provider.dart';
8
 import 'package:photo/src/provider/config_provider.dart';
9
+import 'package:provider/provider.dart';
9
 
10
 
10
 import 'photo_main_page.dart';
11
 import 'photo_main_page.dart';
11
 import 'photo_preview_page.dart';
12
 import 'photo_preview_page.dart';
14
 class PhotoListPage extends StatefulWidget {
15
 class PhotoListPage extends StatefulWidget {
15
   final ValueChanged<List<AssetEntity>> onSelected;
16
   final ValueChanged<List<AssetEntity>> onSelected;
16
   final ListOptions options;
17
   final ListOptions options;
17
-  final List<AssetPathEntity> photoList;
18
 
18
 
19
   const PhotoListPage({
19
   const PhotoListPage({
20
     Key key,
20
     Key key,
21
     this.onSelected,
21
     this.onSelected,
22
     this.options,
22
     this.options,
23
-    this.photoList,
24
   }) : super(key: key);
23
   }) : super(key: key);
25
 
24
 
26
   @override
25
   @override
29
 
28
 
30
 class _PhotoListPageState extends State<PhotoListPage>
29
 class _PhotoListPageState extends State<PhotoListPage>
31
     with SelectedProvider, GalleryListProvider, WidgetsBindingObserver {
30
     with SelectedProvider, GalleryListProvider, WidgetsBindingObserver {
31
+  PhotoProvider get config => Provider.of<PhotoProvider>(context, listen: false);
32
   ListOptions get options => widget.options;
32
   ListOptions get options => widget.options;
33
-  I18nProvider get i18nProvider => PhotoPickerProvider.of(context).provider;
34
-  AssetProvider get assetProvider => PhotoPickerProvider.of(context).assetProvider;
33
+  I18nProvider get i18nProvider => config.provider;
34
+  AssetProvider get assetProvider => config.assetProvider;
35
   List<AssetEntity> get list => assetProvider.data;
35
   List<AssetEntity> get list => assetProvider.data;
36
 
36
 
37
   bool _isInit = false;
37
   bool _isInit = false;
48
     super.initState();
48
     super.initState();
49
     scaffoldKey = GlobalKey();
49
     scaffoldKey = GlobalKey();
50
     scrollController = ScrollController();
50
     scrollController = ScrollController();
51
-    // WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
52
-    //   var requestPermission = await PhotoManager.requestPermission();
53
-    //   if (requestPermission != true) {
54
-    //     var result = await showDialog(
55
-    //       context: context,
56
-    //       builder: (ctx) => NotPermissionDialog(
57
-    //         provider.getNotPermissionText(),
58
-    //       ),
59
-    //     );
60
-    //     if (result == true) {
61
-    //       PhotoManager.openSetting();
62
-    //     }
63
-    //     return null;
64
-    //   }
65
-    // });
51
+    WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
52
+      // var requestPermission = await PhotoManager.requestPermission();
53
+      // if (requestPermission != true) {
54
+      //   var result = await showDialog(
55
+      //     context: context,
56
+      //     builder: (ctx) => NotPermissionDialog(
57
+      //       provider.getNotPermissionText(),
58
+      //     ),
59
+      //   );
60
+      //   if (result == true) {
61
+      //     PhotoManager.openSetting();
62
+      //   }
63
+      //   return null;
64
+      // }
65
+      if (!_isInit) {
66
+        final pickedList = config.pickedAssetList ?? [];
67
+        addPickedAsset(pickedList.toList());
68
+        _refreshList();
69
+      }
70
+    });
66
   }
71
   }
67
 
72
 
68
   @override
73
   @override
69
   void didChangeDependencies() {
74
   void didChangeDependencies() {
70
     super.didChangeDependencies();
75
     super.didChangeDependencies();
71
-    if (!_isInit) {
72
-      final pickedList = PhotoPickerProvider.of(context).pickedAssetList ?? [];
73
-      addPickedAsset(pickedList.toList());
74
-      _refreshList();
75
-    }
76
   }
76
   }
77
 
77
 
78
   @override
78
   @override
160
   @override
160
   @override
161
   Widget build(BuildContext context) {
161
   Widget build(BuildContext context) {
162
     if (!_isInit) {
162
     if (!_isInit) {
163
-      return _buildLoading();
163
+      return Container();
164
+      // return _buildLoading();
164
     }
165
     }
165
     final noMore = assetProvider.noMore;
166
     final noMore = assetProvider.noMore;
166
 
167
 
279
     Navigator.of(context).push(
280
     Navigator.of(context).push(
280
       MaterialPageRoute(
281
       MaterialPageRoute(
281
         builder: (ctx) {
282
         builder: (ctx) {
282
-          return PhotoPickerProvider(
283
-            provider: PhotoPickerProvider.of(context).provider,
284
-            options: options,
283
+          return ChangeNotifierProvider.value(
284
+            value: config,
285
             child: PhotoPreviewPage(
285
             child: PhotoPreviewPage(
286
               selectedProvider: this,
286
               selectedProvider: this,
287
               list: List.of(list),
287
               list: List.of(list),

+ 81
- 69
lib/src/ui/page/photo_main_page.dart View File

17
 import 'package:photo/src/ui/page/main/empty_widget.dart';
17
 import 'package:photo/src/ui/page/main/empty_widget.dart';
18
 import 'package:photo/src/ui/page/photo_preview_page.dart';
18
 import 'package:photo/src/ui/page/photo_preview_page.dart';
19
 import 'package:photo_manager/photo_manager.dart';
19
 import 'package:photo_manager/photo_manager.dart';
20
+import 'package:provider/provider.dart';
20
 
21
 
21
 part './main/bottom_widget.dart';
22
 part './main/bottom_widget.dart';
22
 part './main/image_item.dart';
23
 part './main/image_item.dart';
39
 
40
 
40
 class _PhotoMainPageState extends State<PhotoMainPage>
41
 class _PhotoMainPageState extends State<PhotoMainPage>
41
     with SelectedProvider, GalleryListProvider {
42
     with SelectedProvider, GalleryListProvider {
43
+  PhotoProvider get config =>
44
+      Provider.of<PhotoProvider>(context, listen: false);
42
   Options get options => widget.options;
45
   Options get options => widget.options;
43
-
44
-  I18nProvider get i18nProvider => PhotoPickerProvider.of(context).provider;
45
-  AssetProvider get assetProvider =>
46
-      PhotoPickerProvider.of(context).assetProvider;
46
+  I18nProvider get i18nProvider => config.provider;
47
+  AssetProvider get assetProvider => config.assetProvider;
47
 
48
 
48
   List<AssetEntity> get list => assetProvider.data;
49
   List<AssetEntity> get list => assetProvider.data;
49
 
50
 
81
   void didChangeDependencies() {
82
   void didChangeDependencies() {
82
     super.didChangeDependencies();
83
     super.didChangeDependencies();
83
     if (!_isInit) {
84
     if (!_isInit) {
84
-      final pickedList = PhotoPickerProvider.of(context).pickedAssetList ?? [];
85
+      final pickedList = config.pickedAssetList ?? [];
85
       addPickedAsset(pickedList.toList());
86
       addPickedAsset(pickedList.toList());
86
       _refreshList();
87
       _refreshList();
87
     }
88
     }
130
               Material(
131
               Material(
131
                 color: options.theme.surfaceColor,
132
                 color: options.theme.surfaceColor,
132
                 child: Container(
133
                 child: Container(
133
-                  height: MediaQuery.of(context).size.height * 0.5 - MediaQuery.of(context).padding.top,
134
+                  height: MediaQuery.of(context).size.height * 0.5 -
135
+                      MediaQuery.of(context).padding.top,
134
                   child: ChangeGalleryDialog(
136
                   child: ChangeGalleryDialog(
135
-                    galleryList: galleryPathList,
136
-                    i18n: i18nProvider,
137
-                    options: options,
138
-                    current: assetProvider.current,
139
-                    onGalleryChange: (AssetPathEntity result) {
140
-                      _onGalleryChange?.call(result);
141
-                    }
142
-                  ),
137
+                      galleryList: galleryPathList,
138
+                      i18n: i18nProvider,
139
+                      options: options,
140
+                      current: assetProvider.current,
141
+                      onGalleryChange: (AssetPathEntity result) {
142
+                        _onGalleryChange?.call(result);
143
+                      }),
143
                 ),
144
                 ),
144
               ),
145
               ),
145
             ],
146
             ],
169
             splashColor: Colors.transparent,
170
             splashColor: Colors.transparent,
170
             highlightColor: Colors.transparent,
171
             highlightColor: Colors.transparent,
171
             child: Container(
172
             child: Container(
172
-              alignment: Alignment.center,
173
-              height: 44.0,
174
-              padding: EdgeInsets.zero.copyWith(right: kToolbarHeight),
175
-              child: Row(
176
-                mainAxisAlignment: MainAxisAlignment.center,
177
-                children: [
178
-                  Text(currentGalleryName, style: options.theme.textStyle.apply(
179
-                    fontSizeDelta: 2.0,
180
-                    fontWeightDelta: 1,
181
-                  ),),
182
-                  Container(
183
-                    width: 18,
184
-                    height: 18,
185
-                    margin: EdgeInsets.only(left: 8),
186
-                    decoration: ShapeDecoration(shape: CircleBorder(
187
-                      side: BorderSide(
188
-                        color: options.theme.onSurfaceColor,
189
-                        width: 1.5
173
+                alignment: Alignment.center,
174
+                height: 44.0,
175
+                padding: EdgeInsets.zero.copyWith(right: kToolbarHeight),
176
+                child: Row(
177
+                  mainAxisAlignment: MainAxisAlignment.center,
178
+                  children: [
179
+                    Text(
180
+                      currentGalleryName,
181
+                      style: options.theme.textStyle.apply(
182
+                        fontSizeDelta: 2.0,
183
+                        fontWeightDelta: 1,
190
                       ),
184
                       ),
191
-                    )),
192
-                    child: AnimatedSwitcher(
193
-                      transitionBuilder: (child, animation){
194
-                        final Tween<double> tween = overlayEntry != null ? Tween(begin: -0.25, end: 0.25) : Tween(begin: 0.25, end: 0.75);
195
-                        //var tween = Tween(begin: -0.5, end: 0.0);
196
-                        return RotationTransition(child: child, turns: tween.animate(animation));
197
-                      },
198
-                      duration: Duration(milliseconds: 200),
199
-                      reverseDuration: Duration(milliseconds: 0),
200
-                      child: Icon(Icons.chevron_left, key: ValueKey(overlayEntry == null ? 0 : 1),  size: 14, color: options.theme.onSurfaceColor),
201
                     ),
185
                     ),
202
-                  ),
203
-                ],
204
-              )
205
-              
206
-            ),
186
+                    Container(
187
+                      width: 18,
188
+                      height: 18,
189
+                      margin: EdgeInsets.only(left: 8),
190
+                      decoration: ShapeDecoration(
191
+                          shape: CircleBorder(
192
+                        side: BorderSide(
193
+                            color: options.theme.onSurfaceColor, width: 1.5),
194
+                      )),
195
+                      child: AnimatedSwitcher(
196
+                        transitionBuilder: (child, animation) {
197
+                          final Tween<double> tween = overlayEntry != null
198
+                              ? Tween(begin: -0.25, end: 0.25)
199
+                              : Tween(begin: 0.25, end: 0.75);
200
+                          //var tween = Tween(begin: -0.5, end: 0.0);
201
+                          return RotationTransition(
202
+                              child: child, turns: tween.animate(animation));
203
+                        },
204
+                        duration: Duration(milliseconds: 200),
205
+                        reverseDuration: Duration(milliseconds: 0),
206
+                        child: Icon(Icons.chevron_left,
207
+                            key: ValueKey(overlayEntry == null ? 0 : 1),
208
+                            size: 14,
209
+                            color: options.theme.onSurfaceColor),
210
+                      ),
211
+                    ),
212
+                  ],
213
+                )),
207
           ),
214
           ),
208
         ),
215
         ),
209
         body: _buildBody(),
216
         body: _buildBody(),
248
       SnackBar(
255
       SnackBar(
249
         content: Text(
256
         content: Text(
250
           msg,
257
           msg,
251
-          style: options.theme.textStyle.copyWith(color: options.theme.onPrimaryColor),
258
+          style: options.theme.textStyle
259
+              .copyWith(color: options.theme.onPrimaryColor),
252
         ),
260
         ),
253
         duration: Duration(milliseconds: 1500),
261
         duration: Duration(milliseconds: 1500),
254
         backgroundColor: options.theme.primaryColor.withOpacity(0.7),
262
         backgroundColor: options.theme.primaryColor.withOpacity(0.7),
326
     return Container(
334
     return Container(
327
       color: options.theme.backgroundColor,
335
       color: options.theme.backgroundColor,
328
       padding: EdgeInsets.all(5),
336
       padding: EdgeInsets.all(5),
329
-      child: assetProvider.count == 0 ? DefaultEmptyDelegate().buildEmpty(context, options) : GridView.builder(
330
-        controller: scrollController,
331
-        gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
332
-          crossAxisCount: options.rowCount,
333
-          childAspectRatio: options.itemRadio,
334
-          crossAxisSpacing: options.padding,
335
-          mainAxisSpacing: options.padding,
336
-        ),
337
-        itemBuilder: _buildItem,
338
-        itemCount: count,
339
-      ),
337
+      child: assetProvider.count == 0
338
+          ? DefaultEmptyDelegate().buildEmpty(context, options)
339
+          : GridView.builder(
340
+              controller: scrollController,
341
+              gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
342
+                crossAxisCount: options.rowCount,
343
+                childAspectRatio: options.itemRadio,
344
+                crossAxisSpacing: options.padding,
345
+                mainAxisSpacing: options.padding,
346
+              ),
347
+              itemBuilder: _buildItem,
348
+              itemCount: count,
349
+            ),
340
     );
350
     );
341
   }
351
   }
342
 
352
 
401
   Widget _buildText(AssetEntity entity) {
411
   Widget _buildText(AssetEntity entity) {
402
     var isSelected = containsEntity(entity);
412
     var isSelected = containsEntity(entity);
403
     Widget child;
413
     Widget child;
404
-    BoxDecoration decoration = BoxDecoration(borderRadius: BorderRadius.circular(1.0),);
414
+    BoxDecoration decoration = BoxDecoration(
415
+      borderRadius: BorderRadius.circular(1.0),
416
+    );
405
     if (isSelected) {
417
     if (isSelected) {
406
       child = Text(
418
       child = Text(
407
         (indexOfSelected(entity) + 1).toString(),
419
         (indexOfSelected(entity) + 1).toString(),
413
       );
425
       );
414
       decoration = decoration.copyWith(color: options.theme.primaryColor);
426
       decoration = decoration.copyWith(color: options.theme.primaryColor);
415
     } else {
427
     } else {
416
-      decoration = decoration.copyWith(border: Border.all(
417
-        color: options.theme.onPrimaryColor.withAlpha(200),
418
-      ),);
428
+      decoration = decoration.copyWith(
429
+        border: Border.all(
430
+          color: options.theme.onPrimaryColor.withAlpha(200),
431
+        ),
432
+      );
419
     }
433
     }
420
     return Padding(
434
     return Padding(
421
       padding: const EdgeInsets.all(8.0),
435
       padding: const EdgeInsets.all(8.0),
452
     Navigator.of(context).push(
466
     Navigator.of(context).push(
453
       MaterialPageRoute(
467
       MaterialPageRoute(
454
         builder: (ctx) {
468
         builder: (ctx) {
455
-          return PhotoPickerProvider(
456
-            provider: PhotoPickerProvider.of(context).provider,
457
-            options: options,
469
+          return ChangeNotifierProvider.value(
470
+            value: config,
458
             child: PhotoPreviewPage(
471
             child: PhotoPreviewPage(
459
               selectedProvider: this,
472
               selectedProvider: this,
460
               list: List.of(list),
473
               list: List.of(list),
482
     isPushed = true;
495
     isPushed = true;
483
     var v = await Navigator.of(context).push(
496
     var v = await Navigator.of(context).push(
484
       MaterialPageRoute(
497
       MaterialPageRoute(
485
-        builder: (ctx) => PhotoPickerProvider(
486
-          provider: PhotoPickerProvider.of(context).provider,
487
-          options: options,
498
+        builder: (ctx) => ChangeNotifierProvider.value(
499
+          value: config,
488
           child: PhotoPreviewPage(
500
           child: PhotoPreviewPage(
489
             selectedProvider: this,
501
             selectedProvider: this,
490
             list: List.of(selectedList),
502
             list: List.of(selectedList),

+ 2
- 1
lib/src/ui/page/photo_preview_page.dart View File

9
 import 'package:photo/src/provider/selected_provider.dart';
9
 import 'package:photo/src/provider/selected_provider.dart';
10
 import 'package:photo/src/ui/page/photo_main_page.dart';
10
 import 'package:photo/src/ui/page/photo_main_page.dart';
11
 import 'package:photo_manager/photo_manager.dart';
11
 import 'package:photo_manager/photo_manager.dart';
12
+import 'package:provider/provider.dart';
12
 
13
 
13
 class PhotoPreviewPage extends StatefulWidget {
14
 class PhotoPreviewPage extends StatefulWidget {
14
   final SelectedProvider selectedProvider;
15
   final SelectedProvider selectedProvider;
44
 }
45
 }
45
 
46
 
46
 class _PhotoPreviewPageState extends State<PhotoPreviewPage> {
47
 class _PhotoPreviewPageState extends State<PhotoPreviewPage> {
47
-  PhotoPickerProvider get config => PhotoPickerProvider.of(context);
48
+  PhotoProvider get config => Provider.of<PhotoProvider>(context, listen: false);
48
   AssetProvider get assetProvider => widget.assetProvider;
49
   AssetProvider get assetProvider => widget.assetProvider;
49
 
50
 
50
   Options get options => config.options;
51
   Options get options => config.options;

+ 0
- 40
lib/src/ui/photo_app.dart View File

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

+ 15
- 0
pubspec.lock View File

88
       url: "https://pub.flutter-io.cn"
88
       url: "https://pub.flutter-io.cn"
89
     source: hosted
89
     source: hosted
90
     version: "1.1.8"
90
     version: "1.1.8"
91
+  nested:
92
+    dependency: transitive
93
+    description:
94
+      name: nested
95
+      url: "https://pub.flutter-io.cn"
96
+    source: hosted
97
+    version: "0.0.4"
91
   path:
98
   path:
92
     dependency: transitive
99
     dependency: transitive
93
     description:
100
     description:
109
       url: "https://pub.flutter-io.cn"
116
       url: "https://pub.flutter-io.cn"
110
     source: hosted
117
     source: hosted
111
     version: "0.5.1-dev.4"
118
     version: "0.5.1-dev.4"
119
+  provider:
120
+    dependency: "direct main"
121
+    description:
122
+      name: provider
123
+      url: "https://pub.flutter-io.cn"
124
+    source: hosted
125
+    version: "4.0.5"
112
   quiver:
126
   quiver:
113
     dependency: transitive
127
     dependency: transitive
114
     description:
128
     description:
186
     version: "3.6.1"
200
     version: "3.6.1"
187
 sdks:
201
 sdks:
188
   dart: ">=2.7.0 <3.0.0"
202
   dart: ">=2.7.0 <3.0.0"
203
+  flutter: ">=1.12.1"

+ 1
- 0
pubspec.yaml View File

12
     sdk: flutter
12
     sdk: flutter
13
 
13
 
14
   photo_manager: ^0.5.1-dev.2
14
   photo_manager: ^0.5.1-dev.2
15
+  provider: ^4.0.5
15
   # photo_manager:
16
   # photo_manager:
16
   #   git:
17
   #   git:
17
   #     url: https://github.com/CaiJingLong/flutter_photo_manager.git
18
   #     url: https://github.com/CaiJingLong/flutter_photo_manager.git