kasy-cli 1.8.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import 'dart:async';
|
|
|
3
3
|
import 'package:flutter/material.dart';
|
|
4
4
|
import 'package:flutter/rendering.dart';
|
|
5
5
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
6
|
-
import 'package:kasy_kit/components/
|
|
6
|
+
import 'package:kasy_kit/components/components.dart';
|
|
7
7
|
import 'package:kasy_kit/core/theme/theme.dart';
|
|
8
8
|
import 'package:kasy_kit/features/notifications/providers/models/notification.dart'
|
|
9
9
|
as app;
|
|
@@ -66,29 +66,23 @@ class _NotificationsPageState extends ConsumerState<NotificationsPage> {
|
|
|
66
66
|
|
|
67
67
|
Future<void> _confirmAndDeleteAll(BuildContext context) async {
|
|
68
68
|
final tr = t.notifications;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
),
|
|
79
|
-
TextButton(
|
|
80
|
-
onPressed: () => Navigator.of(dialogCtx).pop(true),
|
|
81
|
-
style: TextButton.styleFrom(foregroundColor: context.colors.error),
|
|
82
|
-
child: Text(tr.delete_action),
|
|
83
|
-
),
|
|
84
|
-
],
|
|
85
|
-
),
|
|
69
|
+
bool confirmed = false;
|
|
70
|
+
await showKasyConfirmDialog(
|
|
71
|
+
context,
|
|
72
|
+
title: tr.delete_all_confirm_title,
|
|
73
|
+
message: tr.delete_all_confirm_message,
|
|
74
|
+
cancelLabel: tr.cancel_action,
|
|
75
|
+
confirmLabel: tr.delete_action,
|
|
76
|
+
destructive: true,
|
|
77
|
+
onConfirm: () => confirmed = true,
|
|
86
78
|
);
|
|
87
|
-
if (confirmed
|
|
79
|
+
if (!confirmed || !context.mounted) return;
|
|
88
80
|
await ref.read(notificationsProvider.notifier).deleteAll();
|
|
89
81
|
if (!context.mounted) return;
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
showKasyToast(
|
|
83
|
+
context,
|
|
84
|
+
title: tr.deleted_all,
|
|
85
|
+
tone: KasyToastTone.success,
|
|
92
86
|
);
|
|
93
87
|
}
|
|
94
88
|
|
|
@@ -96,8 +90,10 @@ class _NotificationsPageState extends ConsumerState<NotificationsPage> {
|
|
|
96
90
|
final tr = t.notifications;
|
|
97
91
|
await ref.read(notificationsProvider.notifier).delete(n);
|
|
98
92
|
if (!context.mounted) return;
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
showKasyToast(
|
|
94
|
+
context,
|
|
95
|
+
title: tr.deleted_one,
|
|
96
|
+
tone: KasyToastTone.success,
|
|
101
97
|
);
|
|
102
98
|
}
|
|
103
99
|
|