From 94220a58ce20d0798cdf2e23366e66cfba24f4a1 Mon Sep 17 00:00:00 2001 From: Dinesh Date: Wed, 3 Jan 2024 08:22:18 +0530 Subject: [PATCH 1/2] Hide cancel button when updates are not in progress. --- .../lib/src/manage/manage_page.dart | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/packages/app_center/lib/src/manage/manage_page.dart b/packages/app_center/lib/src/manage/manage_page.dart index e372ef95b..e40db6da3 100644 --- a/packages/app_center/lib/src/manage/manage_page.dart +++ b/packages/app_center/lib/src/manage/manage_page.dart @@ -308,19 +308,18 @@ class _ActionButtons extends ConsumerWidget { ], ), ), - const SizedBox(width: 8), - PushButton.outlined( - onPressed: updatesInprogress - ? () => ref - .read(updatesModelProvider) - .cancelChange(updatesModel.activeChangeId!) - : null, - child: Text( - l10n.snapActionCancelLabel, - maxLines: 1, - overflow: TextOverflow.ellipsis, + if (updatesInprogress) const SizedBox(width: 8), + if (updatesInprogress) + PushButton.outlined( + onPressed: () => ref + .read(updatesModelProvider) + .cancelChange(updatesModel.activeChangeId!), + child: Text( + l10n.snapActionCancelLabel, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), ), - ), ], ); } From fe8d993b4236f2e991ea956823f029432b314fc1 Mon Sep 17 00:00:00 2001 From: Dinesh Date: Tue, 16 Jan 2024 21:13:09 +0530 Subject: [PATCH 2/2] use wrap instead of row to avoid render overflow of Cancel button --- packages/app_center/lib/src/manage/manage_page.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/app_center/lib/src/manage/manage_page.dart b/packages/app_center/lib/src/manage/manage_page.dart index e40db6da3..97222080d 100644 --- a/packages/app_center/lib/src/manage/manage_page.dart +++ b/packages/app_center/lib/src/manage/manage_page.dart @@ -238,8 +238,9 @@ class _ActionButtons extends ConsumerWidget { final updatesInprogress = updatesModel.refreshableSnapNames.isNotEmpty && !updatesModel.state.isLoading && updatesModel.activeChangeId != null; - return Row( - mainAxisSize: MainAxisSize.min, + return Wrap( + spacing: 10, + runSpacing: 10, children: [ PushButton.outlined( onPressed: @@ -259,7 +260,6 @@ class _ActionButtons extends ConsumerWidget { ], ), ), - const SizedBox(width: 8), PushButton.elevated( onPressed: updatesModel.refreshableSnapNames.isNotEmpty && !updatesModel.state.isLoading && @@ -308,7 +308,6 @@ class _ActionButtons extends ConsumerWidget { ], ), ), - if (updatesInprogress) const SizedBox(width: 8), if (updatesInprogress) PushButton.outlined( onPressed: () => ref