Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mobile][photos] fix the uncentered loading state of the storage card

Priyanshu Dangare4bfef4ea771a
diff --git a/mobile/apps/photos/lib/ui/settings/storage_card_widget.dart b/mobile/apps/photos/lib/ui/settings/storage_card_widget.dart
index 9aaa97804e..62be25fb7f 100644
--- a/mobile/apps/photos/lib/ui/settings/storage_card_widget.dart
+++ b/mobile/apps/photos/lib/ui/settings/storage_card_widget.dart
@@ -61,7 +61,7 @@ class _StorageCardWidgetState extends State<StorageCardWidget> {
if (inheritedUserDetails == null) {
_logger.severe((InheritedUserDetails).toString() + 'is null');
- throw Error();
+ return const SizedBox.shrink();
} else {
return GestureDetector(
behavior: HitTestBehavior.translucent,
@@ -105,16 +105,24 @@ class _StorageCardWidgetState extends State<StorageCardWidget> {
colors: [Color(0xFF212121), Color(0xFF434343)],
),
),
- child: Stack(
- children: [
- Positioned.fill(
- child: CustomPaint(painter: _DotsPainter(), size: Size.infinite),
- ),
- userDetails is UserDetails
- ? _userDetails(userDetails)
- : const Center(child: EnteLoadingWidget(color: strokeBaseDark)),
- ],
- ),
+ child: userDetails != null
+ ? Stack(
+ children: [
+ Positioned.fill(
+ child: CustomPaint(
+ painter: _DotsPainter(),
+ size: Size.infinite,
+ ),
+ ),
+ _userDetails(userDetails),
+ ],
+ )
+ : const SizedBox(
+ height: 130,
+ child: Stack(
+ children: [EnteLoadingWidget(color: strokeBaseDark)],
+ ),
+ ),
),
);
}