Ver código fonte

Update for picked asset error.

cjl_macbook 4 anos atrás
pai
commit
a0f2990004
3 arquivos alterados com 29 adições e 27 exclusões
  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 Ver arquivo

@@ -173,6 +173,7 @@ class _MyHomePageState extends State<MyHomePage> with LoadingDelegate {
173 173
 
174 174
     if (imgList == null || imgList.isEmpty) {
175 175
       showToast("No pick item.");
176
+      return;
176 177
     } else {
177 178
       List<String> r = [];
178 179
       for (var e in imgList) {

+ 2
- 1
lib/src/ui/page/photo_main_page.dart Ver arquivo

@@ -92,7 +92,8 @@ class _PhotoMainPageState extends State<PhotoMainPage>
92 92
   void didChangeDependencies() {
93 93
     super.didChangeDependencies();
94 94
     if (!_isInit) {
95
-      addPickedAsset(PhotoPickerProvider.of(context).pickedAssetList.toList());
95
+      final pickedList = PhotoPickerProvider.of(context).pickedAssetList ?? [];
96
+      addPickedAsset(pickedList.toList());
96 97
       _refreshList();
97 98
     }
98 99
   }

+ 26
- 26
pubspec.lock Ver arquivo

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