mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-14 12:23:43 +00:00
refactor(ui): make the status chip the only update entry
Remove the update button from the detail actions; the green chip next to the extension title opens the update dialog on cards, the desktop drawer and the mobile details page alike.
This commit is contained in:
1 parent
948f6d5487
commit
04ebca60cf
4 files changed
+16
-13
No files matched your search
@@ -35,12 +35,19 @@ class ExtensionDetailDrawer extends ConsumerWidget {
|
||||
final installed = item?.installed;
|
||||
final canUpdate =
|
||||
item != null && installed != null && (state?.updateFlags.containsKey(installed.identity) ?? false);
|
||||
final updateChip = canUpdate
|
||||
? ExtensionUpdateStatus(
|
||||
key: const ValueKey('extension-details-update'),
|
||||
label: context.l10n.extensionCanUpdate,
|
||||
onTap: () => showExtensionUpdateDialog(context, installed),
|
||||
)
|
||||
: null;
|
||||
return AppDetailDrawer(
|
||||
open: item != null,
|
||||
title: item?.title ?? '',
|
||||
onClose: onClose,
|
||||
drawerKey: const ValueKey('extension-details-drawer'),
|
||||
titleTrailing: canUpdate ? ExtensionUpdateStatus(label: context.l10n.extensionCanUpdate) : null,
|
||||
titleTrailing: updateChip,
|
||||
child: item == null ? const SizedBox.shrink() : ExtensionDetailView(item: item!),
|
||||
);
|
||||
}
|
||||
@@ -134,15 +141,6 @@ class ExtensionDetailView extends ConsumerWidget {
|
||||
_runAction(context, () => ref.read(extensionsControllerProvider.notifier).installFromStore(store)),
|
||||
child: Text(context.l10n.extensionInstall),
|
||||
),
|
||||
if (installed != null && canUpdate)
|
||||
AppLoadingButton(
|
||||
key: const ValueKey('extension-details-update'),
|
||||
loading: false,
|
||||
variant: AppLoadingButtonVariant.primary,
|
||||
icon: const Icon(Icons.upgrade, size: 16),
|
||||
onPressed: busy ? null : () => showExtensionUpdateDialog(context, installed),
|
||||
child: Text(context.l10n.extensionUpdateAction),
|
||||
),
|
||||
if (installed != null && !canUpdate)
|
||||
AppLoadingButton(
|
||||
key: const ValueKey('extension-details-installed'),
|
||||
|
||||
Reference in new issue
Block a user