Skip to content

Commit d3d8943

Browse files
committed
v6.32.0
1 parent 613962f commit d3d8943

File tree

8 files changed

+45
-13
lines changed

8 files changed

+45
-13
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [6.32.0] - 2025-07-02
2+
3+
* Added `excludeKeys` to `NyStorage.deleteAll`. This will allow you to exclude certain keys from being deleted when calling `deleteAll`.
4+
* Added `hasExecutedTaskOnce` in NyScheduler. This will allow you to check if a task has been executed.
5+
* Update pubspec.yaml
6+
17
## [6.31.0] - 2025-06-23
28

39
* Added `set` to NySession class. This will allow you to set a value in the session.

analysis_options.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ analyzer:
1111
errors:
1212
non_constant_identifier_names: ignore
1313
camel_case_types: ignore
14-
include: package:flutter_lints/flutter.yaml
1514

1615
linter:
1716
# The lint rules applied to this project can be customized in the

example/pubspec.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,10 @@ packages:
321321
dependency: transitive
322322
description:
323323
name: get_time_ago
324-
sha256: "1c6ccc877e480eee559987411ec5242cecc088d45fc821f0d8aec98bbf4f210e"
324+
sha256: cd111914562ca2b938afbc73f715fab1f37795cc053924d08f6de59878781388
325325
url: "https://pub.dev"
326326
source: hosted
327-
version: "2.3.1"
327+
version: "2.3.2"
328328
http:
329329
dependency: transitive
330330
description:
@@ -419,7 +419,7 @@ packages:
419419
path: ".."
420420
relative: true
421421
source: path
422-
version: "6.31.0"
422+
version: "6.32.0"
423423
path:
424424
dependency: transitive
425425
description:

lib/helpers/ny_scheduler.dart

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class NyScheduler {
5252
/// ```
5353
/// The above example will only execute once.
5454
/// The next time you call NyScheduler.once("myFunction", () {}) it will not execute.
55-
static taskOnce(String name, Function() callback) async {
55+
static Future<void> taskOnce(String name, Function() callback) async {
5656
String key = "${name}_once";
5757
bool alreadyExecuted = await readBool(key);
5858
if (!alreadyExecuted) {
@@ -61,6 +61,17 @@ class NyScheduler {
6161
}
6262
}
6363

64+
/// Check if a task has been executed
65+
static Future<bool> hasExecutedTaskOnce(String name) async {
66+
String key = "${name}_once";
67+
return await readBool(key);
68+
}
69+
70+
/// Get the key for a task that runs once
71+
static String getKeyTaskOnce(String name) {
72+
return "${name}_once";
73+
}
74+
6475
/// Run a task daily
6576
/// Provide a [name] for the function and a [callback] to execute.
6677
/// The function will execute every day.

lib/local_storage/local_storage.dart

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,19 @@ class NyStorage {
190190
}
191191

192192
/// Deletes all keys with associated values.
193-
static Future deleteAll({bool andFromBackpack = false}) async {
193+
static Future deleteAll(
194+
{bool andFromBackpack = false, List<String>? excludeKeys}) async {
195+
if (excludeKeys != null && excludeKeys.isNotEmpty) {
196+
Map<String, String> allValues = await readAll();
197+
for (String key in excludeKeys) {
198+
allValues.remove(key);
199+
}
200+
for (var data in allValues.entries) {
201+
await delete(data.key, andFromBackpack: andFromBackpack);
202+
}
203+
return;
204+
}
205+
194206
if (andFromBackpack == true) {
195207
Backpack.instance.deleteAll();
196208
}

lib/nylo.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,12 @@ class Nylo {
782782
}
783783

784784
/// Wipe all storage data
785-
static Future<void> wipeAllStorageData() async {
786-
await NyStorage.deleteAll(andFromBackpack: true);
785+
static Future<void> wipeAllStorageData({
786+
List<String>? excludeKeys,
787+
bool andFromBackpack = true,
788+
}) async {
789+
await NyStorage.deleteAll(
790+
andFromBackpack: andFromBackpack, excludeKeys: excludeKeys);
787791
}
788792

789793
/// Check if the router contains specific [routes]

pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,10 @@ packages:
329329
dependency: "direct main"
330330
description:
331331
name: get_time_ago
332-
sha256: "1c6ccc877e480eee559987411ec5242cecc088d45fc821f0d8aec98bbf4f210e"
332+
sha256: cd111914562ca2b938afbc73f715fab1f37795cc053924d08f6de59878781388
333333
url: "https://pub.dev"
334334
source: hosted
335-
version: "2.3.1"
335+
version: "2.3.2"
336336
http:
337337
dependency: transitive
338338
description:

pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: nylo_support
22
description: Support library for the Nylo framework. This library supports routing, widgets, localization, cli, storage and more.
3-
version: 6.31.0
3+
version: 6.32.0
44
homepage: https://nylo.dev
55
repository: https://github.com/nylo-core/support/tree/6.x
66
issue_tracker: https://github.com/nylo-core/support/issues
@@ -23,7 +23,7 @@ dependencies:
2323
flutter_staggered_grid_view: ^0.7.0
2424
dio: ^5.8.0+1
2525
recase: ^4.1.0
26-
get_time_ago: ^2.3.1
26+
get_time_ago: ^2.3.2
2727
flutter_styled_toast: ^2.2.1
2828
animate_do: ^4.2.0
2929
pull_to_refresh_flutter3: ^2.0.2
@@ -44,7 +44,7 @@ dependencies:
4444
uuid: ^4.5.1
4545
ffi: ^2.1.4
4646
win32: ^5.14.0
47-
characters: ^1.2.1
47+
characters: ^1.4.0
4848
flutter_web_plugins:
4949
sdk: flutter
5050
flutter_localizations:

0 commit comments

Comments
 (0)