Browse Source

选中时的遮盖

cjl_macbook 6 years ago
parent
commit
74cd39b353
1 changed files with 20 additions and 3 deletions
  1. 20
    3
      lib/src/ui/page/photo_preview_page.dart

+ 20
- 3
lib/src/ui/page/photo_preview_page.dart View File

@@ -203,9 +203,26 @@ class _PhotoPreviewPageState extends State<PhotoPreviewPage> {
203 203
       onTap: () => changeSelected(item, index),
204 204
       child: Container(
205 205
         width: 80.0,
206
-        child: ImageItem(
207
-          themeColor: themeColor,
208
-          entity: item,
206
+        child: Stack(
207
+          children: <Widget>[
208
+            ImageItem(
209
+              themeColor: themeColor,
210
+              entity: item,
211
+            ),
212
+            IgnorePointer(
213
+              child: StreamBuilder(
214
+                stream: pageStream,
215
+                builder: (BuildContext context, AsyncSnapshot snapshot) {
216
+                  if(previewSelectedList.contains(item)){
217
+                    return Container();
218
+                  }
219
+                  return Container(
220
+                    color: Colors.white.withOpacity(0.5),
221
+                  );
222
+                },
223
+              ),
224
+            ),
225
+          ],
209 226
         ),
210 227
       ),
211 228
     );