Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fix button loading layout expansion

AmanRajSinghMouryadd491f6b98c9
diff --git a/mobile/apps/photos/lib/ui/components/buttons/button_widget_v2.dart b/mobile/apps/photos/lib/ui/components/buttons/button_widget_v2.dart
index 5fbb93e964..454d16749c 100644
--- a/mobile/apps/photos/lib/ui/components/buttons/button_widget_v2.dart
+++ b/mobile/apps/photos/lib/ui/components/buttons/button_widget_v2.dart
@@ -234,44 +234,47 @@ class _ButtonWidgetV2State extends State<ButtonWidgetV2>
);
if (widget.progressStatus != null) {
- return Center(
+ return Row(
key: const ValueKey('loading'),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- mainAxisSize: MainAxisSize.min,
- children: [
- ValueListenableBuilder<String>(
- valueListenable: widget.progressStatus!,
- builder: (context, value, _) {
- if (value.isEmpty) return const SizedBox.shrink();
- return Padding(
- padding: const EdgeInsets.only(right: 8),
- child: Text(
- value,
- style: textTheme.smallBold.copyWith(
- color: colors.textColor,
- ),
- ),
- );
- },
- ),
- spinner,
- ],
- ),
+ mainAxisAlignment: MainAxisAlignment.center,
+ mainAxisSize: MainAxisSize.max,
+ children: [
+ ValueListenableBuilder<String>(
+ valueListenable: widget.progressStatus!,
+ builder: (context, value, _) {
+ if (value.isEmpty) return const SizedBox.shrink();
+ return Padding(
+ padding: const EdgeInsets.only(right: 8),
+ child: Text(
+ value,
+ style: textTheme.smallBold.copyWith(color: colors.textColor),
+ ),
+ );
+ },
+ ),
+ spinner,
+ ],
);
}
- return Center(key: const ValueKey('loading'), child: spinner);
+ return Row(
+ key: const ValueKey('loading'),
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [spinner],
+ );
}
Widget _buildSuccessContent(ButtonColors colors) {
- return Center(
+ return Row(
key: const ValueKey('success'),
- child: HugeIcon(
- icon: HugeIcons.strokeRoundedTick02,
- color: colors.checkmarkColor,
- size: 24,
- ),
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ HugeIcon(
+ icon: HugeIcons.strokeRoundedTick02,
+ color: colors.checkmarkColor,
+ size: 24,
+ ),
+ ],
);
}