fix: mark archived task deletion destructive
This commit is contained in:
parent
9fbbfe881e
commit
3b61b68e2d
@ -75,6 +75,7 @@ class SettingsArchivedTasksPanel extends StatelessWidget {
|
|||||||
BuildContext context,
|
BuildContext context,
|
||||||
GatewaySessionSummary session,
|
GatewaySessionSummary session,
|
||||||
) async {
|
) async {
|
||||||
|
final palette = context.palette;
|
||||||
final result = await showDialog<bool>(
|
final result = await showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => AlertDialog(
|
builder: (context) => AlertDialog(
|
||||||
@ -90,11 +91,15 @@ class SettingsArchivedTasksPanel extends StatelessWidget {
|
|||||||
onPressed: () => Navigator.of(context).pop(false),
|
onPressed: () => Navigator.of(context).pop(false),
|
||||||
child: Text(appText('取消', 'Cancel')),
|
child: Text(appText('取消', 'Cancel')),
|
||||||
),
|
),
|
||||||
FilledButton.tonalIcon(
|
FilledButton.icon(
|
||||||
key: const ValueKey('settings-archived-task-confirm-delete'),
|
key: const ValueKey('settings-archived-task-confirm-delete'),
|
||||||
onPressed: () => Navigator.of(context).pop(true),
|
onPressed: () => Navigator.of(context).pop(true),
|
||||||
|
style: FilledButton.styleFrom(
|
||||||
|
backgroundColor: palette.danger,
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
),
|
||||||
icon: const Icon(Icons.delete_outline_rounded),
|
icon: const Icon(Icons.delete_outline_rounded),
|
||||||
label: Text(appText('删除记录', 'Delete record')),
|
label: Text(appText('彻底删除', 'Delete permanently')),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -89,6 +89,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
expect(find.text('彻底删除归档记录'), findsOneWidget);
|
expect(find.text('彻底删除归档记录'), findsOneWidget);
|
||||||
|
expect(find.text('彻底删除'), findsOneWidget);
|
||||||
|
|
||||||
await tester.tap(
|
await tester.tap(
|
||||||
find.byKey(const ValueKey('settings-archived-task-confirm-delete')),
|
find.byKey(const ValueKey('settings-archived-task-confirm-delete')),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user