Browse Source

Add gradient to show sync status clearly

Vishnu 4 years ago
parent
commit
1bd2f11fa1
2 changed files with 47 additions and 21 deletions
  1. 26 13
      lib/ui/collections_gallery_widget.dart
  2. 21 8
      lib/ui/thumbnail_widget.dart

+ 26 - 13
lib/ui/collections_gallery_widget.dart

@@ -220,6 +220,31 @@ class DeviceFolderIcon extends StatelessWidget {
     Key key,
     Key key,
   }) : super(key: key);
   }) : super(key: key);
 
 
+  static final kUnsyncedIconOverlay = Container(
+    decoration: BoxDecoration(
+      gradient: LinearGradient(
+        begin: Alignment.topCenter,
+        end: Alignment.bottomCenter,
+        colors: [
+          Colors.transparent,
+          Colors.black.withOpacity(0.6),
+        ],
+        stops: [0.7, 1],
+      ),
+    ),
+    child: Align(
+      alignment: Alignment.bottomRight,
+      child: Padding(
+        padding: const EdgeInsets.only(right: 8, bottom: 8),
+        child: Icon(
+          Icons.cloud_off_outlined,
+          size: 18,
+          color: Colors.white.withOpacity(0.9),
+        ),
+      ),
+    ),
+  );
+
   final DeviceFolder folder;
   final DeviceFolder folder;
 
 
   @override
   @override
@@ -247,19 +272,7 @@ class DeviceFolderIcon extends StatelessWidget {
                             folder.path +
                             folder.path +
                             folder.thumbnail.tag()),
                             folder.thumbnail.tag()),
                       ),
                       ),
-                      isBackedUp
-                          ? Container()
-                          : Align(
-                              alignment: Alignment.bottomRight,
-                              child: Padding(
-                                padding:
-                                    const EdgeInsets.only(right: 8, bottom: 6),
-                                child: Icon(
-                                  Icons.cloud_off_outlined,
-                                  size: 18,
-                                ),
-                              ),
-                            )
+                      isBackedUp ? Container() : kUnsyncedIconOverlay,
                     ],
                     ],
                   ),
                   ),
                 ),
                 ),

+ 21 - 8
lib/ui/thumbnail_widget.dart

@@ -42,14 +42,27 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
     ),
     ),
   );
   );
 
 
-  static final kUnsyncedIconOverlay = Align(
-    alignment: Alignment.bottomRight,
-    child: Padding(
-      padding: const EdgeInsets.only(right: 8, bottom: 4),
-      child: Icon(
-        Icons.cloud_off_outlined,
-        size: 18,
-        color: Colors.white.withOpacity(0.8),
+  static final kUnsyncedIconOverlay = Container(
+    decoration: BoxDecoration(
+      gradient: LinearGradient(
+        begin: Alignment.topCenter,
+        end: Alignment.bottomCenter,
+        colors: [
+          Colors.transparent,
+          Colors.black.withOpacity(0.6),
+        ],
+        stops: [0.75, 1],
+      ),
+    ),
+    child: Align(
+      alignment: Alignment.bottomRight,
+      child: Padding(
+        padding: const EdgeInsets.only(right: 8, bottom: 4),
+        child: Icon(
+          Icons.cloud_off_outlined,
+          size: 18,
+          color: Colors.white.withOpacity(0.9),
+        ),
       ),
       ),
     ),
     ),
   );
   );