Browse Source

Update for picked asset error.

cjl_macbook 4 years ago
parent
commit
a0f2990004
3 changed files with 29 additions and 27 deletions
  1. 1
    0
      example/lib/main.dart
  2. 2
    1
      lib/src/ui/page/photo_main_page.dart
  3. 26
    26
      pubspec.lock

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

173
 
173
 
174
     if (imgList == null || imgList.isEmpty) {
174
     if (imgList == null || imgList.isEmpty) {
175
       showToast("No pick item.");
175
       showToast("No pick item.");
176
+      return;
176
     } else {
177
     } else {
177
       List<String> r = [];
178
       List<String> r = [];
178
       for (var e in imgList) {
179
       for (var e in imgList) {

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

92
   void didChangeDependencies() {
92
   void didChangeDependencies() {
93
     super.didChangeDependencies();
93
     super.didChangeDependencies();
94
     if (!_isInit) {
94
     if (!_isInit) {
95
-      addPickedAsset(PhotoPickerProvider.of(context).pickedAssetList.toList());
95
+      final pickedList = PhotoPickerProvider.of(context).pickedAssetList ?? [];
96
+      addPickedAsset(pickedList.toList());
96
       _refreshList();
97
       _refreshList();
97
     }
98
     }
98
   }
99
   }

+ 26
- 26
pubspec.lock View File

5
     dependency: transitive
5
     dependency: transitive
6
     description:
6
     description:
7
       name: archive
7
       name: archive
8
-      url: "https://pub.dartlang.org"
8
+      url: "https://pub.flutter-io.cn"
9
     source: hosted
9
     source: hosted
10
     version: "2.0.11"
10
     version: "2.0.11"
11
   args:
11
   args:
12
     dependency: transitive
12
     dependency: transitive
13
     description:
13
     description:
14
       name: args
14
       name: args
15
-      url: "https://pub.dartlang.org"
15
+      url: "https://pub.flutter-io.cn"
16
     source: hosted
16
     source: hosted
17
     version: "1.5.2"
17
     version: "1.5.2"
18
   async:
18
   async:
19
     dependency: transitive
19
     dependency: transitive
20
     description:
20
     description:
21
       name: async
21
       name: async
22
-      url: "https://pub.dartlang.org"
22
+      url: "https://pub.flutter-io.cn"
23
     source: hosted
23
     source: hosted
24
     version: "2.4.0"
24
     version: "2.4.0"
25
   boolean_selector:
25
   boolean_selector:
26
     dependency: transitive
26
     dependency: transitive
27
     description:
27
     description:
28
       name: boolean_selector
28
       name: boolean_selector
29
-      url: "https://pub.dartlang.org"
29
+      url: "https://pub.flutter-io.cn"
30
     source: hosted
30
     source: hosted
31
     version: "1.0.5"
31
     version: "1.0.5"
32
   charcode:
32
   charcode:
33
     dependency: transitive
33
     dependency: transitive
34
     description:
34
     description:
35
       name: charcode
35
       name: charcode
36
-      url: "https://pub.dartlang.org"
36
+      url: "https://pub.flutter-io.cn"
37
     source: hosted
37
     source: hosted
38
     version: "1.1.2"
38
     version: "1.1.2"
39
   collection:
39
   collection:
40
     dependency: transitive
40
     dependency: transitive
41
     description:
41
     description:
42
       name: collection
42
       name: collection
43
-      url: "https://pub.dartlang.org"
43
+      url: "https://pub.flutter-io.cn"
44
     source: hosted
44
     source: hosted
45
     version: "1.14.11"
45
     version: "1.14.11"
46
   convert:
46
   convert:
47
     dependency: transitive
47
     dependency: transitive
48
     description:
48
     description:
49
       name: convert
49
       name: convert
50
-      url: "https://pub.dartlang.org"
50
+      url: "https://pub.flutter-io.cn"
51
     source: hosted
51
     source: hosted
52
     version: "2.1.1"
52
     version: "2.1.1"
53
   crypto:
53
   crypto:
54
     dependency: transitive
54
     dependency: transitive
55
     description:
55
     description:
56
       name: crypto
56
       name: crypto
57
-      url: "https://pub.dartlang.org"
57
+      url: "https://pub.flutter-io.cn"
58
     source: hosted
58
     source: hosted
59
     version: "2.1.3"
59
     version: "2.1.3"
60
   flutter:
60
   flutter:
71
     dependency: transitive
71
     dependency: transitive
72
     description:
72
     description:
73
       name: image
73
       name: image
74
-      url: "https://pub.dartlang.org"
74
+      url: "https://pub.flutter-io.cn"
75
     source: hosted
75
     source: hosted
76
     version: "2.1.4"
76
     version: "2.1.4"
77
   matcher:
77
   matcher:
78
     dependency: transitive
78
     dependency: transitive
79
     description:
79
     description:
80
       name: matcher
80
       name: matcher
81
-      url: "https://pub.dartlang.org"
81
+      url: "https://pub.flutter-io.cn"
82
     source: hosted
82
     source: hosted
83
     version: "0.12.6"
83
     version: "0.12.6"
84
   meta:
84
   meta:
85
     dependency: transitive
85
     dependency: transitive
86
     description:
86
     description:
87
       name: meta
87
       name: meta
88
-      url: "https://pub.dartlang.org"
88
+      url: "https://pub.flutter-io.cn"
89
     source: hosted
89
     source: hosted
90
     version: "1.1.8"
90
     version: "1.1.8"
91
   path:
91
   path:
92
     dependency: transitive
92
     dependency: transitive
93
     description:
93
     description:
94
       name: path
94
       name: path
95
-      url: "https://pub.dartlang.org"
95
+      url: "https://pub.flutter-io.cn"
96
     source: hosted
96
     source: hosted
97
     version: "1.6.4"
97
     version: "1.6.4"
98
   pedantic:
98
   pedantic:
99
     dependency: transitive
99
     dependency: transitive
100
     description:
100
     description:
101
       name: pedantic
101
       name: pedantic
102
-      url: "https://pub.dartlang.org"
102
+      url: "https://pub.flutter-io.cn"
103
     source: hosted
103
     source: hosted
104
     version: "1.8.0+1"
104
     version: "1.8.0+1"
105
   petitparser:
105
   petitparser:
106
     dependency: transitive
106
     dependency: transitive
107
     description:
107
     description:
108
       name: petitparser
108
       name: petitparser
109
-      url: "https://pub.dartlang.org"
109
+      url: "https://pub.flutter-io.cn"
110
     source: hosted
110
     source: hosted
111
     version: "2.4.0"
111
     version: "2.4.0"
112
   photo_manager:
112
   photo_manager:
113
     dependency: "direct main"
113
     dependency: "direct main"
114
     description:
114
     description:
115
       name: photo_manager
115
       name: photo_manager
116
-      url: "https://pub.dartlang.org"
116
+      url: "https://pub.flutter-io.cn"
117
     source: hosted
117
     source: hosted
118
-    version: "0.4.7"
118
+    version: "0.4.8"
119
   quiver:
119
   quiver:
120
     dependency: transitive
120
     dependency: transitive
121
     description:
121
     description:
122
       name: quiver
122
       name: quiver
123
-      url: "https://pub.dartlang.org"
123
+      url: "https://pub.flutter-io.cn"
124
     source: hosted
124
     source: hosted
125
     version: "2.0.5"
125
     version: "2.0.5"
126
   sky_engine:
126
   sky_engine:
132
     dependency: transitive
132
     dependency: transitive
133
     description:
133
     description:
134
       name: source_span
134
       name: source_span
135
-      url: "https://pub.dartlang.org"
135
+      url: "https://pub.flutter-io.cn"
136
     source: hosted
136
     source: hosted
137
     version: "1.5.5"
137
     version: "1.5.5"
138
   stack_trace:
138
   stack_trace:
139
     dependency: transitive
139
     dependency: transitive
140
     description:
140
     description:
141
       name: stack_trace
141
       name: stack_trace
142
-      url: "https://pub.dartlang.org"
142
+      url: "https://pub.flutter-io.cn"
143
     source: hosted
143
     source: hosted
144
     version: "1.9.3"
144
     version: "1.9.3"
145
   stream_channel:
145
   stream_channel:
146
     dependency: transitive
146
     dependency: transitive
147
     description:
147
     description:
148
       name: stream_channel
148
       name: stream_channel
149
-      url: "https://pub.dartlang.org"
149
+      url: "https://pub.flutter-io.cn"
150
     source: hosted
150
     source: hosted
151
     version: "2.0.0"
151
     version: "2.0.0"
152
   string_scanner:
152
   string_scanner:
153
     dependency: transitive
153
     dependency: transitive
154
     description:
154
     description:
155
       name: string_scanner
155
       name: string_scanner
156
-      url: "https://pub.dartlang.org"
156
+      url: "https://pub.flutter-io.cn"
157
     source: hosted
157
     source: hosted
158
     version: "1.0.5"
158
     version: "1.0.5"
159
   term_glyph:
159
   term_glyph:
160
     dependency: transitive
160
     dependency: transitive
161
     description:
161
     description:
162
       name: term_glyph
162
       name: term_glyph
163
-      url: "https://pub.dartlang.org"
163
+      url: "https://pub.flutter-io.cn"
164
     source: hosted
164
     source: hosted
165
     version: "1.1.0"
165
     version: "1.1.0"
166
   test_api:
166
   test_api:
167
     dependency: transitive
167
     dependency: transitive
168
     description:
168
     description:
169
       name: test_api
169
       name: test_api
170
-      url: "https://pub.dartlang.org"
170
+      url: "https://pub.flutter-io.cn"
171
     source: hosted
171
     source: hosted
172
     version: "0.2.11"
172
     version: "0.2.11"
173
   typed_data:
173
   typed_data:
174
     dependency: transitive
174
     dependency: transitive
175
     description:
175
     description:
176
       name: typed_data
176
       name: typed_data
177
-      url: "https://pub.dartlang.org"
177
+      url: "https://pub.flutter-io.cn"
178
     source: hosted
178
     source: hosted
179
     version: "1.1.6"
179
     version: "1.1.6"
180
   vector_math:
180
   vector_math:
181
     dependency: transitive
181
     dependency: transitive
182
     description:
182
     description:
183
       name: vector_math
183
       name: vector_math
184
-      url: "https://pub.dartlang.org"
184
+      url: "https://pub.flutter-io.cn"
185
     source: hosted
185
     source: hosted
186
     version: "2.0.8"
186
     version: "2.0.8"
187
   xml:
187
   xml:
188
     dependency: transitive
188
     dependency: transitive
189
     description:
189
     description:
190
       name: xml
190
       name: xml
191
-      url: "https://pub.dartlang.org"
191
+      url: "https://pub.flutter-io.cn"
192
     source: hosted
192
     source: hosted
193
     version: "3.5.0"
193
     version: "3.5.0"
194
 sdks:
194
 sdks: