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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kasy-cli",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "CLI for scaffolding production-ready Flutter SaaS apps with Firebase, Supabase, or API REST backends.",
5
5
  "bin": {
6
6
  "kasy": "./bin/kasy.js"
@@ -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/kasy_app_bar.dart';
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
- final confirmed = await showDialog<bool>(
70
- context: context,
71
- builder: (dialogCtx) => AlertDialog(
72
- title: Text(tr.delete_all_confirm_title),
73
- content: Text(tr.delete_all_confirm_message),
74
- actions: [
75
- TextButton(
76
- onPressed: () => Navigator.of(dialogCtx).pop(false),
77
- child: Text(tr.cancel_action),
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 != true || !context.mounted) return;
79
+ if (!confirmed || !context.mounted) return;
88
80
  await ref.read(notificationsProvider.notifier).deleteAll();
89
81
  if (!context.mounted) return;
90
- ScaffoldMessenger.of(context).showSnackBar(
91
- SnackBar(content: Text(tr.deleted_all)),
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
- ScaffoldMessenger.of(context).showSnackBar(
100
- SnackBar(content: Text(tr.deleted_one)),
93
+ showKasyToast(
94
+ context,
95
+ title: tr.deleted_one,
96
+ tone: KasyToastTone.success,
101
97
  );
102
98
  }
103
99