Browse Source

Fix for UI bug on memory widget. (#1062)

Neeraj Gupta 2 years ago
parent
commit
c004663be0

+ 27 - 19
lib/ui/home/memories_widget.dart

@@ -48,7 +48,10 @@ class MemoriesWidget extends StatelessWidget {
     }
     }
     return SingleChildScrollView(
     return SingleChildScrollView(
       scrollDirection: Axis.horizontal,
       scrollDirection: Axis.horizontal,
-      child: Row(children: memoryWidgets),
+      child: Row(
+        crossAxisAlignment: CrossAxisAlignment.start,
+        children: memoryWidgets,
+      ),
     );
     );
   }
   }
 
 
@@ -106,27 +109,32 @@ class _MemoryWidgetState extends State<MemoryWidget> {
         );
         );
         setState(() {});
         setState(() {});
       },
       },
-      child: Expanded(
-        child: Padding(
-          padding: const EdgeInsets.all(8.0),
-          child: Column(
-            children: [
-              _buildMemoryItem(context, index),
-              const Padding(padding: EdgeInsets.all(4)),
-              Hero(
-                tag: title,
-                child: Material(
-                  type: MaterialType.transparency,
-                  child: Text(
-                    title,
-                    style: getEnteTextTheme(context).mini,
-                    textAlign: TextAlign.center,
+      child: Row(
+        children: [
+          Padding(
+            padding: const EdgeInsets.all(8.0),
+            child: Column(
+              children: [
+                _buildMemoryItem(context, index),
+                const Padding(padding: EdgeInsets.all(4)),
+                Hero(
+                  tag: title,
+                  child: Material(
+                    type: MaterialType.transparency,
+                    child: ConstrainedBox(
+                      constraints: const BoxConstraints(maxWidth: 84),
+                      child: Text(
+                        title,
+                        style: getEnteTextTheme(context).mini,
+                        textAlign: TextAlign.center,
+                      ),
+                    ),
                   ),
                   ),
                 ),
                 ),
-              ),
-            ],
+              ],
+            ),
           ),
           ),
-        ),
+        ],
       ),
       ),
     );
     );
   }
   }

+ 5 - 7
lib/ui/home/status_bar_widget.dart

@@ -91,13 +91,11 @@ class _StatusBarWidgetState extends State<StatusBarWidget> {
                   : const SyncStatusWidget()
                   : const SyncStatusWidget()
               : const Text("ente", style: brandStyleMedium),
               : const Text("ente", style: brandStyleMedium),
         ),
         ),
-        AnimatedOpacity(
-          opacity: _showErrorBanner ? 1 : 0,
-          duration: const Duration(milliseconds: 200),
-          child: const Divider(
-            height: 8,
-          ),
-        ),
+        _showErrorBanner
+            ? const Divider(
+                height: 8,
+              )
+            : const SizedBox.shrink(),
         _showErrorBanner
         _showErrorBanner
             ? HeaderErrorWidget(error: _syncError)
             ? HeaderErrorWidget(error: _syncError)
             : const SizedBox.shrink(),
             : const SizedBox.shrink(),

+ 3 - 1
lib/ui/viewer/file/zoomable_image.dart

@@ -279,7 +279,9 @@ class _ZoomableImageState extends State<ZoomableImage>
           (h != widget.photo.height || w != widget.photo.width)) {
           (h != widget.photo.height || w != widget.photo.width)) {
         _logger.info('Updating aspect ratio for ${widget.photo} to $h:$w');
         _logger.info('Updating aspect ratio for ${widget.photo} to $h:$w');
         await FileMagicService.instance.updatePublicMagicMetadata(
         await FileMagicService.instance.updatePublicMagicMetadata(
-            [widget.photo], {publicMagicKeyHeight: h, publicMagicKeyWidth: w});
+          [widget.photo],
+          {publicMagicKeyHeight: h, publicMagicKeyWidth: w},
+        );
       }
       }
     }
     }
   }
   }

+ 5 - 2
lib/utils/crypto_util.dart

@@ -325,8 +325,11 @@ class CryptoUtil {
     args["destinationFilePath"] = destinationFilePath;
     args["destinationFilePath"] = destinationFilePath;
     args["header"] = header;
     args["header"] = header;
     args["key"] = key;
     args["key"] = key;
-    return _computer.compute(chachaDecryptFile,
-        param: args, taskName: "decryptFile");
+    return _computer.compute(
+      chachaDecryptFile,
+      param: args,
+      taskName: "decryptFile",
+    );
   }
   }
 
 
   // Generates and returns a 256-bit key.
   // Generates and returns a 256-bit key.