From 46d62fdf11d596096675c4e0a5d12049733da170 Mon Sep 17 00:00:00 2001 From: Krille Date: Tue, 19 Nov 2024 13:16:40 +0100 Subject: [PATCH] chore: Follow up loading dialog --- lib/widgets/future_loading_dialog.dart | 29 ++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/lib/widgets/future_loading_dialog.dart b/lib/widgets/future_loading_dialog.dart index 80804f692..405b8335e 100644 --- a/lib/widgets/future_loading_dialog.dart +++ b/lib/widgets/future_loading_dialog.dart @@ -95,14 +95,31 @@ class LoadingDialogState extends State { : widget.title ?? L10n.of(context).loadingPleaseWait; return AlertDialog.adaptive( - title: Icon( - Icons.error_outline_outlined, - color: Theme.of(context).colorScheme.error, - size: 48, - ), + title: exception == null + ? null + : Icon( + Icons.error_outline_outlined, + color: Theme.of(context).colorScheme.error, + size: 48, + ), content: ConstrainedBox( constraints: const BoxConstraints(maxWidth: 256), - child: Text(titleLabel), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + if (exception == null) ...[ + const CircularProgressIndicator.adaptive(), + const SizedBox(width: 20), + ], + Expanded( + child: Text( + titleLabel, + textAlign: exception == null ? TextAlign.left : null, + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), ), actions: exception == null ? null