Files
plezy/lib/widgets/deletion_progress_dialog.dart
T

58 lines
1.7 KiB
Dart
Raw Normal View History

2025-12-11 19:15:06 +01:00
import 'package:flutter/material.dart';
2025-12-15 01:16:22 +01:00
import '../models/download_models.dart';
2025-12-11 19:15:06 +01:00
import '../i18n/strings.g.dart';
class DeletionProgressDialog extends StatelessWidget {
final DeletionProgress progress;
const DeletionProgressDialog({super.key, required this.progress});
@override
Widget build(BuildContext context) {
final t = Translations.of(context);
return PopScope(
canPop: false, // Prevent back button dismissal
child: AlertDialog(
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
2025-12-15 02:29:03 +01:00
const SizedBox(width: 48, height: 48, child: CircularProgressIndicator()),
2025-12-11 19:15:06 +01:00
const SizedBox(height: 24),
Text(
t.downloads.deletingWithProgress(
title: progress.itemTitle,
current: progress.currentItem,
total: progress.totalItems,
),
style: Theme.of(context).textTheme.titleMedium,
textAlign: TextAlign.center,
),
const SizedBox(height: 16),
LinearProgressIndicator(value: progress.progressPercent),
const SizedBox(height: 8),
2025-12-15 02:29:03 +01:00
Text('${progress.progressPercentInt}%', style: Theme.of(context).textTheme.bodySmall),
2025-12-11 19:15:06 +01:00
if (progress.currentOperation != null) ...[
const SizedBox(height: 8),
Text(
progress.currentOperation!,
style: Theme.of(context).textTheme.bodySmall?.copyWith(
2025-12-15 02:29:03 +01:00
color: Theme.of(context).textTheme.bodySmall?.color?.withValues(alpha: 0.7),
),
2025-12-11 19:15:06 +01:00
textAlign: TextAlign.center,
),
],
],
),
),
);
}
}