mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-16 21:33:41 +00:00
Merge PR #1535 into 2.0.0-beta.2
This commit is contained in:
commit
8f2af5660e
30 files changed
+197
-154
No files matched your search
@@ -185,12 +185,11 @@ class ExtensionsController extends AsyncNotifier<ExtensionsState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool canUpdateItem(ExtensionListItem item) {
|
bool canUpdateItem(ExtensionListItem item) {
|
||||||
final current = _current;
|
final installed = item.installed;
|
||||||
if (item.installed == null) return false;
|
if (installed == null) return false;
|
||||||
if (current.listFilter == ExtensionListFilter.market && item.store != null) {
|
// The backend checks GitHub live for every installed extension; the store
|
||||||
return _compareVersion(item.store!.version, item.installed!.version) > 0;
|
// index may lag behind and must not decide update visibility.
|
||||||
}
|
return _current.updateFlags.containsKey(installed.identity);
|
||||||
return current.updateFlags.containsKey(item.installed!.identity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> installFromStore(StoreExtension extension) async {
|
Future<void> installFromStore(StoreExtension extension) async {
|
||||||
@@ -240,6 +239,9 @@ class ExtensionsController extends AsyncNotifier<ExtensionsState> {
|
|||||||
await _runBusy(extension.identity, () async {
|
await _runBusy(extension.identity, () async {
|
||||||
await ref.read(gopeedServiceProvider).updateExtension(extension.identity);
|
await ref.read(gopeedServiceProvider).updateExtension(extension.identity);
|
||||||
await loadInstalled(refreshUpdates: false);
|
await loadInstalled(refreshUpdates: false);
|
||||||
|
// Drop the stale flag immediately; the background re-check confirms it.
|
||||||
|
final flags = Map<String, String>.of(_current.updateFlags)..remove(extension.identity);
|
||||||
|
state = AsyncValue.data(_current.copyWith(updateFlags: flags));
|
||||||
unawaited(checkUpdate());
|
unawaited(checkUpdate());
|
||||||
_bumpStoreInstallCount(extension.identity);
|
_bumpStoreInstallCount(extension.identity);
|
||||||
_reportInstallSafe(extension.identity);
|
_reportInstallSafe(extension.identity);
|
||||||
@@ -354,24 +356,4 @@ class ExtensionsController extends AsyncNotifier<ExtensionsState> {
|
|||||||
}());
|
}());
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _compareVersion(String a, String b) {
|
|
||||||
final aNums = _toVersionNumbers(a);
|
|
||||||
final bNums = _toVersionNumbers(b);
|
|
||||||
final maxLen = aNums.length > bNums.length ? aNums.length : bNums.length;
|
|
||||||
for (var i = 0; i < maxLen; i++) {
|
|
||||||
final left = i < aNums.length ? aNums[i] : 0;
|
|
||||||
final right = i < bNums.length ? bNums[i] : 0;
|
|
||||||
if (left > right) return 1;
|
|
||||||
if (left < right) return -1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static List<int> _toVersionNumbers(String version) {
|
|
||||||
return version
|
|
||||||
.split(RegExp(r'[^0-9]+'))
|
|
||||||
.where((part) => part.isNotEmpty)
|
|
||||||
.map((part) => int.tryParse(part) ?? 0)
|
|
||||||
.toList();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,8 @@ import '../../../../shared/theme/app_palette.dart';
|
|||||||
import '../../../../shared/widgets/detail/app_detail_surface.dart';
|
import '../../../../shared/widgets/detail/app_detail_surface.dart';
|
||||||
import '../../application/extensions_controller.dart';
|
import '../../application/extensions_controller.dart';
|
||||||
import '../widgets/extension_detail_view.dart';
|
import '../widgets/extension_detail_view.dart';
|
||||||
|
import '../widgets/extension_update_dialog.dart';
|
||||||
|
import '../widgets/extension_update_status.dart';
|
||||||
|
|
||||||
class ExtensionDetailsPage extends ConsumerWidget {
|
class ExtensionDetailsPage extends ConsumerWidget {
|
||||||
const ExtensionDetailsPage({super.key, required this.extensionId, this.initialItem});
|
const ExtensionDetailsPage({super.key, required this.extensionId, this.initialItem});
|
||||||
@@ -24,6 +26,15 @@ class ExtensionDetailsPage extends ConsumerWidget {
|
|||||||
return AppDetailPage(
|
return AppDetailPage(
|
||||||
title: item?.title ?? context.l10n.extensions,
|
title: item?.title ?? context.l10n.extensions,
|
||||||
onBack: () => context.canPop() ? context.pop() : context.go('/extensions'),
|
onBack: () => context.canPop() ? context.pop() : context.go('/extensions'),
|
||||||
|
titleTrailing: _canUpdate(stateAsync.value, item)
|
||||||
|
? ExtensionUpdateStatus(
|
||||||
|
key: const ValueKey('extension-details-update-mobile'),
|
||||||
|
label: context.l10n.extensionCanUpdate,
|
||||||
|
onTap: item?.installed == null
|
||||||
|
? null
|
||||||
|
: () => showExtensionUpdateDialog(context, item!.installed!),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
child: item == null
|
child: item == null
|
||||||
? Center(
|
? Center(
|
||||||
child: stateAsync.isLoading
|
child: stateAsync.isLoading
|
||||||
@@ -33,4 +44,9 @@ class ExtensionDetailsPage extends ConsumerWidget {
|
|||||||
: ExtensionDetailView(key: ValueKey(item.id), item: item, mobile: true),
|
: ExtensionDetailView(key: ValueKey(item.id), item: item, mobile: true),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool _canUpdate(ExtensionsState? state, ExtensionListItem? item) {
|
||||||
|
final installed = item?.installed;
|
||||||
|
return item != null && installed != null && (state?.updateFlags.containsKey(installed.identity) ?? false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -28,6 +28,7 @@ import '../widgets/extension_detail_view.dart';
|
|||||||
import '../widgets/extension_icon.dart';
|
import '../widgets/extension_icon.dart';
|
||||||
import '../widgets/extension_setting_field.dart';
|
import '../widgets/extension_setting_field.dart';
|
||||||
import '../widgets/extension_update_dialog.dart';
|
import '../widgets/extension_update_dialog.dart';
|
||||||
|
import '../widgets/extension_update_status.dart';
|
||||||
|
|
||||||
const _extensionCardMinWidth = 290.0;
|
const _extensionCardMinWidth = 290.0;
|
||||||
const _extensionGridSpacing = 10.0;
|
const _extensionGridSpacing = 10.0;
|
||||||
@@ -485,25 +486,7 @@ class _Content extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool _canUpdate(ExtensionsState state, ExtensionListItem item) {
|
bool _canUpdate(ExtensionsState state, ExtensionListItem item) {
|
||||||
if (item.installed == null) return false;
|
return item.installed != null && state.updateFlags.containsKey(item.installed!.identity);
|
||||||
if (state.listFilter == ExtensionListFilter.market && item.store != null) {
|
|
||||||
return _compareVersion(item.store!.version, item.installed!.version) > 0;
|
|
||||||
}
|
|
||||||
return state.updateFlags.containsKey(item.installed!.identity);
|
|
||||||
}
|
|
||||||
|
|
||||||
int _compareVersion(String a, String b) {
|
|
||||||
final aNums = a.split(RegExp(r'[^0-9]+')).where((part) => part.isNotEmpty).map((part) => int.tryParse(part) ?? 0);
|
|
||||||
final bNums = b.split(RegExp(r'[^0-9]+')).where((part) => part.isNotEmpty).map((part) => int.tryParse(part) ?? 0);
|
|
||||||
final left = aNums.toList();
|
|
||||||
final right = bNums.toList();
|
|
||||||
final maxLen = left.length > right.length ? left.length : right.length;
|
|
||||||
for (var i = 0; i < maxLen; i++) {
|
|
||||||
final l = i < left.length ? left[i] : 0;
|
|
||||||
final r = i < right.length ? right[i] : 0;
|
|
||||||
if (l != r) return l.compareTo(r);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -994,11 +977,27 @@ class _ExtensionCard extends ConsumerWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Row(
|
||||||
item.title,
|
children: [
|
||||||
maxLines: 1,
|
Flexible(
|
||||||
overflow: TextOverflow.ellipsis,
|
child: Text(
|
||||||
style: TextStyle(color: palette.textPrimary, fontSize: 14, fontWeight: FontWeight.w700),
|
item.title,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(color: palette.textPrimary, fontSize: 14, fontWeight: FontWeight.w700),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (canUpdate && installed != null) ...[
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
Flexible(
|
||||||
|
child: ExtensionUpdateStatus(
|
||||||
|
key: ValueKey('extension-card-update-status-${item.id}'),
|
||||||
|
label: context.l10n.extensionCanUpdate,
|
||||||
|
onTap: busy ? null : () => showExtensionUpdateDialog(context, installed),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
Text(
|
Text(
|
||||||
@@ -1067,13 +1066,6 @@ class _ExtensionCard extends ConsumerWidget {
|
|||||||
key: ValueKey('extension-card-actions-${item.id}'),
|
key: ValueKey('extension-card-actions-${item.id}'),
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
if (canUpdate && installed != null)
|
|
||||||
shad.GhostButton(
|
|
||||||
density: shad.ButtonDensity.icon,
|
|
||||||
key: ValueKey('update-extension-${installed.identity}'),
|
|
||||||
onPressed: busy ? null : () => showExtensionUpdateDialog(context, installed),
|
|
||||||
child: const Icon(Icons.refresh),
|
|
||||||
),
|
|
||||||
if (installed == null && item.store != null)
|
if (installed == null && item.store != null)
|
||||||
shad.GhostButton(
|
shad.GhostButton(
|
||||||
key: ValueKey('install-store-extension-${item.store!.id}'),
|
key: ValueKey('install-store-extension-${item.store!.id}'),
|
||||||
@@ -1127,21 +1119,17 @@ class _ExtensionCard extends ConsumerWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
if (item.store == null) return card;
|
return GestureDetector(
|
||||||
return MouseRegion(
|
key: ValueKey('open-extension-details-${item.id}'),
|
||||||
cursor: SystemMouseCursors.click,
|
behavior: HitTestBehavior.opaque,
|
||||||
child: GestureDetector(
|
onTap: () {
|
||||||
key: ValueKey('open-extension-details-${item.id}'),
|
if (MediaQuery.sizeOf(context).width < Breakpoints.mobile) {
|
||||||
behavior: HitTestBehavior.opaque,
|
context.push('/extensions/${Uri.encodeComponent(item.id)}', extra: item);
|
||||||
onTap: () {
|
return;
|
||||||
if (MediaQuery.sizeOf(context).width < Breakpoints.mobile) {
|
}
|
||||||
context.push('/extensions/${Uri.encodeComponent(item.id)}', extra: item);
|
onOpenDetails(item);
|
||||||
return;
|
},
|
||||||
}
|
child: card,
|
||||||
onOpenDetails(item);
|
|
||||||
},
|
|
||||||
child: card,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-42
@@ -21,20 +21,33 @@ import '../../../../util/util.dart';
|
|||||||
import '../../application/extensions_controller.dart';
|
import '../../application/extensions_controller.dart';
|
||||||
import 'extension_icon.dart';
|
import 'extension_icon.dart';
|
||||||
import 'extension_update_dialog.dart';
|
import 'extension_update_dialog.dart';
|
||||||
|
import 'extension_update_status.dart';
|
||||||
|
|
||||||
class ExtensionDetailDrawer extends StatelessWidget {
|
class ExtensionDetailDrawer extends ConsumerWidget {
|
||||||
const ExtensionDetailDrawer({super.key, required this.item, required this.onClose});
|
const ExtensionDetailDrawer({super.key, required this.item, required this.onClose});
|
||||||
|
|
||||||
final ExtensionListItem? item;
|
final ExtensionListItem? item;
|
||||||
final VoidCallback onClose;
|
final VoidCallback onClose;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
final state = ref.watch(extensionsControllerProvider).value;
|
||||||
|
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(
|
return AppDetailDrawer(
|
||||||
open: item != null,
|
open: item != null,
|
||||||
title: item?.title ?? '',
|
title: item?.title ?? '',
|
||||||
onClose: onClose,
|
onClose: onClose,
|
||||||
drawerKey: const ValueKey('extension-details-drawer'),
|
drawerKey: const ValueKey('extension-details-drawer'),
|
||||||
|
titleTrailing: updateChip,
|
||||||
child: item == null ? const SizedBox.shrink() : ExtensionDetailView(item: item!),
|
child: item == null ? const SizedBox.shrink() : ExtensionDetailView(item: item!),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -104,8 +117,6 @@ class ExtensionDetailView extends ConsumerWidget {
|
|||||||
style: TextStyle(color: palette.textMuted, fontSize: 11.5, fontWeight: FontWeight.w600),
|
style: TextStyle(color: palette.textMuted, fontSize: 11.5, fontWeight: FontWeight.w600),
|
||||||
),
|
),
|
||||||
if (store != null) _ExtensionStats(store: store),
|
if (store != null) _ExtensionStats(store: store),
|
||||||
if (installed != null && canUpdate)
|
|
||||||
_ExtensionStatus(label: context.l10n.extensionCanUpdate, emphasized: true),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -130,15 +141,6 @@ class ExtensionDetailView extends ConsumerWidget {
|
|||||||
_runAction(context, () => ref.read(extensionsControllerProvider.notifier).installFromStore(store)),
|
_runAction(context, () => ref.read(extensionsControllerProvider.notifier).installFromStore(store)),
|
||||||
child: Text(context.l10n.extensionInstall),
|
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.refresh, size: 16),
|
|
||||||
onPressed: busy ? null : () => showExtensionUpdateDialog(context, installed),
|
|
||||||
child: Text(context.l10n.newVersionUpdate),
|
|
||||||
),
|
|
||||||
if (installed != null && !canUpdate)
|
if (installed != null && !canUpdate)
|
||||||
AppLoadingButton(
|
AppLoadingButton(
|
||||||
key: const ValueKey('extension-details-installed'),
|
key: const ValueKey('extension-details-installed'),
|
||||||
@@ -276,35 +278,6 @@ class _ExtensionReadmeState extends State<_ExtensionReadme> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ExtensionStatus extends StatelessWidget {
|
|
||||||
const _ExtensionStatus({required this.label, required this.emphasized});
|
|
||||||
|
|
||||||
final String label;
|
|
||||||
final bool emphasized;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
final palette = AppPalette.of(context);
|
|
||||||
final dotColor = emphasized ? palette.brand : palette.success;
|
|
||||||
final textColor = emphasized ? palette.textPrimary : palette.success;
|
|
||||||
return Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
width: 5,
|
|
||||||
height: 5,
|
|
||||||
decoration: BoxDecoration(color: dotColor, shape: BoxShape.circle),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 5),
|
|
||||||
Text(
|
|
||||||
label,
|
|
||||||
style: TextStyle(color: textColor, fontSize: 11.5, fontWeight: FontWeight.w600),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _LinkButtonContent extends StatelessWidget {
|
class _LinkButtonContent extends StatelessWidget {
|
||||||
const _LinkButtonContent({required this.icon, required this.label});
|
const _LinkButtonContent({required this.icon, required this.label});
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -58,7 +58,7 @@ class _ExtensionUpdateDialogState extends ConsumerState<_ExtensionUpdateDialog>
|
|||||||
canPop: !_updating,
|
canPop: !_updating,
|
||||||
child: AlertDialog(
|
child: AlertDialog(
|
||||||
key: const ValueKey('extension-update-dialog'),
|
key: const ValueKey('extension-update-dialog'),
|
||||||
title: Text(context.l10n.extensionCanUpdate),
|
title: Text(context.l10n.newVersionAvailable),
|
||||||
content: Column(
|
content: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
|
import '../../../../shared/theme/app_palette.dart';
|
||||||
|
|
||||||
|
/// Green status dot with an optional label, marking an available update.
|
||||||
|
/// Pass [onTap] to make it open the update prompt.
|
||||||
|
class ExtensionUpdateStatus extends StatelessWidget {
|
||||||
|
const ExtensionUpdateStatus({super.key, this.label, this.onTap});
|
||||||
|
|
||||||
|
final String? label;
|
||||||
|
final VoidCallback? onTap;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final palette = AppPalette.of(context);
|
||||||
|
final content = Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: palette.brandSoft,
|
||||||
|
borderRadius: BorderRadius.circular(999),
|
||||||
|
border: Border.all(color: palette.brand.withValues(alpha: 0.35)),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 6,
|
||||||
|
height: 6,
|
||||||
|
decoration: BoxDecoration(color: palette.brand, shape: BoxShape.circle),
|
||||||
|
),
|
||||||
|
if (label != null) ...[
|
||||||
|
const SizedBox(width: 5),
|
||||||
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
label!,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(color: palette.textPrimary, fontSize: 11.5, fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
if (onTap == null) return content;
|
||||||
|
return MouseRegion(
|
||||||
|
cursor: SystemMouseCursors.click,
|
||||||
|
child: GestureDetector(
|
||||||
|
behavior: HitTestBehavior.opaque,
|
||||||
|
onTap: onTap,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 2, vertical: 4),
|
||||||
|
child: content,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "إضافة",
|
"add": "إضافة",
|
||||||
"edit": "تعديل",
|
"edit": "تعديل",
|
||||||
"newVersionTitle": "يتوفر إصدار جديد @version",
|
"newVersionTitle": "يتوفر إصدار جديد @version",
|
||||||
"newVersionUpdate": "تحديث الآن",
|
"newVersionUpdate": "تحديث",
|
||||||
"newVersionLater": "لاحقاً",
|
"newVersionLater": "لاحقاً",
|
||||||
"extensions": "الإضافات",
|
"extensions": "الإضافات",
|
||||||
"extensionInstallUrl": "عنوان التثبيت",
|
"extensionInstallUrl": "عنوان التثبيت",
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
"add": "Əlavə et",
|
"add": "Əlavə et",
|
||||||
"edit": "Redaktə et",
|
"edit": "Redaktə et",
|
||||||
"newVersionTitle": "Yeni versiya @version tapıldı",
|
"newVersionTitle": "Yeni versiya @version tapıldı",
|
||||||
"newVersionUpdate": "İndi Yenilə",
|
"newVersionUpdate": "Yenilə",
|
||||||
"newVersionLater": "Sonra",
|
"newVersionLater": "Sonra",
|
||||||
"extensions": "Uzantılar",
|
"extensions": "Uzantılar",
|
||||||
"extensionInstallUrl": "Quraşdırma URL-i",
|
"extensionInstallUrl": "Quraşdırma URL-i",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "Afegeix",
|
"add": "Afegeix",
|
||||||
"edit": "Edita",
|
"edit": "Edita",
|
||||||
"newVersionTitle": "Descobriu la nova versió @version",
|
"newVersionTitle": "Descobriu la nova versió @version",
|
||||||
"newVersionUpdate": "Actualitza ara",
|
"newVersionUpdate": "Actualitza",
|
||||||
"newVersionLater": "Més tard",
|
"newVersionLater": "Més tard",
|
||||||
"extensions": "Extensions",
|
"extensions": "Extensions",
|
||||||
"extensionInstallUrl": "URL d'instal·lació",
|
"extensionInstallUrl": "URL d'instal·lació",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "Hinzugefügt",
|
"add": "Hinzugefügt",
|
||||||
"edit": "Bearbeiten",
|
"edit": "Bearbeiten",
|
||||||
"newVersionTitle": "Entdecken Sie die neue Version @version",
|
"newVersionTitle": "Entdecken Sie die neue Version @version",
|
||||||
"newVersionUpdate": "Jetzt aktualisieren",
|
"newVersionUpdate": "Aktualisieren",
|
||||||
"newVersionLater": "Später",
|
"newVersionLater": "Später",
|
||||||
"extensions": "Erweiterungen",
|
"extensions": "Erweiterungen",
|
||||||
"extensionInstallUrl": "Installations-URL",
|
"extensionInstallUrl": "Installations-URL",
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
"add": "Add",
|
"add": "Add",
|
||||||
"edit": "Edit",
|
"edit": "Edit",
|
||||||
"newVersionTitle": "Discover new version @version",
|
"newVersionTitle": "Discover new version @version",
|
||||||
"newVersionUpdate": "Update Now",
|
"newVersionUpdate": "Update",
|
||||||
"newVersionLater": "Later",
|
"newVersionLater": "Later",
|
||||||
"extensions": "Extensions",
|
"extensions": "Extensions",
|
||||||
"extensionInstallUrl": "Install URL",
|
"extensionInstallUrl": "Install URL",
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
"extensionLoadMore": "Load More",
|
"extensionLoadMore": "Load More",
|
||||||
"extensionNoMore": "No more extensions",
|
"extensionNoMore": "No more extensions",
|
||||||
"extensionInstalled": "Installed",
|
"extensionInstalled": "Installed",
|
||||||
"extensionCanUpdate": "Update Available",
|
"extensionCanUpdate": "Update",
|
||||||
"extensionInstall": "Install",
|
"extensionInstall": "Install",
|
||||||
"extensionLoadLocal": "Install Local Folder",
|
"extensionLoadLocal": "Install Local Folder",
|
||||||
"extensionFilterAll": "All",
|
"extensionFilterAll": "All",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "Añadir",
|
"add": "Añadir",
|
||||||
"edit": "Editar",
|
"edit": "Editar",
|
||||||
"newVersionTitle": "Nueva versión @version disponible",
|
"newVersionTitle": "Nueva versión @version disponible",
|
||||||
"newVersionUpdate": "Actualizar Ahora",
|
"newVersionUpdate": "Actualizar",
|
||||||
"newVersionLater": "Más tarde",
|
"newVersionLater": "Más tarde",
|
||||||
"extensions": "Extensiones",
|
"extensions": "Extensiones",
|
||||||
"extensionInstallUrl": "URL de instalación",
|
"extensionInstallUrl": "URL de instalación",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "افزودن",
|
"add": "افزودن",
|
||||||
"edit": "ویرایش",
|
"edit": "ویرایش",
|
||||||
"newVersionTitle": "@version عنوان: کشف نسخه جدید",
|
"newVersionTitle": "@version عنوان: کشف نسخه جدید",
|
||||||
"newVersionUpdate": "بروزرسانی",
|
"newVersionUpdate": "بهروزرسانی",
|
||||||
"newVersionLater": "بعداً",
|
"newVersionLater": "بعداً",
|
||||||
"extensions": "افزونهها",
|
"extensions": "افزونهها",
|
||||||
"extensionInstallUrl": "نشانی نصب",
|
"extensionInstallUrl": "نشانی نصب",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "Ajouter",
|
"add": "Ajouter",
|
||||||
"edit": "Modifier",
|
"edit": "Modifier",
|
||||||
"newVersionTitle": "Nouvelle version @version disponible",
|
"newVersionTitle": "Nouvelle version @version disponible",
|
||||||
"newVersionUpdate": "Mettre à jour maintenant",
|
"newVersionUpdate": "Mettre à jour",
|
||||||
"newVersionLater": "Plus tard",
|
"newVersionLater": "Plus tard",
|
||||||
"extensions": "Extensions",
|
"extensions": "Extensions",
|
||||||
"extensionInstallUrl": "URL d'installation",
|
"extensionInstallUrl": "URL d'installation",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "Hozzáad",
|
"add": "Hozzáad",
|
||||||
"edit": "Szerk",
|
"edit": "Szerk",
|
||||||
"newVersionTitle": "Új verzió felfedezése @version",
|
"newVersionTitle": "Új verzió felfedezése @version",
|
||||||
"newVersionUpdate": "Frissítés most",
|
"newVersionUpdate": "Frissítés",
|
||||||
"newVersionLater": "Később",
|
"newVersionLater": "Később",
|
||||||
"extensions": "Bővítmények",
|
"extensions": "Bővítmények",
|
||||||
"extensionInstallUrl": "Telepítési URL",
|
"extensionInstallUrl": "Telepítési URL",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "Tambah",
|
"add": "Tambah",
|
||||||
"edit": "Sunting",
|
"edit": "Sunting",
|
||||||
"newVersionTitle": "Temukan versi batu @version",
|
"newVersionTitle": "Temukan versi batu @version",
|
||||||
"newVersionUpdate": "Perbarui Sekarang",
|
"newVersionUpdate": "Perbarui",
|
||||||
"newVersionLater": "Nanti",
|
"newVersionLater": "Nanti",
|
||||||
"extensions": "Ekstensi",
|
"extensions": "Ekstensi",
|
||||||
"extensionInstallUrl": "URL Instal",
|
"extensionInstallUrl": "URL Instal",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "Aggiungi",
|
"add": "Aggiungi",
|
||||||
"edit": "Modifica",
|
"edit": "Modifica",
|
||||||
"newVersionTitle": "Scopri la nuova versione @version",
|
"newVersionTitle": "Scopri la nuova versione @version",
|
||||||
"newVersionUpdate": "Aggiorna ora",
|
"newVersionUpdate": "Aggiorna",
|
||||||
"newVersionLater": "Dopo",
|
"newVersionLater": "Dopo",
|
||||||
"extensions": "Estensioni",
|
"extensions": "Estensioni",
|
||||||
"extensionInstallUrl": "Installa URL",
|
"extensionInstallUrl": "Installa URL",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "追加",
|
"add": "追加",
|
||||||
"edit": "編集",
|
"edit": "編集",
|
||||||
"newVersionTitle": "新しいバージョン @version を発見する",
|
"newVersionTitle": "新しいバージョン @version を発見する",
|
||||||
"newVersionUpdate": "アップデート",
|
"newVersionUpdate": "更新",
|
||||||
"newVersionLater": "後で",
|
"newVersionLater": "後で",
|
||||||
"extensions": "拡張機能",
|
"extensions": "拡張機能",
|
||||||
"extensionInstallUrl": "インストールURL",
|
"extensionInstallUrl": "インストールURL",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "추가",
|
"add": "추가",
|
||||||
"edit": "편집",
|
"edit": "편집",
|
||||||
"newVersionTitle": "새 버전 @version 발견",
|
"newVersionTitle": "새 버전 @version 발견",
|
||||||
"newVersionUpdate": "지금 업데이트",
|
"newVersionUpdate": "업데이트",
|
||||||
"newVersionLater": "나중에",
|
"newVersionLater": "나중에",
|
||||||
"extensions": "확장 프로그램",
|
"extensions": "확장 프로그램",
|
||||||
"extensionInstallUrl": "설치 URL",
|
"extensionInstallUrl": "설치 URL",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "Dodaj",
|
"add": "Dodaj",
|
||||||
"edit": "Edycja",
|
"edit": "Edycja",
|
||||||
"newVersionTitle": "Sprawdź aktualizację @version",
|
"newVersionTitle": "Sprawdź aktualizację @version",
|
||||||
"newVersionUpdate": "Aktualizuj teraz",
|
"newVersionUpdate": "Aktualizuj",
|
||||||
"newVersionLater": "Później",
|
"newVersionLater": "Później",
|
||||||
"extensions": "Wtyczki",
|
"extensions": "Wtyczki",
|
||||||
"extensionInstallUrl": "Instaluj z url",
|
"extensionInstallUrl": "Instaluj z url",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "Adicionar",
|
"add": "Adicionar",
|
||||||
"edit": "Editar",
|
"edit": "Editar",
|
||||||
"newVersionTitle": "Nova Versão Disponível @version",
|
"newVersionTitle": "Nova Versão Disponível @version",
|
||||||
"newVersionUpdate": "Atualizar Agora",
|
"newVersionUpdate": "Atualizar",
|
||||||
"newVersionLater": "Mais Tarde",
|
"newVersionLater": "Mais Tarde",
|
||||||
"extensions": "Extensões",
|
"extensions": "Extensões",
|
||||||
"extensionInstallUrl": "Link de Instalação",
|
"extensionInstallUrl": "Link de Instalação",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "சேர்",
|
"add": "சேர்",
|
||||||
"edit": "திருத்துக",
|
"edit": "திருத்துக",
|
||||||
"newVersionTitle": "புதிய பதிப்பைக் கண்டறியவும் @version",
|
"newVersionTitle": "புதிய பதிப்பைக் கண்டறியவும் @version",
|
||||||
"newVersionUpdate": "இப்பொழுது புதுப்பி",
|
"newVersionUpdate": "புதுப்பிப்பு",
|
||||||
"newVersionLater": "பின்னர்",
|
"newVersionLater": "பின்னர்",
|
||||||
"extensions": "நீட்டிப்புகள்",
|
"extensions": "நீட்டிப்புகள்",
|
||||||
"extensionInstallUrl": "நிறுவப்படும் URL",
|
"extensionInstallUrl": "நிறுவப்படும் URL",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "Ekle",
|
"add": "Ekle",
|
||||||
"edit": "Düzenle",
|
"edit": "Düzenle",
|
||||||
"newVersionTitle": "Yeni sürüm @version keşfedildi",
|
"newVersionTitle": "Yeni sürüm @version keşfedildi",
|
||||||
"newVersionUpdate": "Şimdi Güncelle",
|
"newVersionUpdate": "Güncelle",
|
||||||
"newVersionLater": "Daha Sonra",
|
"newVersionLater": "Daha Sonra",
|
||||||
"extensions": "Eklentiler",
|
"extensions": "Eklentiler",
|
||||||
"extensionInstallUrl": "Kurulum URL'si",
|
"extensionInstallUrl": "Kurulum URL'si",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "Додати",
|
"add": "Додати",
|
||||||
"edit": "Редагування",
|
"edit": "Редагування",
|
||||||
"newVersionTitle": "Доступна нова версія @Version",
|
"newVersionTitle": "Доступна нова версія @Version",
|
||||||
"newVersionUpdate": "Оновити зараз",
|
"newVersionUpdate": "Оновити",
|
||||||
"newVersionLater": "Пізніше",
|
"newVersionLater": "Пізніше",
|
||||||
"extensions": "Розширення",
|
"extensions": "Розширення",
|
||||||
"extensionInstallUrl": "URL для встановлення",
|
"extensionInstallUrl": "URL для встановлення",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "Thêm",
|
"add": "Thêm",
|
||||||
"edit": "Sửa",
|
"edit": "Sửa",
|
||||||
"newVersionTitle": "Khám phá phiên bản mới @version",
|
"newVersionTitle": "Khám phá phiên bản mới @version",
|
||||||
"newVersionUpdate": "Cập nhật ngay",
|
"newVersionUpdate": "Cập nhật",
|
||||||
"newVersionLater": "Sau",
|
"newVersionLater": "Sau",
|
||||||
"extensions": "Tiện ích mở rộng",
|
"extensions": "Tiện ích mở rộng",
|
||||||
"extensionInstallUrl": "Liên kết cài đặt",
|
"extensionInstallUrl": "Liên kết cài đặt",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "添加",
|
"add": "添加",
|
||||||
"edit": "编辑",
|
"edit": "编辑",
|
||||||
"newVersionTitle": "发现新版本 @version",
|
"newVersionTitle": "发现新版本 @version",
|
||||||
"newVersionUpdate": "立即更新",
|
"newVersionUpdate": "更新",
|
||||||
"newVersionLater": "稍后再说",
|
"newVersionLater": "稍后再说",
|
||||||
"extensions": "扩展",
|
"extensions": "扩展",
|
||||||
"extensionInstallUrl": "安装链接",
|
"extensionInstallUrl": "安装链接",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
"add": "新增",
|
"add": "新增",
|
||||||
"edit": "編輯",
|
"edit": "編輯",
|
||||||
"newVersionTitle": "發現新版本 @version",
|
"newVersionTitle": "發現新版本 @version",
|
||||||
"newVersionUpdate": "立即更新",
|
"newVersionUpdate": "更新",
|
||||||
"newVersionLater": "稍後",
|
"newVersionLater": "稍後",
|
||||||
"extensions": "擴充功能",
|
"extensions": "擴充功能",
|
||||||
"extensionInstallUrl": "安裝 URL",
|
"extensionInstallUrl": "安裝 URL",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class AppDetailDrawer extends StatelessWidget {
|
|||||||
required this.child,
|
required this.child,
|
||||||
this.drawerKey,
|
this.drawerKey,
|
||||||
this.width,
|
this.width,
|
||||||
|
this.titleTrailing,
|
||||||
});
|
});
|
||||||
|
|
||||||
final bool open;
|
final bool open;
|
||||||
@@ -24,6 +25,7 @@ class AppDetailDrawer extends StatelessWidget {
|
|||||||
final Widget child;
|
final Widget child;
|
||||||
final Key? drawerKey;
|
final Key? drawerKey;
|
||||||
final double? width;
|
final double? width;
|
||||||
|
final Widget? titleTrailing;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -82,15 +84,25 @@ class AppDetailDrawer extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Row(
|
||||||
title,
|
children: [
|
||||||
maxLines: 1,
|
Flexible(
|
||||||
overflow: TextOverflow.ellipsis,
|
child: Text(
|
||||||
style: TextStyle(
|
title,
|
||||||
color: palette.textPrimary,
|
maxLines: 1,
|
||||||
fontSize: 16,
|
overflow: TextOverflow.ellipsis,
|
||||||
fontWeight: FontWeight.w700,
|
style: TextStyle(
|
||||||
),
|
color: palette.textPrimary,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (titleTrailing != null) ...[
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Flexible(child: titleTrailing!),
|
||||||
|
],
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
|
|||||||
@@ -13,12 +13,14 @@ class AppDetailPage extends StatelessWidget {
|
|||||||
required this.onBack,
|
required this.onBack,
|
||||||
required this.child,
|
required this.child,
|
||||||
this.backgroundColor,
|
this.backgroundColor,
|
||||||
|
this.titleTrailing,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String title;
|
final String title;
|
||||||
final VoidCallback onBack;
|
final VoidCallback onBack;
|
||||||
final Widget child;
|
final Widget child;
|
||||||
final Color? backgroundColor;
|
final Color? backgroundColor;
|
||||||
|
final Widget? titleTrailing;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -53,12 +55,22 @@ class AppDetailPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Row(
|
||||||
title,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
textAlign: TextAlign.center,
|
children: [
|
||||||
maxLines: 1,
|
Flexible(
|
||||||
overflow: TextOverflow.ellipsis,
|
child: Text(
|
||||||
style: TextStyle(color: palette.textPrimary, fontSize: 17, fontWeight: FontWeight.w700),
|
title,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(color: palette.textPrimary, fontSize: 17, fontWeight: FontWeight.w700),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (titleTrailing != null) ...[
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Flexible(child: titleTrailing!),
|
||||||
|
],
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 44),
|
const SizedBox(width: 44),
|
||||||
|
|||||||
@@ -817,7 +817,9 @@ void main() {
|
|||||||
await tester.tap(find.byKey(const ValueKey('extension-card-extension-0')));
|
await tester.tap(find.byKey(const ValueKey('extension-card-extension-0')));
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
}
|
}
|
||||||
final entry = find.byKey(ValueKey(details ? 'extension-details-update' : 'update-extension-extension-0'));
|
final entry = find.byKey(
|
||||||
|
ValueKey(details ? 'extension-details-update' : 'extension-card-update-status-extension-0'),
|
||||||
|
);
|
||||||
final dialog = find.byKey(const ValueKey('extension-update-dialog'));
|
final dialog = find.byKey(const ValueKey('extension-update-dialog'));
|
||||||
final confirm = find.byKey(const ValueKey('confirm-update-extension-button'));
|
final confirm = find.byKey(const ValueKey('confirm-update-extension-button'));
|
||||||
final cancel = find.byKey(const ValueKey('cancel-update-extension-button'));
|
final cancel = find.byKey(const ValueKey('cancel-update-extension-button'));
|
||||||
@@ -2327,7 +2329,7 @@ void main() {
|
|||||||
final progress = find.descendant(of: updateButton, matching: find.byType(shad.CircularProgressIndicator));
|
final progress = find.descendant(of: updateButton, matching: find.byType(shad.CircularProgressIndicator));
|
||||||
expect(progress, findsOneWidget);
|
expect(progress, findsOneWidget);
|
||||||
expect(tester.getSize(progress), const Size.square(14));
|
expect(tester.getSize(progress), const Size.square(14));
|
||||||
expect(find.descendant(of: updateButton, matching: find.text('Update Now')), findsOneWidget);
|
expect(find.descendant(of: updateButton, matching: find.text('Update')), findsOneWidget);
|
||||||
|
|
||||||
runtimeController.completeTrackerUpdate();
|
runtimeController.completeTrackerUpdate();
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
|
|||||||
Reference in new issue
Block a user