Browse Source

Fix storage card (#1296)

Ashil 2 years ago
parent
commit
60773d3d29
3 changed files with 30 additions and 30 deletions
  1. 28 27
      lib/ui/settings/storage_card_widget.dart
  2. 1 2
      lib/ui/settings_page.dart
  3. 1 1
      lib/ui/tabs/home_widget.dart

+ 28 - 27
lib/ui/settings/storage_card_widget.dart

@@ -8,7 +8,7 @@ import 'package:photos/models/user_details.dart';
 import 'package:photos/states/user_details_state.dart';
 import 'package:photos/theme/colors.dart';
 import 'package:photos/theme/ente_theme.dart';
-import 'package:photos/ui/common/loading_widget.dart';
+import "package:photos/ui/common/loading_widget.dart";
 import 'package:photos/ui/payment/subscription.dart';
 import 'package:photos/ui/settings/storage_progress_widget.dart';
 import 'package:photos/utils/data_util.dart';
@@ -81,36 +81,37 @@ class _StorageCardWidgetState extends State<StorageCardWidget> {
   Widget containerForUserDetails(
     UserDetails? userDetails,
   ) {
-    return ConstrainedBox(
-      constraints: const BoxConstraints(maxWidth: 350),
-      child: AspectRatio(
-        aspectRatio: 2 / 1,
-        child: Stack(
-          children: [
-            _background,
-            userDetails is UserDetails
-                ? _userDetails(userDetails)
-                : const EnteLoadingWidget(
-                    color: strokeBaseDark,
-                  ),
-            Align(
-              alignment: Alignment.centerRight,
-              child: Padding(
-                padding: const EdgeInsets.only(right: 4),
-                child: ValueListenableBuilder<bool>(
-                  builder: (BuildContext context, bool value, Widget? child) {
-                    return Icon(
-                      Icons.chevron_right_outlined,
-                      color: value ? strokeMutedDark : strokeBaseDark,
-                    );
-                  },
-                  valueListenable: _isStorageCardPressed,
+    return Stack(
+      children: [
+        SizedBox(
+          width: double.infinity,
+          child: _background,
+        ),
+        Positioned.fill(
+          child: userDetails is UserDetails
+              ? _userDetails(userDetails)
+              : const EnteLoadingWidget(
+                  color: strokeBaseDark,
                 ),
+        ),
+        Positioned.fill(
+          child: Align(
+            alignment: Alignment.centerRight,
+            child: Padding(
+              padding: const EdgeInsets.only(right: 4),
+              child: ValueListenableBuilder<bool>(
+                builder: (BuildContext context, bool value, Widget? child) {
+                  return Icon(
+                    Icons.chevron_right_outlined,
+                    color: value ? strokeMutedDark : strokeBaseDark,
+                  );
+                },
+                valueListenable: _isStorageCardPressed,
               ),
             ),
-          ],
+          ),
         ),
-      ),
+      ],
     );
   }
 

+ 1 - 2
lib/ui/settings_page.dart

@@ -60,8 +60,7 @@ class SettingsPage extends StatelessWidget {
         onLongPress: () {
           _showVerifyIdentityDialog(context);
         },
-        child: Container(
-          constraints: const BoxConstraints(maxWidth: 350),
+        child: Padding(
           padding: const EdgeInsets.symmetric(horizontal: 8),
           child: Align(
             alignment: Alignment.centerLeft,

+ 1 - 1
lib/ui/tabs/home_widget.dart

@@ -300,7 +300,7 @@ class _HomeWidgetState extends State<HomeWidget> {
           //using a hack instead of enabling this as enabling this will create other problems
           drawer: enableDrawer
               ? ConstrainedBox(
-                  constraints: const BoxConstraints(maxWidth: 428),
+                  constraints: const BoxConstraints(maxWidth: 430),
                   child: Drawer(
                     width: double.infinity,
                     child: _settingsPage,